Interaction Prompts
Register core managed prompts, remember, these are client-sided.
CreatePromptGroup
Create a group of prompts that can be enabled/disabled.
Parameters
| Parameter |
Required |
Type |
Description |
| prompts |
Yes |
List |
A list of prompts to create the prompt group for |
local promptGroupId = exports.core:CreatePromptGroup({
{
Id = 'prompt_internal_name',
Complete = function()
-- function to call when user selects item
end,
Title = '', -- The title of the prompt
Description = '', -- Optional description text
Icon = '', -- The font-awesome icon I.e. 'fad fa-circle'
AutoComplete = false, -- Optional, auto-complete the prompt selection if only 1 prompt is available
}
})
DeletePromptGroup
Remove a prompt group and delete it.
Parameters
| Parameter |
Required |
Type |
Description |
| promptGroupId |
Yes |
Int |
The prompt group id |
exports.core:DeletePromptGroup(promptGroupId)
ShowPromptGroup
Enable interaction and visibility of a prompt group
Parameters
| Parameter |
Required |
Type |
Description |
| promptGroupId |
Yes |
Int |
The prompt group Id to enable |
| promptRestrictions |
No |
List |
A list of prompts to enable if you don't want to enable them all |
| forceUpdate |
No |
Boolean |
If we should force an update when the prompt group is already enabled. I.e. to enable a new restricted set of prompts |
exports.core:ShowPromptGroup(promptGroupId, { 'prompt_internal_name' })
HidePromptGroup
Hides all prompts from a group
exports.core:HidePromptGroup(promptGroupId)
CreatePrompt
Create a new prompt within an existing prompt group.
exports.core:CreatePrompt({
Id = 'new_prompt',
Complete = function()
-- function to call when user selects item
end,
Title = 'New Prompt',
Description = 'This is a new prompt',
Icon = 'fad fa-star',
AutoComplete = false
}, promptGroupId)
UpdatePromptTitle
Update the title of an existing prompt.
exports.core:UpdatePromptTitle(promptGroupId, 'prompt_id', 'New Title')
UpdatePromptDescription
Update the description of an existing prompt.
exports.core:UpdatePromptDescription(promptGroupId, 'prompt_id', 'New Description')
UpdatePromptIcon
Update the icon of an existing prompt.
exports.core:UpdatePromptIcon(promptGroupId, 'prompt_id', 'fad fa-heart')
IsPromptGroupVisible
Check if a prompt group is currently visible.
local isVisible = exports.core:IsPromptGroupVisible(promptGroupId)
IsPromptVisible
Check if a specific prompt is currently visible.
local isVisible = exports.core:IsPromptVisible(promptGroupId, 'prompt_id')