Skip to content

Hooks

Module-specific events raised by the HudExtras module.


HUDExtrasPreDrawFPS

Purpose

Called before the FPS counter is drawn.

Parameters

None

Realm

Client

Returns

nilNothing.

Example

hook.Add("HUDExtrasPreDrawFPS", "ChangeColor", function()
    surface.SetTextColor(255, 0, 0)
end)

HUDExtrasPostDrawFPS

Purpose

Runs after the FPS counter has been drawn.

Parameters

None

Realm

Client

Returns

nilNothing.

Example

hook.Add("HUDExtrasPostDrawFPS", "ResetColor", function()
    surface.SetTextColor(255, 255, 255)
end)

HUDExtrasPreDrawVignette

Purpose

Called before the vignette overlay is drawn.

Parameters

None

Realm

Client

Returns

nilNothing.

Example

hook.Add("HUDExtrasPreDrawVignette", "MyVignetteSettings", function()
    -- change draw color here
end)

HUDExtrasPostDrawVignette

Purpose

Runs after the vignette overlay has been drawn.

Parameters

None

Realm

Client

Returns

nilNothing.

Example

hook.Add("HUDExtrasPostDrawVignette", "Cleanup", function()
    surface.SetDrawColor(255, 255, 255, 255)
end)

HUDExtrasPreDrawBlur

Purpose

Called before screen blur is drawn.

Parameters

None

Realm

Client

Returns

nilNothing.

Example

hook.Add("HUDExtrasPreDrawBlur", "PrepareBlur", function()
    -- adjust materials or states
end)

HUDExtrasPostDrawBlur

Purpose

Runs after screen blur drawing finishes.

Parameters

  • amount (number): Current blur strength.

Realm

Client

Returns

nilNothing.

Example

hook.Add("HUDExtrasPostDrawBlur", "ShowAmount", function(amount)
    print("Blur amount:", amount)
end)

AdjustBlurAmount

Purpose

Allows modification of the blur value before drawing.

Parameters

  • current (number): Blur value about to be applied.

Realm

Client

Returns

numberAmount to add to the blur.

Example

hook.Add("AdjustBlurAmount", "DoubleBlur", function(current)
    return current * 0.5
end)

ShouldDrawBlur

Purpose

Determines if screen blur should be displayed.

Parameters

None

Realm

Client

Returns

boolean|nilReturn false to skip drawing.

Example

hook.Add("ShouldDrawBlur", "DisableBlur", function()
    return false
end)

ShouldDrawWatermark

Purpose

Controls whether the watermark should be shown.

Parameters

None

Realm

Client

Returns

boolean|nilReturn false to hide the watermark.

Example

hook.Add("ShouldDrawWatermark", "HideWatermark", function()
    return LocalPlayer():IsAdmin()
end)

HUDExtrasPreDrawWatermark

Purpose

Called right before the watermark is drawn.

Parameters

None

Realm

Client

Returns

nilNothing.

Example

hook.Add("HUDExtrasPreDrawWatermark", "ChangeWatermarkColor", function()
    surface.SetDrawColor(0, 255, 0)
end)

HUDExtrasPostDrawWatermark

Purpose

Runs after the watermark has been drawn.

Parameters

None

Realm

Client

Returns

nilNothing.

Example

hook.Add("HUDExtrasPostDrawWatermark", "ResetWatermarkColor", function()
    surface.SetDrawColor(255, 255, 255)
end)