API:GetEquippedItemVisible
From RoR Wiki
UI Lua API · Item functions
Version: WAR 1.4.8
Meant to return whether the player's helm or cloak is shown. In the current client the slot numbers it checks are off by one. See Details.
visible = GetEquippedItemVisible(slotNumber)
Arguments
- slotNumber
number– Slot number. See Details for the values that actually work.
Returns
- visible
boolean–trueif the item is shown.
Details
- The function only knows two values:
- 8 returns the helm visibility setting;
- 12 returns the cloak visibility setting.
- Any other value returns
true.
GameData.EquipSlots.HELMis 9 andGameData.EquipSlots.BACKis 13, so calling it with those constants (as the stock UI does) always returnstrue. PassGameData.EquipSlots.HELM - 1orGameData.EquipSlots.BACK - 1to read the real setting. SetEquippedItemVisible subtracts 1 itself and works with the constants.- If there is no player object, or the client has no appearance data for the player, the function returns
true. - If the argument check fails, the Invalid Parameters message names
SetEquippedItemVisible, not this function. The function still returnstruein that case. - The function needs at least one argument and only reads the last one.
Errors
None besides the generic Invalid Parameters message when the argument is missing or not a number.
Example
The stock call, from default/ea_characterwindow/source/characterwindow.lua (both values are always true here, see Details):
local showHelm = GetEquippedItemVisible( GameData.EquipSlots.HELM ) local showCloak = GetEquippedItemVisible( GameData.EquipSlots.BACK )
Reading the real helm setting:
local showHelm = GetEquippedItemVisible( GameData.EquipSlots.HELM - 1 )
