API:ActionButtonGroupSetText
From RoR Wiki
UI Lua API · ActionButtonGroup functions
Version: WAR 1.4.8
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
buttonIndexmust 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 existError in function call 'ActionButtonGroupSetText': Window %s is not a ActionButtonGroupError 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 )
