Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:ActionButtonGroupGetId

From RoR Wiki

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

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

See also