Action Wheel
A global API which is used for customizing your player's Action Wheel
Page
For more on pages go to Page
newPage()
Creates a new Page for the action wheel
A Title can be given to store this page internally
If no Title is given, the Page will just be returned from this function
- Overload 1
- Overload 2
Example (Overload 1):
local myPage = action_wheel:newPage()
setPage()
Sets the Page of the action wheel to the given Title or Page
- Overload 1
- Overload 2
setPage(pageTitle)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pageTitle | String | The name for the page that is used internally | nil |
Returns:
Type | Description |
---|---|
ActionWheelAPI | Returns self for chaining |
setPage(page)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page | Page | A reference to an action wheel page | nil |
Returns:
Type | Description |
---|---|
ActionWheelAPI | Returns self for chaining |
Example (Overload 2):
local myPage = action_wheel:newPage()
action_wheel:setPage(myPage)
getPage()
Returns a stored Page by the given title
If no title is given, returns a table with all registered Pages
- Overload 1
- Overload 2
Example (Overload 2):
action_wheel:newPage("myPage")
action_wheel:getPage("myPage")
-- because getPage needs a string you can only use getPage on pages with titles
getCurrentPage()
Returns the current set Page from the Action Wheel, or NIL if no Page has been set
getCurrentPage()
Returns:
Type | Description |
---|---|
Page | An action wheel page that contains actions |
Example:
action_wheel:getCurrentPage()
Action
For more on actions go to Action
newAction()
Creates a new Action that is not automatically assigned to a Page
newAction()
Returns:
Type | Description |
---|---|
Action | An action wheel action |
Example:
local myAction = action_wheel:newAction()
getSelectedAction()
Returns the Action that is currently selected in the Action Wheel
getSelectedAction()
Returns:
Type | Description |
---|---|
Action | An action wheel action |
Example:
action_wheel:getSelectedAction()
getSelected()
Returns the index of the currently selected action
getSelected()
Returns:
Type | Description |
---|---|
Integer | A number indicating which slot the selected action is in |
Example:
action_wheel:getSelected()
Wheel
execute()
Executes the action of the given index
If the index is null, it will execute the last selected action
A second parameter can be given to specify if it should execute the left click or right click action
- Overload 1
- Overload 2
- Overload 3
execute(index)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index | Integer | A number indicating which slot's action to execute | nil |
Returns:
Type | Description |
---|---|
ActionWheelAPI | Returns self for chaining |
execute(index, rightClick)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index | Integer | A number indicating which slot's action to execute | nil |
rightClick | Boolean | If set to true it will execute the action's right click action | false |
Returns:
Type | Description |
---|---|
ActionWheelAPI | Returns self for chaining |
Example (Overload 3):
action_wheel:execute(1, false)
isEnabled()
Returns if the Action Wheel is being currently rendered or not
isEnabled()
Returns:
Type | Description |
---|---|
Boolean | If true the action wheel is visible, if false it isn't |
Example:
action_wheel:isEnabled()
Fields
leftClick
Function that is executed when the left mouse button is clicked
Examples:
-- pingless example
function action_wheel.leftClick()
log("Left click")
end
-- pinged example
function pings.example()
log("Left click")
end
action_wheel.leftClick = pings.example
rightClick
Function that is executed when the right mouse button is clicked
Example:
function action_wheel.rightClick()
log("Right click")
end
scroll
Function that is executed when the mouse is scrolled
Example:
function action_wheel.scroll()
log("Scrolled")
end