cw.quickmenu classclient
Defines the client-side cw.quickmenu library, the options of the quick menu opened from the player information
box.
cw.quickmenu:AddCallback adds an option that a function builds each time the menu opens, and
cw.quickmenu:AddCommand adds one that runs a command.
Summary
Methods
Adds an option to the quick menu opened from the player information box.
Adds a quick menu option that runs a command.
Methods
cw.quickmenu:AddCallback(name, category, GetInfo, OnCreateMenu)
client gamemodes/catwork/gamemode/core/libraries/cl_quickmenu.lua:35Adds an option to the quick menu opened from the player information box.
GetInfo is called when the menu is built and returns the option table:
Callback (called with the chosen sub option), and optionally toolTip,
name and options (a List of sub options, each a string or a
{ name, value } pair). Returning anything other than a table hides the option.
cw.quickmenu:AddCallback('#QuickMenu_FallOver', nil, function()
return {
toolTip = 'Fall over.',
Callback = function(option)
cw.core:RunCommand('CharFallOver')
end
}
end)
Parameters
- name String Text of the option, or a language phrase
- category String optional, defaults to
nilCategory submenu to put the option in; top level whennil - GetInfo Function Returns the option table
- OnCreateMenu Function optional, defaults to
nilStored with the option; not called by Catwork
Returns
- String The option name
See also
cw.quickmenu:AddCommand(name, category, command, options)
client gamemodes/catwork/gamemode/core/libraries/cl_quickmenu.lua:65Adds a quick menu option that runs a command.
The option shows the command's tip and is hidden when the command does not exist.
Parameters
- name String Text of the option, or a language phrase
- category String optional, defaults to
nilCategory submenu to put the option in; top level whennil - command String Unique ID of the command
- options List optional, defaults to
nilSub options; the chosen one is passed to the command as its argument
Returns
- String The option name