API:ActionButtonGroupSetIcon
From RoR Wiki
UI Lua API · ActionButtonGroup functions
Version: WAR 1.4.8
Sets the icon shown on one button of an ActionButtonGroup.
ActionButtonGroupSetIcon(groupName, buttonIndex, iconId)
Arguments
- groupName
string– Name of an ActionButtonGroup window.- buttonIndex
number– Button number, starting at 1.- iconId
number– Icon number, for example an item'siconNum.0clears the icon.
Returns
Nothing.
Details
buttonIndexmust be between 1 and the number of buttons (see ActionButtonGroupSetNumButtons); otherwise the not a valid ButtonIndex error is raised. Fractions are dropped.- The icon number is looked up in the client's icon data and the matching part of the icon texture is shown on the button.
Errors
Error in function call 'ActionButtonGroupSetIcon': Window %s does not existError in function call 'ActionButtonGroupSetIcon': Window %s is not a ActionButtonGroupError in function call 'ActionButtonGroupSetIcon': '%d' is not a valid ButtonIndex. (NumButtons = '%d')
Example
Clearing and filling a backpack slot, from ea_backpackwindow/source/backpackiconview.lua:
ActionButtonGroupSetIcon( buttonGroupName, buttonIndex, 0 ) ActionButtonGroupSetText( buttonGroupName, buttonIndex, L"" ) ActionButtonGroupSetTimer( buttonGroupName, buttonIndex, 0, 0 ) ActionButtonGroupSetTintColor( buttonGroupName, buttonIndex, 255, 255, 255 ) ... ActionButtonGroupSetIcon( buttonGroupName, buttonIndex, itemData.iconNum )
