API:ActionButtonGroupSetNumButtons
From RoR Wiki
UI Lua API · ActionButtonGroup functions
Version: WAR 1.4.8
Sets how many rows and columns of buttons an ActionButtonGroup has.
ActionButtonGroupSetNumButtons(groupName, numRows, numCols)
Arguments
- groupName
string– Name of an ActionButtonGroup window.- numRows
number– Number of rows. Fractions are dropped.- numCols
number– Number of columns. Fractions are dropped.
Returns
Nothing.
Details
- The group then has
numRows × numColsbuttons, numbered from 1. - If the total number of buttons changes, the button list is rebuilt.
- The group window is resized to fit the grid: the buttons plus the spacing between them. With 0 buttons its size becomes 0 by 0.
Errors
Error in function call 'ActionButtonGroupSetNumButtons': Window %s does not existError in function call 'ActionButtonGroupSetNumButtons': Window %s is not a ActionButtonGroup
Example
From ea_backpackwindow/source/backpackiconview.lua:
local totalSlots = pocketData.lastSlotID - pocketData.firstSlotID local numRows = math.ceil( totalSlots/EA_Window_Backpack.NUM_SLOTS_WIDE ) local numCols = EA_Window_Backpack.NUM_SLOTS_WIDE ActionButtonGroupSetNumButtons( pocketWindowName.."Buttons", numRows, numCols )
