Skip to content

Return of Reckoning

Wiki

RoR Wiki

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 – true if at least one species of the subtype is unlocked; false otherwise, or if the id is unknown.

Details

  • The same test fills the isUnlocked field of the subtypes in TomeGetBestiaryTOC, and TomeGetBestiarySubTypeData refuses subtypes for which it is false.
  • Unknown ids return false without 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

See also