API:TomeGetBestiaryTOC
From RoR Wiki
UI Lua API · Tome functions
Version: WAR 1.4.8
Returns the table of contents of the Tome of Knowledge bestiary: every creature type with its subtypes.
types = TomeGetBestiaryTOC()
Arguments
None.
Returns
- types
table– Array of creature types. The stock UI sorts it by name itself.
Each type table:
| Key | Type | Meaning |
|---|---|---|
id |
number |
Type id. |
name |
wstring |
Type name. |
subtypes |
table |
Array of the type's subtypes (see below). |
Each subtype table in subtypes:
| Key | Type | Meaning |
|---|---|---|
id |
number |
Subtype id, as used by TomeGetBestiarySubTypeData. |
name |
wstring |
Subtype name. |
isUnlocked |
boolean |
true if at least one species of the subtype is unlocked (see TomeIsBestiarySubTypeUnlocked).
|
killCount |
number |
The player's kill count for the subtype. |
Details
- All types and subtypes are listed, including locked ones. Names are filled in for locked subtypes too.
- If the name tables are not loaded, names are empty wide strings.
Errors
None.
Example
From ea_tomeofknowledge/source/tomewindow_bestiary.lua:
TomeWindow.Bestiary.TOCData = TomeGetBestiaryTOC()
...
for typeIndex, typeData in ipairs( TomeWindow.Bestiary.TOCData ) do
...
for subTypeIndex, subTypeData in ipairs( typeData.subtypes ) do
local killText = L""..subTypeData.killCount
TomeWindow.SetTOCItemText( subTypeWindowName, subTypeData.id, subTypeData.name, killText )
ButtonSetDisabledFlag( subTypeWindowName.."Text", subTypeData.isUnlocked == false )
end
end
