API:ButtonGetPressedFlag
From RoR Wiki
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–trueif 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 existError 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" )
