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

Builds the tool's settings panel: the list of modes and the controls of the selected mode.

Methods

Returns the area tool mode selected with the 'mode' convar.
Passes the click to the OnLeftClick handler of the selected area tool mode.
Passes the reload to the OnReload handler of the selected area tool mode.
Passes the click to the OnRightClick handler of the selected area tool mode.

Functions

TOOL.BuildCPanel(panel)

client plugins/areas/plugin/tools/sh_area.lua:115

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

TOOL:get_area_mode()

shared plugins/areas/plugin/tools/sh_area.lua:64

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

TOOL:LeftClick(trace)

shared plugins/areas/plugin/tools/sh_area.lua:18

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

TOOL:Reload(trace)

shared plugins/areas/plugin/tools/sh_area.lua:50

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

TOOL:RightClick(trace)

shared plugins/areas/plugin/tools/sh_area.lua:34

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

Defined in