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:35

Adds 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 nil Category submenu to put the option in; top level when nil
  • GetInfo Function Returns the option table
  • OnCreateMenu Function optional, defaults to nil Stored 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:65

Adds 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 nil Category submenu to put the option in; top level when nil
  • command String Unique ID of the command
  • options List optional, defaults to nil Sub options; the chosen one is passed to the command as its argument

Returns

  • String The option name

Defined in