API:TomeGetHistoryAndLoreTOC
From RoR Wiki
UI Lua API · Tome functions
Version: WAR 1.4.8
Returns the table of contents of the Tome of Knowledge History and Lore section: the zone pairings, split into tiers, with their zones.
pairings = TomeGetHistoryAndLoreTOC()
Arguments
None.
Returns
- pairings
table– Array of zone pairings.
Each pairing table:
| Key | Type | Meaning |
|---|---|---|
id |
number |
Pairing id. |
name |
wstring |
Pairing name. |
tiers |
table |
Array of exactly four tier tables, for tiers 1 to 4. Each has one key, zones.
|
Each zone table in tiers[n].zones:
| Key | Type | Meaning |
|---|---|---|
id |
number |
Zone id, as used by TomeGetHistoryAndLoreZoneData. |
name |
wstring |
Zone name. |
Details
- All pairings and zones of the section are listed, whether or not the player has unlocked anything there.
- A tier with no zones has an empty
zonestable. - If the name tables are not loaded, names are empty wide strings.
Errors
None.
Example
From ea_tomeofknowledge/source/tomewindow_historyandlore.lua:
TomeWindow.HistoryAndLore.TOCData = TomeGetHistoryAndLoreTOC()
-- Sorth the pairing and zones lists by their names
for pairingIndex, pairingData in ipairs( TomeWindow.HistoryAndLore.TOCData ) do
for tierIndex, tierData in ipairs( pairingData.tiers ) do
table.sort( tierData.zones, DataUtils.AlphabetizeByNames )
end
end
