Defines the cw.selector library, numbered on-screen option lists that players pick from with the number keys.

A selector is built with cw.selector:New, AddText and AddOption. Created on the server, it is sent to its players over the Selector message and the callback receives their choice; created on the client, it is shown to the local player.

Summary

Methods

New()shared
Creates a new selector, a numbered list of options the player picks with number keys.

Methods

Creates a new selector, a numbered list of options the player picks with number keys.

Build it with CLASS_TABLE:AddText and CLASS_TABLE:AddOption, then call CLASS_TABLE:Create. On the server the selector is sent to its players, who answer through the callback.

local selector = cw.selector:New()
  selector:AddText('Choose a ration:')
  selector:AddOption('Standard')
  selector:AddOption('Loyalist', cw.selector.COLOR_GREEN)
  selector:SetPlayer(player)
  selector:SetCallback(function(player, page, key, text)
  end)
selector:Create()

Returns

  • Map The new selector object

Defined in