The Area Tool creates and removes areas. Left click, right click and reload are passed on
to the selected tool mode; modes are added by plugins through the AddAreaToolModes
hook and picked from the list in the tool's settings panel. The tool requires the
areas permission, which each of its actions checks as well.
Summary
Functions
BuildCPanel(panel)client
Builds the tool's settings panel: the list of modes and the controls of the selected mode.
Methods
get_area_mode()shared
Returns the area tool mode selected with the 'mode' convar.
LeftClick(trace)shared
Passes the click to the OnLeftClick handler of the selected area tool mode.
Reload(trace)shared
Passes the reload to the OnReload handler of the selected area tool mode.
RightClick(trace)shared
Passes the click to the OnRightClick handler of the selected area tool mode.
Functions
Builds the tool's settings panel: the list of modes and the controls of the selected mode.
Parameters
- panel Panel the tool's control panel
Methods
Returns the area tool mode selected with the 'mode' convar.
Returns
- Map the mode table, or nil if there is no mode with that index
Passes the click to the OnLeftClick handler of the selected area tool mode.
Parameters
- trace Map trace result of the tool owner's aim
Returns
- Boolean the result of the mode's handler, true if the mode has no handler, nil if the owner lacks the 'areas' permission
Passes the reload to the OnReload handler of the selected area tool mode.
Parameters
- trace Map trace result of the tool owner's aim
Returns
- Boolean the result of the mode's handler, true if the mode has no handler, nil if the owner lacks the 'areas' permission
Passes the click to the OnRightClick handler of the selected area tool mode.
Parameters
- trace Map trace result of the tool owner's aim
Returns
- Boolean the result of the mode's handler, true if the mode has no handler, nil if the owner lacks the 'areas' permission