API:ActionButtonGroupGetIcon
From RoR Wiki
UI Lua API · ActionButtonGroup functions
Version: WAR 1.4.8
Returns the icon number shown on one button of an ActionButtonGroup.
iconId = ActionButtonGroupGetIcon(groupName, buttonIndex)
Arguments
- groupName
string– Name of an ActionButtonGroup window.- buttonIndex
number– Button number, starting at 1. Fractions are dropped.
Returns
- iconId
number– The icon number stored by ActionButtonGroupSetIcon; 0 after the icon was cleared with it.
Details
buttonIndexmust be between 1 and the number of buttons; otherwise the not a valid ButtonIndex error is logged and nothing is returned.- If the window does not exist or is not an ActionButtonGroup, the error is logged and nothing is returned.
- The argument check is shared with ActionButtonGroupGetId: if an argument is missing or has the wrong type, the Invalid Parameters message names that function.
- The function needs at least two arguments and only reads the last two.
- The stock UI never calls
ActionButtonGroupGetIcon.
Errors
These are written to the UI log; the call returns normally.
Error in function call 'ActionButtonGroupGetIcon': Window %s does not existError in function call 'ActionButtonGroupGetIcon': Window %s is not a ActionButtonGroupError in function call 'ActionButtonGroupGetIcon': '%d' is not a valid ButtonIndex. (NumButtons = '%d')
Example
A minimal example built from the signature above:
local iconId = ActionButtonGroupGetIcon( "MyButtonGroup", 1 )
