Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:ActionButtonGroupGetIcon

From RoR Wiki

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

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

See also