Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:SetEquippedItemVisible

From RoR Wiki

UI Lua API · Item functions
Version: WAR 1.4.8

Shows or hides the player's helm or cloak.

SetEquippedItemVisible(slotNumber, visible)

Arguments

slotNumber
number – GameData.EquipSlots.HELM or GameData.EquipSlots.BACK.
visible
boolean – true to show the item, false to hide it.

Returns

Nothing.

Details

  • Only HELM and BACK do anything. Any other slot is ignored.
  • If the requested state is already the current one, nothing is sent. Otherwise the client issues its helm or cloak toggle command.
  • If there is no player object, or the client has no appearance data for the player, nothing happens.
  • visible must be a real boolean. Passing nil or a number raises an Invalid Parameters error.
  • The function needs at least two arguments and only reads the last two.

Errors

None besides the generic Invalid Parameters message when an argument has the wrong type.

Example

From default/ea_characterwindow/source/characterwindow.lua:

function CharacterWindow.ShowHelm()
    local showHelm = ButtonGetPressedFlag("CharacterWindowContentsEquipmentShowHelm")
    SetEquippedItemVisible(GameData.EquipSlots.HELM, showHelm)
end
function CharacterWindow.ShowCloak()
    local showCloak = ButtonGetPressedFlag("CharacterWindowContentsEquipmentShowCloak")
    SetEquippedItemVisible(GameData.EquipSlots.BACK, showCloak)

See also