API:TomeIsBestiarySubTypeUnlocked
From RoR Wiki
UI Lua API · Tome functions
Version: WAR 1.4.8
Returns whether a bestiary subtype is unlocked, that is, whether the player has unlocked at least one of its species.
unlocked = TomeIsBestiarySubTypeUnlocked(subTypeId)
Arguments
- subTypeId
number– Subtype id.
Returns
- unlocked
boolean–trueif at least one species of the subtype is unlocked;falseotherwise, or if the id is unknown.
Details
- The same test fills the
isUnlockedfield of the subtypes in TomeGetBestiaryTOC, and TomeGetBestiarySubTypeData refuses subtypes for which it isfalse. - Unknown ids return
falsewithout an error. - The argument check is shared with TomeGetBestiarySpeciesData: if the argument is missing or not a number, the Invalid Parameters message names that function.
Errors
None besides the Invalid Parameters argument check.
Example
From ea_tomeofknowledge/source/tomewindow_bestiary.lua:
function TomeWindow.ShowBestiarySubType( id )
-- Is the subtype unlocked?
if( TomeIsBestiarySubTypeUnlocked(id) ~= true ) then
return
end
TomeWindow.UpdateActiveBestiarySubType( id )
...
end
