Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:ActionButtonGroupSetNumButtons

From RoR Wiki

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 × numCols buttons, 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 exist
  • Error 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 )

See also