Entity systemClasses

CCSCustomHudLayout

Schema class CCSCustomHudLayout, derived from CBaseEntity.

Generated from the game's schema. Header: source2mod/schema/entity/classes/CCSCustomHudLayout.h

Inherits CBaseEntity

Fields

FieldType
m_strLayoutCUtlSymbolLarge
m_bObservablebool
m_vecPlayerLayoutStatesCUtlVector<CCSCustomHudLayoutState>
m_globalLayoutStateCCSCustomHudLayoutState
m_vecPanelIdsCUtlVector<CUtlString>
m_vecClassNamesCUtlVector<CUtlString>
m_vecDialogVariableNamesCUtlVector<CUtlString>

Schema fields are accessors: read with entity->m_field(), write with entity->m_field = value (the write marks the field for networking).

Methods

Create

static CCSCustomHudLayout* Create(const char* pszLayout, const char* pszTargetName = nullptr);

Creates and spawns a custom_hud_layout for a panorama layout, e.g. "my_panel" for panorama/layout/custom_game/my_panel.vxml_c.

ParameterTypeDefault
pszLayoutconst char*
pszTargetNameconst char*nullptr

GetLayoutState

CCSCustomHudLayoutState& GetLayoutState(CCSPlayerController* pController = nullptr);

Gets the layout state of one player, or the global state when no controller is given.

ParameterTypeDefault
pControllerCCSPlayerController*nullptr

SetHasClass

void SetHasClass(const char* pszPanelId, const char* pszClassName, bool bHasClass, CCSPlayerController* pController = nullptr);

Adds or removes a CSS class on a panel of the layout.

ParameterTypeDefault
pszPanelIdconst char*
pszClassNameconst char*
bHasClassbool
pControllerCCSPlayerController*nullptr

SetDialogVariableString

void SetDialogVariableString(const char* pszPanelId, const char* pszVariableName, const char* pszValue, CCSPlayerController* pController = nullptr);

Sets a dialog variable string on a panel of the layout.

ParameterTypeDefault
pszPanelIdconst char*
pszVariableNameconst char*
pszValueconst char*
pControllerCCSPlayerController*nullptr

SetInputCaptureEnabled

void SetInputCaptureEnabled(bool bEnable, CCSPlayerController* pController = nullptr);

Enables or disables mouse input capture, without which the player cannot click the layout.

ParameterTypeDefault
bEnablebool
pControllerCCSPlayerController*nullptr

IsInputCaptureEnabled

bool IsInputCaptureEnabled(CCSPlayerController* pController = nullptr);

Whether mouse input capture is enabled.

ParameterTypeDefault
pControllerCCSPlayerController*nullptr

HookClick

void HookClick(std::function<void(CCSPlayerController*, CCSCustomHudLayout*, const char*)> callback);

Registers a callback fired when a player clicks a panel of this layout, keyed by the panel's id attribute.

UnhookClicks

void UnhookClicks();

Drops every click callback registered for this layout.

On this page