API:TomeIsBestiarySpeciesUnlocked
From RoR Wiki
UI Lua API · Tome functions
Version: WAR 1.4.8
Returns whether the player has unlocked a bestiary species.
unlocked = TomeIsBestiarySpeciesUnlocked(speciesId)
Arguments
- speciesId
number– Species id.
Returns
- unlocked
boolean–trueif the species is unlocked;falseif it is locked or the id is unknown.
Details
- 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.ShowBestiarySpecies( id )
-- Is the species unlocked?
if( TomeIsBestiarySpeciesUnlocked(id) ~= true ) then
return
end
TomeWindow.UpdateBestiarySpecies( id )
TomeWindow.OnViewEntry( GameData.Tome.SECTION_BESTIARY, id )
end
