Hooks called by Crosshair

Summary

Hooks

Lets plugins change the color of the crosshair.
Lets plugins change the gap between the center of the crosshair and its bars.
Flux's ShouldHUDPaint hook, asked again here before the crosshair is drawn, so that whatever hides the HUD hides the crosshair as well.

Hooks

AdjustCrosshairColor(trace, distance)

client plugins/cl_crosshair.lua:46

Lets plugins change the color of the crosshair. Called on the client on every frame the crosshair is drawn.

Parameters

  • trace Map Trace result of the local player's aim
  • distance Number Distance from the local player to the hit position of the trace

Returns

  • Color Color to draw the crosshair in; white when nothing is returned

Called from

Call sites

AdjustCrosshairGap(trace, distance)

client plugins/cl_crosshair.lua:54

Lets plugins change the gap between the center of the crosshair and its bars. Called on the client on every frame the crosshair is drawn.

Parameters

  • trace Map Trace result of the local player's aim
  • distance Number Distance from the local player to the hit position of the trace

Returns

  • Number Gap in pixels; when nothing is returned the gap grows with the distance

Called from

Call sites

ShouldHUDPaint()

client plugins/cl_crosshair.lua:37

Flux's ShouldHUDPaint hook, asked again here before the crosshair is drawn, so that whatever hides the HUD hides the crosshair as well. Called on the client on every HUD paint. The same condition then runs ShouldHUDPaintCrosshair, which takes no arguments either and hides only the crosshair when a handler returns false.

Returns

  • Boolean Return false to hide the HUD and the crosshair with it

Called from

Call sites

ShouldHUDPaintCrosshair()

client plugins/cl_crosshair.lua:37

No documentation available.

Called from

Call sites

Defined in