CCSCustomHudLayout
Schema class CCSCustomHudLayout, derived from CBaseEntity.
Generated from the game's schema. Header: source2mod/schema/entity/classes/CCSCustomHudLayout.h
Inherits CBaseEntity
Fields
| Field | Type |
|---|---|
m_strLayout | CUtlSymbolLarge |
m_bObservable | bool |
m_vecPlayerLayoutStates | CUtlVector<CCSCustomHudLayoutState> |
m_globalLayoutState | CCSCustomHudLayoutState |
m_vecPanelIds | CUtlVector<CUtlString> |
m_vecClassNames | CUtlVector<CUtlString> |
m_vecDialogVariableNames | CUtlVector<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.
| Parameter | Type | Default |
|---|---|---|
pszLayout | const char* | |
pszTargetName | const char* | nullptr |
GetLayoutState
CCSCustomHudLayoutState& GetLayoutState(CCSPlayerController* pController = nullptr);Gets the layout state of one player, or the global state when no controller is given.
| Parameter | Type | Default |
|---|---|---|
pController | CCSPlayerController* | 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.
| Parameter | Type | Default |
|---|---|---|
pszPanelId | const char* | |
pszClassName | const char* | |
bHasClass | bool | |
pController | CCSPlayerController* | 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.
| Parameter | Type | Default |
|---|---|---|
pszPanelId | const char* | |
pszVariableName | const char* | |
pszValue | const char* | |
pController | CCSPlayerController* | nullptr |
SetInputCaptureEnabled
void SetInputCaptureEnabled(bool bEnable, CCSPlayerController* pController = nullptr);Enables or disables mouse input capture, without which the player cannot click the layout.
| Parameter | Type | Default |
|---|---|---|
bEnable | bool | |
pController | CCSPlayerController* | nullptr |
IsInputCaptureEnabled
bool IsInputCaptureEnabled(CCSPlayerController* pController = nullptr);Whether mouse input capture is enabled.
| Parameter | Type | Default |
|---|---|---|
pController | CCSPlayerController* | 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.
| Parameter | Type |
|---|---|
callback | std::function<void(CCSPlayerController*, CCSCustomHudLayout*, const char*)> |
UnhookClicks
void UnhookClicks();Drops every click callback registered for this layout.