Skip to main content

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

newPage()

Returns:

TypeDescription
PageAn action wheel page that contains actions

Example (Overload 1):

local myPage = action_wheel:newPage()

setPage()

Sets the Page of the action wheel to the given Title or Page

setPage(page)

Parameters:

NameTypeDescriptionDefault
pagePageA reference to an action wheel pagenil

Returns:

TypeDescription
ActionWheelAPIReturns 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

getPage(pageTitle)

Parameters:

NameTypeDescriptionDefault
pageTitleStringThe name for the page that is used internallynil

Returns:

TypeDescription
PageAn action wheel page that contains actions

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:

TypeDescription
PageAn 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:

TypeDescription
ActionAn action wheel action

Example:

local myAction = action_wheel:newAction()

getSelectedAction()

Returns the Action that is currently selected in the Action Wheel

getSelectedAction()

Returns:

TypeDescription
ActionAn action wheel action

Example:

action_wheel:getSelectedAction()

getSelected()

Returns the index of the currently selected action

getSelected()

Returns:

TypeDescription
IntegerA 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

execute(index, rightClick)

Parameters:

NameTypeDescriptionDefault
indexIntegerA number indicating which slot's action to executenil
rightClickBooleanIf set to true it will execute the action's right click actionfalse

Returns:

TypeDescription
ActionWheelAPIReturns 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:

TypeDescription
BooleanIf 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