Defines the client-side cw.system library, the pages of the admin system menu.

A system is created with cw.system:New, given a toolTip, the access flags needed to see it and an OnDisplay function that builds the page, and then registered.

Summary

Methods

Returns a registered system.
Returns the system the system menu is showing.
GetAll()client
Returns every registered system.
Returns the system menu panel.
New(name)client
Creates a new admin system object to fill in and register.
Rebuilds the system menu if it is showing a system.
Registers a system so it is listed in the system menu.
Shows a system in the system menu.

Methods

cw.system:FindByID(identifier)

client gamemodes/catwork/gamemode/core/libraries/cl_system.lua:53

Returns a registered system.

Parameters

  • identifier String Name of the system

Returns

  • Map The system, or nil if there is none

Returns the system the system menu is showing.

Returns

  • String Name of the active system, or nil if the menu does not exist or shows none

Returns every registered system.

Returns

  • Map<Map> Systems keyed by name

Returns the system menu panel.

Returns

  • Panel The panel, or nil if it has not been created or was removed

Creates a new admin system object to fill in and register.

A system is a page of the system menu. Set toolTip, access (the flags needed to see it, unless HasAccess is defined) and doesCreateForm, and define OnDisplay(systemPanel, systemForm) to build the page.

local SYSTEM = cw.system:New('Manage Players')
SYSTEM.toolTip = '#System_ManagePlayers_ToolTip'
SYSTEM.access = 'o'

function SYSTEM:OnDisplay(systemPanel, systemForm)
  -- build the page
end

SYSTEM:Register()

Parameters

  • name String optional, defaults to 'Unknown' Name of the system, used as its identifier

Returns

  • Map The new system object

Rebuilds the system menu if it is showing a system.

Parameters

  • name String Name of the system

Registers a system so it is listed in the system menu.

Adds HasAccess (checks the local player for the system's access flags) if the system does not define it, and the IsActive and Rebuild methods.

Parameters

Shows a system in the system menu.

Does nothing if the menu does not exist.

Parameters

  • name String Name of the system

Defined in