API:ActionButtonGroupSetId
From RoR Wiki
UI Lua API · ActionButtonGroup functions
Version: WAR 1.4.8
Stores a number on one button of an ActionButtonGroup.
ActionButtonGroupSetId(groupName, buttonIndex, id)
Arguments
- groupName
string– Name of an ActionButtonGroup window.- buttonIndex
number– Button number, starting at 1.- id
number– The value to store. Fractions are dropped.
Returns
Nothing.
Details
- The value is stored on the button and can be read back with ActionButtonGroupGetId.
- The stock UI stores a career line id on each career icon and reads it back in the icon's tooltip handler.
buttonIndexmust be between 1 and the number of buttons (see ActionButtonGroupSetNumButtons); otherwise the not a valid ButtonIndex error is logged. Fractions are dropped.- The function needs at least three arguments and only reads the last three.
Errors
These are written to the UI log; the call returns normally.
Error in function call 'ActionButtonGroupSetId': Window %s does not existError in function call 'ActionButtonGroupSetId': Window %s is not a ActionButtonGroupError in function call 'ActionButtonGroupSetId': '%d' is not a valid ButtonIndex. (NumButtons = '%d')
Example
From ea_uimodwindow/source/uimodwindow.lua:
if( careerLineId )
then
local iconNum = Icons.GetCareerIconIDFromCareerLine(careerLineId)
ActionButtonGroupSetIcon( windowName.."ScrollChildCareers", index, iconNum )
ActionButtonGroupSetId( windowName.."ScrollChildCareers", index, careerLineId )
end
ActionButtonGroupSetShowing( windowName.."ScrollChildCareers", index, careerLineId ~= nil )
