Measure tool for the tool gun. Left click and right click set two points, reload clears them, and the distance between the points is drawn on the HUD in the measurement system chosen in the tool's settings (imperial, metric or game units).

Summary

Functions

Builds the settings panel of the tool, with a drop-down for the measurement system.

Methods

DrawHUD()shared
Draws a line between the two measurement points and the distance between them in the selected measurement system.
Sets the first measurement point to the position the player is aiming at.
Clears both measurement points.
Sets the second measurement point to the position the player is aiming at.

Functions

TOOL.BuildCPanel(CPanel)

shared packages/flow/tools/sh_measure.lua:71

Builds the settings panel of the tool, with a drop-down for the measurement system.

Parameters

  • CPanel Panel the control panel of the tool

Methods

Draws a line between the two measurement points and the distance between them in the selected measurement system.

TOOL:LeftClick(trace)

shared packages/flow/tools/sh_measure.lua:13

Sets the first measurement point to the position the player is aiming at.

Parameters

  • trace Map trace result of the player's aim

Returns

  • Boolean always true

TOOL:Reload(_trace)

shared packages/flow/tools/sh_measure.lua:35

Clears both measurement points.

Parameters

  • _trace Map trace result of the player's aim; unused

Returns

  • Boolean always true

TOOL:RightClick(trace)

shared packages/flow/tools/sh_measure.lua:24

Sets the second measurement point to the position the player is aiming at.

Parameters

  • trace Map trace result of the player's aim

Returns

  • Boolean always true

Defined in