Module uiprompt
UI prompts and prompt groups
Class UipromptManager
UipromptManager:startEventThread () | Start an automatic event handling thread for all prompts and prompt groups. |
Class Uiprompt
Uiprompt:new (controls, text, group, enabled) | Create a new UI prompt. |
Uiprompt:getHandle () | Get the raw handle of the prompt. |
Uiprompt:isActive () | Get whether the prompt is active. |
Uiprompt:isControlActionActive () | Get whether any control action is active |
Uiprompt:isEnabled () | Get whether the prompt is enabled. |
Uiprompt:setEnabled (toggle) | Enable or disable the prompt. |
Uiprompt:setVisible (toggle) | Toggle visibility of the prompt. |
Uiprompt:setEnabledAndVisible (toggle) | Enable/disable and toggle visibility of the prompt. |
Uiprompt:isJustPressed () | Check if prompt was just pressed. |
Uiprompt:isJustReleased () | Check if prompt was just released. |
Uiprompt:isPressed () | Check if prompt is pressed. |
Uiprompt:isReleased () | Check if prompt is released. |
Uiprompt:isValid () | Check if prompt is valid. |
Uiprompt:setStandardMode (toggle) | Toggle standard mode on the prompt. |
Uiprompt:hasStandardModeCompleted () | Check if the prompt's standard mode is completed. |
Uiprompt:hasStandardModeJustCompleted () | Check if the prompt's standard mode was just completed. |
Uiprompt:hasHoldMode () | Get whether this prompt has hold mode enabled. |
Uiprompt:setHoldMode (toggle) | Toggle hold mode on the prompt. |
Uiprompt:isHoldModeRunning () | Check if the prompt's hold mode is running. |
Uiprompt:hasHoldModeCompleted () | Check if the prompt's hold mode is completed. |
Uiprompt:hasHoldModeJustCompleted () | Check if the prompt's hold mode was just completed. |
Uiprompt:setMashMode (count) | Set mash mode on the prompt. |
Uiprompt:setMashIndefinitelyMode () | Set indefinite mash mode on the prompt. |
Uiprompt:hasMashMode () | Get whether the prompt is using mash mode. |
Uiprompt:hasMashModeCompleted () | Get whether the prompt's mash mode has completed. |
Uiprompt:hasMashModeJustCompleted () | Get whether the prompt's mash mode was just completed. |
Uiprompt:getText () | Get the text label of the prompt. |
Uiprompt:setText (text) | Set the text label of the prompt. |
Uiprompt:setGroup (group) | Add the prompt to a prompt group. |
Uiprompt:isControlPressed (padIndex) | Check if any of the controls associated with the prompt are pressed. |
Uiprompt:isControlReleased (padIndex) | Check if any of the controls associated with the prompt are released. |
Uiprompt:isControlJustPressed (padIndex) | Check if any of the controls associated with the prompt were just pressed. |
Uiprompt:isControlJustReleased (padIndex) | Check if any of the controls associated with the prompt were just released. |
Uiprompt:enableControlAction (padIndex) | Enable all control actions associated with the prompt. |
Uiprompt:disableControlAction (padIndex) | Disable all control actions associated with the prompt. |
Uiprompt:setOnJustPressed (handler) | Set a handler that is executed when the prompt was just pressed. |
Uiprompt:setOnJustReleased (handler) | Set a handler that is executed when the prompt was just released. |
Uiprompt:setOnPressed (handler) | Set a handler that is executed when the prompt is pressed. |
Uiprompt:setOnReleased (handler) | Set a handler that is executed when the prompt is released. |
Uiprompt:setOnControlPressed (handler) | Set a handler that is executed when any control associated with the prompt is pressed. |
Uiprompt:setOnControlReleased (handler) | Set a handler that is executed when any control associated with the prompt is released. |
Uiprompt:setOnControlJustPressed (handler) | Set a handler that is executed when any control associated with the prompt was just pressed. |
Uiprompt:setOnControlJustReleased (handler) | Set a handler that is executed when any control associated with the prompt was just released. |
Uiprompt:setOnStandardModeCompleted (handler) | Set a handler that is executed when the prompt's standard mode has completed. |
Uiprompt:setOnStandardModeJustCompleted (handler) | Set a handler that is executed when the prompt's standard mode has just completed. |
Uiprompt:setOnHoldModeRunning (handler) | Set a handler that is executed when the prompt's hold mode is running. |
Uiprompt:setOnHoldModeCompleted (handler) | Set a handler that is executed when the prompt's hold mode has completed. |
Uiprompt:setOnHoldModeJustCompleted (handler) | Set a handler that is executed when the prompt's hold mode has just completed. |
Uiprompt:setOnMashModeCompleted (handler) | Set a handler that is executed when the prompt's mash mode has completed. |
Uiprompt:setOnMashModeJustCompleted (handler) | Set a handler that is executed when the prompt's mash mode has just completed. |
Uiprompt:handleEvents (...) | Handle events for this prompt. |
Uiprompt:delete () | Clean up the prompt |
Class UipromptGroup
UipromptGroup:new (text, active) | Create a new UI prompt group |
UipromptGroup:getGroupId () | Get the raw group ID of the prompt group. |
UipromptGroup:setActiveThisFrame () | Display the prompt group. |
UipromptGroup:getText () | Get the text label of the prompt group |
UipromptGroup:setText (text) | Set the text label of the prompt group |
UipromptGroup:getPrompts () | Get a table of the individual prompts in the prompt group |
UipromptGroup:addPrompt (prompt) | Add an existing prompt to the group. |
UipromptGroup:isJustPressed (callback) | Check if any prompts in the group were just pressed. |
UipromptGroup:isJustReleased (callback) | Check if any prompts in the group were just released. |
UipromptGroup:isPressed (callback) | Check if any prompts in the group are pressed. |
UipromptGroup:isReleased (callback) | Check if any prompts in the group are released. |
UipromptGroup:isControlPressed (padIndex, callback) | Check if any of the controls of any of the prompts in the group are pressed |
UipromptGroup:isControlReleased (padIndex, callback) | Check if any of the controls of any of the prompts in the group are released |
UipromptGroup:isControlJustPressed (padIndex, callback) | Check if any of the controls of any of the prompts in the group were just pressed |
UipromptGroup:isControlJustReleased (padIndex, callback) | Check if any of the controls of any of the prompts in the group were just released |
UipromptGroup:enableControlAction (padIndex) | Enable all control actions of all prompts in the group. |
UipromptGroup:disableControlAction (padIndex) | Disable all control actions of all prompts in the group. |
UipromptGroup:hasStandardModeCompleted (callback) | Check if the standard mode of any of the prompts in the group has completed. |
UipromptGroup:hasStandardModeJustCompleted (callback) | Check if the standard mode of any of the prompts in the group has just completed. |
UipromptGroup:isHoldModeRunning (callback) | Check if the hold mode of any of the prompts in the group is running. |
UipromptGroup:hasHoldModeCompleted (callback) | Check if the hold mode of any of the prompts in the group has completed. |
UipromptGroup:hasHoldModeJustCompleted (callback) | Check if the hold mode of any of the prompts in the group has just completed. |
UipromptGroup:hasMashModeCompleted (callback) | Check if the mash mode of any of the prompts in the group has completed. |
UipromptGroup:hasMashModeJustCompleted (callback) | Check if the mash mode of any of the prompts in the group has just completed. |
UipromptGroup:setOnJustPressed (handler) | Set a handler that is executed when any prompt in the group was just pressed. |
UipromptGroup:setOnJustReleased (handler) | Set a handler that is executed when any prompt in the group was just released. |
UipromptGroup:setOnPressed (handler) | Set a handler that is executed when any prompt in the group is pressed. |
UipromptGroup:setOnReleased (handler) | Set a handler that is executed when any prompt in the group is released. |
UipromptGroup:setOnStandardModeCompleted (handler) | Set a handler that is executed when any prompt in the group has completed its standard mode. |
UipromptGroup:setOnStandardModeJustCompleted (handler) | Set a handler that is executed when any prompt in the group has just completed its standard mode. |
UipromptGroup:setOnHoldModeRunning (handler) | Set a handler that is executed when any prompt in the group is running its hold mode. |
UipromptGroup:setOnHoldModeCompleted (handler) | Set a handler that is executed when any prompt in the group has completed its hold mode. |
UipromptGroup:setOnHoldModeJustCompleted (handler) | Set a handler that is executed when any prompt in the group has just completed its hold mode. |
UipromptGroup:setOnMashModeCompleted (handler) | Set a handler that is executed when any prompt in the group has completed its mash mode. |
UipromptGroup:setOnMashModeJustCompleted (handler) | Set a handler that is executed when any prompt in the group has just completed its mash mode. |
UipromptGroup:setOnControlJustPressed (handler) | Set a handler that is executed when any control of any prompt in the group was just pressed. |
UipromptGroup:setOnControlJustReleased (handler) | Set a handler that is executed when any control of any prompt in the group was just released. |
UipromptGroup:setOnControlPressed (handler) | Set a handler that is executed when any control of any prompt in the group is pressed. |
Uiprompt:setOnControlReleased (handler) | Set a handler that is executed when any control of any prompt in the group is released. |
UipromptGroup:isActive () | Get whether the group is active. |
UipromptGroup:setActive (toggle) | Set whether the group is active. |
UipromptGroup:handleEvents (...) | Handle events for all prompts in the group (should be called every frame) |
UipromptGroup:setEnabled (toggle) | Enable or disable all prompts in the group. |
UipromptGroup:delete () | Clean up all prompts in the prompt group |
Class UipromptManager
System for automatically handling and cleaning up prompts and groups.
- UipromptManager:startEventThread ()
-
Start an automatic event handling thread for all prompts and prompt groups.
To use a custom thread instead, call Uiprompt:handleEvents or UipromptGroup:handleEvents every frame. This can be more efficient and also allows passing extra data to any event handlers as arguments to these methods.
Usage:
UipromptManager:startEventThread()
Class Uiprompt
A single UI prompt.
- Uiprompt:new (controls, text, group, enabled)
-
Create a new UI prompt.
Parameters:
- controls An individual control or a table of controls associated with the prompt. The control name can be given as a string or hash.
- text The text label of the prompt.
- group An optional UipromptGroup object or integer ID of a group to add this prompt to.
- enabled Whether the prompt is enabled and visible immediately. Default is true.
Returns:
-
A new Uiprompt object.
Usage:
local prompt = Uiprompt:new(`INPUT_DYNAMIC_SCENARIO`, "Use")
local prompt = Uiprompt:new("INPUT_DYNAMIC_SCENARIO", "Use")
local prompt = Uiprompt:new({`INPUT_FRONTEND_UP`, `INPUT_FRONTEND_DOWN`}, "Up/Down")
local prompt = Uiprompt:new(`INPUT_DYNAMIC_SCENARIO`, "Use", promptGroup)
local prompt = Uiprompt:new(`INPUT_DYNAMIC_SCENARIO`, "Use", nil, false)
- Uiprompt:getHandle ()
-
Get the raw handle of the prompt.
Returns:
-
The integer handle of the prompt.
Usage:
local handle = prompt:getHandle()
- Uiprompt:isActive ()
-
Get whether the prompt is active.
Returns:
-
true or false
Usage:
if prompt:isActive() then ... end
- Uiprompt:isControlActionActive ()
-
Get whether any control action is active
Returns:
-
true or false
Usage:
if prompt:isControlActionActive() then ... end
- Uiprompt:isEnabled ()
-
Get whether the prompt is enabled.
Returns:
-
true or false
Usage:
if prompt:isEnabled() then ... end
- Uiprompt:setEnabled (toggle)
-
Enable or disable the prompt.
Parameters:
- toggle true to enable, false to disable
Usage:
prompt:setEnabled(true)
- Uiprompt:setVisible (toggle)
-
Toggle visibility of the prompt.
Parameters:
- toggle true to show, false to hide
- Uiprompt:setEnabledAndVisible (toggle)
-
Enable/disable and toggle visibility of the prompt.
Parameters:
- toggle true to enable and show, false to disable and hide
- Uiprompt:isJustPressed ()
-
Check if prompt was just pressed.
Returns:
-
true or false
Usage:
if prompt:isJustPressed() then ... end
- Uiprompt:isJustReleased ()
-
Check if prompt was just released.
Returns:
-
true or false
Usage:
if prompt:isJustReleased() then ... end
- Uiprompt:isPressed ()
-
Check if prompt is pressed.
Returns:
-
true or false
Usage:
if prompt:isPressed() then ... end
- Uiprompt:isReleased ()
-
Check if prompt is released.
Returns:
-
true or false
Usage:
if prompt:isReleased() then ... end
- Uiprompt:isValid ()
-
Check if prompt is valid.
Returns:
-
true or false
Usage:
if prompt:isValid() then ... end
- Uiprompt:setStandardMode (toggle)
-
Toggle standard mode on the prompt.
Parameters:
- toggle true to enable standard mode, false to disable.
Usage:
prompt:setStandardMode(true)
- Uiprompt:hasStandardModeCompleted ()
-
Check if the prompt's standard mode is completed.
Usage:
if prompt:hasStandardModeCompleted() then ... end
- Uiprompt:hasStandardModeJustCompleted ()
-
Check if the prompt's standard mode was just completed.
Usage:
if prompt:hasStandardModeJustCompleted() then ... end
- Uiprompt:hasHoldMode ()
-
Get whether this prompt has hold mode enabled.
Returns:
-
true or false
Usage:
if prompt:hasHoldMode() then ... end
- Uiprompt:setHoldMode (toggle)
-
Toggle hold mode on the prompt.
Parameters:
- toggle true to enable hold mode, false to disable
Usage:
prompt:setHoldMode(true)
- Uiprompt:isHoldModeRunning ()
-
Check if the prompt's hold mode is running.
Returns:
-
true or false
Usage:
if prompt:isHoldModeRunning() then ... end
- Uiprompt:hasHoldModeCompleted ()
-
Check if the prompt's hold mode is completed.
Returns:
-
true or false
Usage:
if prompt:hasHoldModeCompleted() then ... end
- Uiprompt:hasHoldModeJustCompleted ()
-
Check if the prompt's hold mode was just completed.
Returns:
-
true or false
Usage:
if prompt:hasHoldModeJustCompleted() then ... end
- Uiprompt:setMashMode (count)
-
Set mash mode on the prompt.
Parameters:
- count The number of times the prompt must be mashed in order to complete.
Usage:
prompt:setMashMode(10)
- Uiprompt:setMashIndefinitelyMode ()
-
Set indefinite mash mode on the prompt.
Usage:
prompt:setMashIndefinitelyMode()
- Uiprompt:hasMashMode ()
-
Get whether the prompt is using mash mode.
Returns:
-
true or false
Usage:
if prompt:hasMashMode() then ... end
- Uiprompt:hasMashModeCompleted ()
-
Get whether the prompt's mash mode has completed.
Returns:
-
true or false
Usage:
if prompt:hasMashModeCompleted() then ... end
- Uiprompt:hasMashModeJustCompleted ()
-
Get whether the prompt's mash mode was just completed.
Returns:
-
true or false
Usage:
if prompt:hasMashModeJustCompleted() then ... end
- Uiprompt:getText ()
-
Get the text label of the prompt.
Returns:
-
The text label of the UI prompt
Usage:
local text = prompt:getText()
- Uiprompt:setText (text)
-
Set the text label of the prompt.
Parameters:
- text The new text for the UI prompt label
Usage:
prompt:setText("Hold")
- Uiprompt:setGroup (group)
-
Add the prompt to a prompt group.
Parameters:
- group A UipromptGroup object or integer ID of the group to add the prompt to.
Usage:
prompt:setGroup(promptGroup)
- Uiprompt:isControlPressed (padIndex)
-
Check if any of the controls associated with the prompt are pressed.
Parameters:
- padIndex
Returns:
-
true or false
Usage:
if prompt:isControlPressed(0) then ... end
- Uiprompt:isControlReleased (padIndex)
-
Check if any of the controls associated with the prompt are released.
Parameters:
- padIndex
Returns:
-
true or false
Usage:
if prompt:isControlReleased(0) then ... end
- Uiprompt:isControlJustPressed (padIndex)
-
Check if any of the controls associated with the prompt were just pressed.
Parameters:
- padIndex
Returns:
-
true or false
Usage:
if prompt:isControlJustPressed(0) then ... end
- Uiprompt:isControlJustReleased (padIndex)
-
Check if any of the controls associated with the prompt were just released.
Parameters:
- padIndex
Returns:
-
true or false
Usage:
if prompt:isControlJustReleased(0) then ... end
- Uiprompt:enableControlAction (padIndex)
-
Enable all control actions associated with the prompt.
Parameters:
- padIndex
Usage:
prompt:enableControlAction(0)
- Uiprompt:disableControlAction (padIndex)
-
Disable all control actions associated with the prompt.
Parameters:
- padIndex
Usage:
prompt:disableControlAction(0)
- Uiprompt:setOnJustPressed (handler)
-
Set a handler that is executed when the prompt was just pressed.
Parameters:
- handler Handler function
Usage:
prompt:setOnJustPressed(function(prompt, ...) ... end)
- Uiprompt:setOnJustReleased (handler)
-
Set a handler that is executed when the prompt was just released.
Parameters:
- handler Handler function
Usage:
prompt:setOnJustReleased(function(prompt, ...) ... end)
- Uiprompt:setOnPressed (handler)
-
Set a handler that is executed when the prompt is pressed.
Parameters:
- handler Handler function
Usage:
prompt:setOnPressed(function(prompt, ...) ... end)
- Uiprompt:setOnReleased (handler)
-
Set a handler that is executed when the prompt is released.
Parameters:
- handler Handler function
Usage:
prompt:setOnReleased(function(prompt, ...) ... end)
- Uiprompt:setOnControlPressed (handler)
-
Set a handler that is executed when any control associated with the prompt is pressed.
Parameters:
- handler Handler function
Usage:
prompt:setOnControlPressed(function(prompt, ...) ... end)
- Uiprompt:setOnControlReleased (handler)
-
Set a handler that is executed when any control associated with the prompt is released.
Parameters:
- handler Handler function
Usage:
prompt:setOnControlReleased(function(prompt, ...) ... end)
- Uiprompt:setOnControlJustPressed (handler)
-
Set a handler that is executed when any control associated with the prompt was just pressed.
Parameters:
- handler Handler function
Usage:
prompt:setOnControlJustPressed(function(prompt, ...) ... end)
- Uiprompt:setOnControlJustReleased (handler)
-
Set a handler that is executed when any control associated with the prompt was just released.
Parameters:
- handler Handler function
Usage:
prompt:setOnControlJustReleased(function(prompt, ...) ... end)
- Uiprompt:setOnStandardModeCompleted (handler)
-
Set a handler that is executed when the prompt's standard mode has completed.
Parameters:
- handler Handler function
Usage:
prompt:setOnStandardModeCompleted(function(prompt, ...) ... end)
- Uiprompt:setOnStandardModeJustCompleted (handler)
-
Set a handler that is executed when the prompt's standard mode has just completed.
Parameters:
- handler Handler function
Usage:
prompt:setOnStandardModeJustCompleted(function(prompt, ...) ... end)
- Uiprompt:setOnHoldModeRunning (handler)
-
Set a handler that is executed when the prompt's hold mode is running.
Parameters:
- handler Handler function
Usage:
prompt:setOnHoldModeRunning(function(prompt, ...) ... end)
- Uiprompt:setOnHoldModeCompleted (handler)
-
Set a handler that is executed when the prompt's hold mode has completed.
Parameters:
- handler Handler function
Usage:
prompt:setOnHoldModeCompleted(function(prompt, ...) ... end)
- Uiprompt:setOnHoldModeJustCompleted (handler)
-
Set a handler that is executed when the prompt's hold mode has just completed.
Parameters:
- handler Handler function
Usage:
prompt:setOnHoldModeCompleted(function(prompt, ...) ... end)
- Uiprompt:setOnMashModeCompleted (handler)
-
Set a handler that is executed when the prompt's mash mode has completed.
Parameters:
- handler Handler function
Usage:
prompt:setOnMashModeCompleted(function(prompt, ...) ... end)
- Uiprompt:setOnMashModeJustCompleted (handler)
-
Set a handler that is executed when the prompt's mash mode has just completed.
Parameters:
- handler Handler function
Usage:
prompt:setOnMashModeJustCompleted(function(prompt, ...) ... end)
- Uiprompt:handleEvents (...)
-
Handle events for this prompt. Should be called every frame.
Parameters:
- ... Variable number of extra arguments passed to the handlers for any events.
Usage:
prompt:handleEvents()
- Uiprompt:delete ()
-
Clean up the prompt
Usage:
prompt:delete()
Class UipromptGroup
A group of UI prompts
- UipromptGroup:new (text, active)
-
Create a new UI prompt group
Parameters:
- text The text label for the prompt group
- active Whether the group is active. Default is true.
Returns:
-
A new UipromptGroup object
Usage:
local promptGroup = UipromptGroup:new("Interact")
- UipromptGroup:getGroupId ()
-
Get the raw group ID of the prompt group.
Returns:
-
The integer group ID of the group.
Usage:
local groupId = promptGroup:getGroupId()
- UipromptGroup:setActiveThisFrame ()
-
Display the prompt group. This must be called every frame.
Usage:
promptGroup:setActiveThisFrame()
- UipromptGroup:getText ()
-
Get the text label of the prompt group
Returns:
-
The text label of the prompt group
Usage:
local text = promptGroup:getText()
- UipromptGroup:setText (text)
-
Set the text label of the prompt group
Parameters:
- text The new label
Usage:
promptGroup:setText("Food")
- UipromptGroup:getPrompts ()
-
Get a table of the individual prompts in the prompt group
Returns:
-
A table of Uiprompt objects
Usage:
for _, prompt in ipairs(promptGroup:getPrompts()) do ... end
- UipromptGroup:addPrompt (prompt)
-
Add an existing prompt to the group.
Parameters:
- prompt A Uiprompt object or integer ID of a prompt to add to the group.
Returns:
-
The prompt that was added to the group.
Usage:
promptGroup:addPrompt(prompt)
- UipromptGroup:isJustPressed (callback)
-
Check if any prompts in the group were just pressed.
Parameters:
- callback An optional callback function that is executed for each prompt that was just pressed.
Returns:
-
true or false
Usage:
if promptGroup:isJustPressed() then ... end
promptGroup:isJustPressed(function(prompt) ... end)
- UipromptGroup:isJustReleased (callback)
-
Check if any prompts in the group were just released.
Parameters:
- callback An optional callback function that is executed for each prompt that was just released.
Returns:
-
true or false
Usage:
if promptGroup:isJustReleased() then ... end
promptGroup:isJustReleased(function(prompt) ... end)
- UipromptGroup:isPressed (callback)
-
Check if any prompts in the group are pressed.
Parameters:
- callback An optional callback function that is executed for each prompt that is pressed.
Returns:
-
true or false
Usage:
if promptGroup:isPressed() then ... end
promptGroup:isPressed(function(prompt) ... end)
- UipromptGroup:isReleased (callback)
-
Check if any prompts in the group are released.
Parameters:
- callback An optional callback function that is executed for each prompt that is released.
Returns:
-
true or false
Usage:
if promptGroup:isReleased() then ... end
promptGroup:isReleased(function(prompt) ... end)
- UipromptGroup:isControlPressed (padIndex, callback)
-
Check if any of the controls of any of the prompts in the group are pressed
Parameters:
- padIndex
- callback An optional callback function that is executed for each prompt that has a control pressed.
Returns:
-
true or false
Usage:
if promptGroup:isControlPressed(0) then ... end
promptGroup:isControlPressed(0, function(prompt) ... end)
- UipromptGroup:isControlReleased (padIndex, callback)
-
Check if any of the controls of any of the prompts in the group are released
Parameters:
- padIndex
- callback An optional callback function that is executed for each prompt that has a control released.
Returns:
-
true or false
Usage:
if promptGroup:isControlReleased(0) then ... end
promptGroup:isControlReleased(0, function(prompt) ... end)
- UipromptGroup:isControlJustPressed (padIndex, callback)
-
Check if any of the controls of any of the prompts in the group were just pressed
Parameters:
- padIndex
- callback An optional callback that is executed for each prompt that has a control that was just pressed.
Returns:
-
true or false
Usage:
if promptGroup:isControlJustPressed(0) then ... end
if promptGroup:isControlJustPressed(0, function(prompt) ... end)
- UipromptGroup:isControlJustReleased (padIndex, callback)
-
Check if any of the controls of any of the prompts in the group were just released
Parameters:
- padIndex
- callback An optional callback that is executed for each prompt that has a control that was just released.
Returns:
-
true or false
Usage:
if promptGroup:isControlJustReleased(0) then ... end
promptGroup:isControlJustReleased(0, function(prompt) ... end)
- UipromptGroup:enableControlAction (padIndex)
-
Enable all control actions of all prompts in the group.
Parameters:
- padIndex
Usage:
promptGroup:enableControlAction(0)
- UipromptGroup:disableControlAction (padIndex)
-
Disable all control actions of all prompts in the group.
Parameters:
- padIndex
Usage:
promptGroup:disableControlAction(0)
- UipromptGroup:hasStandardModeCompleted (callback)
-
Check if the standard mode of any of the prompts in the group has completed.
Parameters:
- callback An optional callback function that is executed for each prompt who's standard mode has completed.
Usage:
if promptGroup:hasStandardModeCompleted() then ... end
promptGroup:hasStandardModeCompleted(function(prompt) ... end)
- UipromptGroup:hasStandardModeJustCompleted (callback)
-
Check if the standard mode of any of the prompts in the group has just completed.
Parameters:
- callback An optional callback function that is executed for each prompt who's standard mode has just completed.
Usage:
if promptGroup:hasStandardModeJustCompleted() then ... end
promptGroup:hasStandardModeJustCompleted(function(prompt) ... end)
- UipromptGroup:isHoldModeRunning (callback)
-
Check if the hold mode of any of the prompts in the group is running.
Parameters:
- callback An optional callback function that is executed for each prompt who's hold mode is running.
Returns:
-
true or false
Usage:
if promptGroup:isHoldModeRunning() then ... end
promptGroup:isHoldModeRunning(function(prompt) ... end)
- UipromptGroup:hasHoldModeCompleted (callback)
-
Check if the hold mode of any of the prompts in the group has completed.
Parameters:
- callback An optional callback function that is executed for each prompt who's hold mode has completed.
Returns:
-
true or false
Usage:
if promptGroup:hasHoldModeCompleted() then ... end
promptGroup:hasHoldModeCompleted(function(prompt) ... end)
- UipromptGroup:hasHoldModeJustCompleted (callback)
-
Check if the hold mode of any of the prompts in the group has just completed.
Parameters:
- callback An optional callback function that is executed for each prompt who's hold mode has just completed.
Returns:
-
true or false
Usage:
if promptGroup:hasHoldModeJustCompleted() then ... end
promptGroup:hasHoldModeJustCompleted(function(prompt) ... end)
- UipromptGroup:hasMashModeCompleted (callback)
-
Check if the mash mode of any of the prompts in the group has completed.
Parameters:
- callback An optional callback function that is executed for each prompt who's mash mode has completed.
Returns:
-
true or false
Usage:
if promptGroup:hasMashModeCompleted() then ... end
promptGroup:hasMashModeCompleted(function(prompt) ... end)
- UipromptGroup:hasMashModeJustCompleted (callback)
-
Check if the mash mode of any of the prompts in the group has just completed.
Parameters:
- callback An optional callback function that is executed for each prompt who's mash mode has just completed.
Returns:
-
true or false
Usage:
if promptGroup:hasMashModeJustCompleted() then ... end
promptGroup:hasMashModeJustCompleted(function(prompt) ... end)
- UipromptGroup:setOnJustPressed (handler)
-
Set a handler that is executed when any prompt in the group was just pressed.
Parameters:
- handler Handler function
Usage:
promptGroup:setOnJustPressed(function(group, prompt, ...) ... end)
- UipromptGroup:setOnJustReleased (handler)
-
Set a handler that is executed when any prompt in the group was just released.
Parameters:
- handler Handler function
Usage:
promptGroup:setOnJustReleased(function(group, prompt, ...) ... end)
- UipromptGroup:setOnPressed (handler)
-
Set a handler that is executed when any prompt in the group is pressed.
Parameters:
- handler Handler function
Usage:
promptGroup:setOnPressed(function(group, prompt, ...) ... end)
- UipromptGroup:setOnReleased (handler)
-
Set a handler that is executed when any prompt in the group is released.
Parameters:
- handler Handler function
Usage:
promptGroup:setOnReleased(function(group, prompt, ...) ... end)
- UipromptGroup:setOnStandardModeCompleted (handler)
-
Set a handler that is executed when any prompt in the group has completed its standard mode.
Parameters:
- handler Handler function
Usage:
promptGroup:setOnStandardModeCompleted(function(group, prompt, ...) ... end)
- UipromptGroup:setOnStandardModeJustCompleted (handler)
-
Set a handler that is executed when any prompt in the group has just completed its standard mode.
Parameters:
- handler Handler function
Usage:
promptGroup:setOnStandarDModeJustCompleted(function(group, prompt, ...) ... end)
- UipromptGroup:setOnHoldModeRunning (handler)
-
Set a handler that is executed when any prompt in the group is running its hold mode.
Parameters:
- handler Handler function
Usage:
promptGroup:setOnHoldModeRunning(function(group, prompt, ...) ... end)
- UipromptGroup:setOnHoldModeCompleted (handler)
-
Set a handler that is executed when any prompt in the group has completed its hold mode.
Parameters:
- handler Handler function
Usage:
promptGroup:setOnHoldModeCompleted(function(group, prompt, ...) ... end)
- UipromptGroup:setOnHoldModeJustCompleted (handler)
-
Set a handler that is executed when any prompt in the group has just completed its hold mode.
Parameters:
- handler Handler function
Usage:
promptGroup:setOnHoldModeJustCompleted(function(group, prompt, ...) ... end)
- UipromptGroup:setOnMashModeCompleted (handler)
-
Set a handler that is executed when any prompt in the group has completed its mash mode.
Parameters:
- handler Handler function
Usage:
promptGroup:setOnMashModeCompleted(function(group, prompt, ...) ... end)
- UipromptGroup:setOnMashModeJustCompleted (handler)
-
Set a handler that is executed when any prompt in the group has just completed its mash mode.
Parameters:
- handler Handler function
Usage:
promptGroup:setOnMashModeJustCompleted(function(group, prompt, ...) ... end)
- UipromptGroup:setOnControlJustPressed (handler)
-
Set a handler that is executed when any control of any prompt in the group was just pressed.
Parameters:
- handler Handler function
Usage:
promptGroup:setOnControlJustPressed(function(group, prompt, ...) ... end)
- UipromptGroup:setOnControlJustReleased (handler)
-
Set a handler that is executed when any control of any prompt in the group was just released.
Parameters:
- handler Handler function
Usage:
promptGroup:setOnControlJustReleased(function(group, prompt, ...) ... end)
- UipromptGroup:setOnControlPressed (handler)
-
Set a handler that is executed when any control of any prompt in the group is pressed.
Parameters:
- handler Handler function
Usage:
promptGroup:setOnControlPressed(function(group, prompt, ...) ... end)
- Uiprompt:setOnControlReleased (handler)
-
Set a handler that is executed when any control of any prompt in the group is released.
Parameters:
- handler Handler function
Usage:
promptGroup:setOnControlReleased(function(group, prompt, ...) ... end)
- UipromptGroup:isActive ()
-
Get whether the group is active.
Returns:
-
true or false
Usage:
if promptGroup:isActive() then ... end
- UipromptGroup:setActive (toggle)
-
Set whether the group is active.
Parameters:
- toggle
Returns:
-
true or false
Usage:
promptGroup:setActive(true)
- UipromptGroup:handleEvents (...)
-
Handle events for all prompts in the group (should be called every frame)
Parameters:
- ... Variable number of extra arguments passed to the handlers for any events.
Usage:
promptGroup:handleEvents()
- UipromptGroup:setEnabled (toggle)
-
Enable or disable all prompts in the group.
Parameters:
- toggle true to enable, false to disable
Usage:
promptGroup:setEnabled(false)
- UipromptGroup:delete ()
-
Clean up all prompts in the prompt group
Usage:
promptGroup:delete()