Page
An Action Wheel container which is used to store up to 8 actions
For the entire page assume:
local myPage = action_wheel:newPage()
Action
newAction()
Adds a new Action on the selected Page's index
If no index is given it is added in the first available index
- Overload 1
- Overload 2
Example:
local myAction = myPage:newAction()
getAction()
Gets an Action from the Page's given index
getAction(index)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index | Integer | The slot to get the action from | Required |
Returns:
Type | Description |
---|---|
Action | An action wheel action |
Example:
myPage:getAction(1)
getActions()
Gets a table of the Actions shifted by the given number
If no shift is specified, it returns all Actions from this page
Note that the table is indexed as its slot number as key, so blank slots will result in nil values
- Overload 1
- Overload 2
Example (Overload 1):
myPage:getActions()
setAction()
Aliases: action()
Sets an Action in the Page's given index
If index is -1, the action will be set in the latest empty index
setAction(index, action)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index | Integer | The slot on the page to set the action to | Required |
action | Action | An action wheel action | Required |
Returns:
Type | Description |
---|---|
Page | Returns self for chaining |
Example:
local myAction = action_wheel:newAction()
myPage:setAction(-1, myAction)
Slot
setKeepSlots()
Sets if this page's current slots should be reset when adding this page on the Action Wheel
setKeepSlots(bool)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bool | Boolean | If true the slots won't be reset, if false they will | false |
Returns:
Type | Description |
---|---|
Page | Returns self for chaining |
Example:
myPage:setKeepSlots(true)
shouldKeepSlots()
Gets if this page's current slots should be reset when adding this page on the Action Wheel
shouldKeepSlots()
Returns:
Type | Description |
---|---|
Boolean | If true the slots won't be reset, if false they will |
Example:
myPage:shouldKeepSlots(true)
setSlotsShift()
Aliases: slotsShift()
Sets this page's current slots shift
Slots 1-8 are shift 1, slots 9-16 are 2, etc
setSlotsShift(shift)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shift | Integer | The page shift that will be visible | 1 |
Returns:
Type | Description |
---|---|
Page | Returns self for chaining |
Example:
myPage:setSlotsShift(1)
getSlotsShift()
Gets this page's current slots shift
Slots 1-8 are shift 1, slots 9-16 are 2, etc
getSlotsShift()
Returns:
Type | Description |
---|---|
Integer | The page shift that is visible |
Example:
myPage:getSlotsShift()
Misc
getTitle()
Returns the title of this Page
getTitle()
Returns:
Type | Description |
---|---|
String | The name for the page that is used internally |
Example:
myPage:getTitle()
Fields
keepSlots
Whether or not this page's current slots should be reset when adding this page on the Action Wheel
See setKeepSlots
for an example of how to set it
Example:
myPage.keepSlots = true