Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:ButtonGetPressedFlag

From RoR Wiki
Revision as of 19:40, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Button functions
Version: WAR 1.4.8

Returns whether a Button is pressed.

pressed = ButtonGetPressedFlag(buttonName)

Arguments

buttonName
string – Name of a Button window.

Returns

pressed
boolean – true if the button is in the pressed state.

Details

  • The pressed flag is set by ButtonSetPressedFlag and by the client when the button is clicked:
    • A left-button press on the button sets it. On a check button (see ButtonSetCheckButtonFlag) that is already pressed, the press clears it instead, so each click toggles it.
    • On release it is cleared again. Check buttons keep it, and stay-down buttons keep it in the cases described on ButtonSetStayDownFlag.
    • While the button is disabled, clicks do not change it.
  • The stock UI reads it to get the state of check boxes and toggle buttons.

Errors

  • Error in function call 'ButtonGetPressedFlag': Window %s does not exist
  • Error in function call 'ButtonGetPressedFlag': Window %s is not a Button

Example

Reading filter toggle buttons, from ea_backpackwindow/source/backpacklistview.lua:

local shouldShowOnlyUsable = ButtonGetPressedFlag( "EA_Window_BackpackListViewFilterByUsableButton" )
local shouldShowArmor = ButtonGetPressedFlag( "EA_Window_BackpackListViewFilterArmorButton" )

See also