cw.system classclient
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
Methods
Returns a registered system.
Parameters
- identifier String Name of the system
Returns
- Map The system, or
nilif there is none
Returns the system the system menu is showing.
Returns
- String Name of the active system, or
nilif 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
nilif 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
- system Map The system object from
cw.system:New
Shows a system in the system menu.
Does nothing if the menu does not exist.
Parameters
- name String Name of the system