Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:ActionButtonGroupSetText

From RoR Wiki

Sets the text shown on one button of an ActionButtonGroup, such as a stack count.

ActionButtonGroupSetText(groupName, buttonIndex, text)

Arguments

groupName
string – Name of an ActionButtonGroup window.
buttonIndex
number – Button number, starting at 1.
text
wstring – The text. It must be a wide string: L"5" works, "5" does not.

Returns

Nothing.

Details

  • buttonIndex must be between 1 and the number of buttons; otherwise the not a valid ButtonIndex error is raised. Fractions are dropped.
  • If the button has no text label, the call does nothing.

Errors

  • Error in function call 'ActionButtonGroupSetText': Window %s does not exist
  • Error in function call 'ActionButtonGroupSetText': Window %s is not a ActionButtonGroup
  • Error in function call 'ActionButtonGroupSetText': '%d' is not a valid ButtonIndex. (NumButtons = '%d')

Example

Showing a stack count, from ea_bankwindow/source/bankwindow.lua:

local stackCount = L""
if itemData.stackCount > 1
then
    stackCount = towstring(itemData.stackCount)
end

ActionButtonGroupSetText( SLOTS_NAME, buttonIndex, stackCount )

See also