Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:ActionButtonGroupSetIcon

From RoR Wiki
Revision as of 19:40, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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's iconNum. 0 clears the icon.

Returns

Nothing.

Details

  • buttonIndex must 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 exist
  • Error in function call 'ActionButtonGroupSetIcon': Window %s is not a ActionButtonGroup
  • Error 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 )

See also