Mod API Reference:Client TerritoryInfo
Put the function in a file named Client_TerritoryInfo.lua:
function Client_TerritoryInfo(game, territory, info)
info.AddRow('Fortified: +3 defense');
end
The client calls this hook when a player looks at a territory: in the territory inspector, and in the tooltip shown when hovering over it. Each row your mod adds is shown on its own line.
| Argument | Type | Description |
|---|---|---|
game |
ClientGame | Information about the game. |
territory |
TerritoryDetails | The territory being looked at. Use territory.ID to look it up elsewhere, such as in game.LatestStanding.Territories.
|
info |
table | The object you add rows with. See below. |
- info.AddRow(text): adds a line of plain text. It returns
info, so calls can be chained.
Limits and notes:
- Up to 10 rows per mod are shown, and each row is cut to 200 characters. Extra rows are ignored, and a warning is written to the mod log.
- The client remembers your rows for each territory until the game refreshes or the player views a different point in the game's history. It doesn't call the hook every time the tooltip is drawn.
game.LatestStandingis always the latest turn, even when the player is viewing history.- If the hook errors, the error is shown once. The hook isn't called again until the game next refreshes or the player views a different point in history, so a broken mod doesn't show an error for every territory the player hovers over.