API:ActionButtonGroupGetId
From RoR Wiki
UI Lua API · ActionButtonGroup functions
Version: WAR 1.4.8
Returns the number stored on one button of an ActionButtonGroup.
id = ActionButtonGroupGetId(groupName, buttonIndex)
Arguments
- groupName
string– Name of an ActionButtonGroup window.- buttonIndex
number– Button number, starting at 1. Fractions are dropped.
Returns
- id
number– The value set with ActionButtonGroupSetId.
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 function needs at least two arguments and only reads the last two.
Errors
These are written to the UI log; the call returns normally.
Error in function call 'ActionButtonGroupGetId': Window %s does not existError in function call 'ActionButtonGroupGetId': Window %s is not a ActionButtonGroupError in function call 'ActionButtonGroupGetId': '%d' is not a valid ButtonIndex. (NumButtons = '%d')
Example
A career icon's tooltip, from easystem_tooltips/source/careertooltips.lua:
function Tooltips.OnMouseOverActionButtonGroupCareerIcon( buttonId, flags )
local careerLineId = ActionButtonGroupGetId( SystemData.ActiveWindow.name, buttonId )
local text = GetCareerLine(careerLineId)
