DDraceNetwork Documentation
Loading...
Searching...
No Matches
CHud Class Reference

#include <hud.h>

Inheritance diagram for CHud:
[legend]
Collaboration diagram for CHud:
[legend]

Classes

class  CMovementInformation

Public Member Functions

 CHud ()
int Sizeof () const override
void ResetHudContainers ()
void OnWindowResize () override
void OnReset () override
void OnRender () override
void OnInit () override
void OnNewSnapshot () override
void OnMessage (int MsgType, void *pRawMsg) override
void RenderNinjaBarPos (float x, float y, float Width, float Height, float Progress, float Alpha=1.0f)
Public Member Functions inherited from CComponent
virtual void OnStateChange (int NewState, int OldState)
virtual void OnConsoleInit ()
virtual void OnShutdown ()
virtual void OnUpdate ()
virtual void OnRelease ()
virtual void OnMapLoad ()
virtual bool OnCursorMove (float x, float y, IInput::ECursorType CursorType)
virtual bool OnInput (const IInput::CEvent &Event)
virtual bool OnTouchState (const std::vector< IInput::CTouchFingerState > &vTouchFingerStates)
Public Member Functions inherited from CComponentInterfaces
virtual void OnInterfacesInit (CGameClient *pClient)
virtual ~CComponentInterfaces ()=default

Private Types

enum class  ESpeedChange { NONE , INCREASE , DECREASE }

Private Member Functions

void RenderCursor ()
void RenderTextInfo ()
void RenderConnectionWarning ()
void RenderTeambalanceWarning ()
void PrepareAmmoHealthAndArmorQuads ()
void RenderAmmoHealthAndArmor (const CNetObj_Character *pCharacter)
void PreparePlayerStateQuads ()
void RenderPlayerState (int ClientId)
void RenderSpectatorCount ()
void RenderDummyActions ()
void RenderMovementInformation ()
void UpdateMovementInformationTextContainer (STextContainerIndex &TextContainer, float FontSize, float Value, float &PrevValue)
void RenderMovementInformationTextContainer (STextContainerIndex &TextContainer, const ColorRGBA &Color, float X, float Y)
class CMovementInformation GetMovementInformation (int ClientId, int Conn) const
void RenderGameTimer ()
void RenderPauseNotification ()
void RenderSuddenDeath ()
void RenderScoreHud ()
void RenderSpectatorHud ()
void RenderWarmupTimer ()
void RenderLocalTime (float x)
void RenderRecord ()
void RenderDDRaceEffects ()
float GetMovementInformationBoxHeight ()
int GetDigitsIndex (int Value, int Max)

Private Attributes

float m_Width
float m_Height
int m_HudQuadContainerIndex
SScoreInfo m_aScoreInfo [2]
STextContainerIndex m_FPSTextContainerIndex
STextContainerIndex m_DDRaceEffectsTextContainerIndex
STextContainerIndex m_PlayerAngleTextContainerIndex
float m_PlayerPrevAngle
STextContainerIndex m_aPlayerSpeedTextContainers [2]
float m_aPlayerPrevSpeed [2]
int m_aPlayerSpeed [2]
ESpeedChange m_aLastPlayerSpeedChange [2]
STextContainerIndex m_aPlayerPositionContainers [2]
float m_aPlayerPrevPosition [2]
int m_LastSpectatorCountTick
int m_LastLocalClientId = -1
float m_TimeCpDiff
float m_aPlayerRecord [NUM_DUMMIES]
float m_FinishTimeDiff
int m_DDRaceTime
int m_FinishTimeLastReceivedTick
int m_TimeCpLastReceivedTick
bool m_ShowFinishTime
int m_aAmmoOffset [NUM_WEAPONS]
int m_HealthOffset
int m_EmptyHealthOffset
int m_ArmorOffset
int m_EmptyArmorOffset
int m_aCursorOffset [NUM_WEAPONS]
int m_FlagOffset
int m_AirjumpOffset
int m_AirjumpEmptyOffset
int m_aWeaponOffset [NUM_WEAPONS]
int m_EndlessJumpOffset
int m_EndlessHookOffset
int m_JetpackOffset
int m_TeleportGrenadeOffset
int m_TeleportGunOffset
int m_TeleportLaserOffset
int m_SoloOffset
int m_CollisionDisabledOffset
int m_HookHitDisabledOffset
int m_HammerHitDisabledOffset
int m_GunHitDisabledOffset
int m_ShotgunHitDisabledOffset
int m_GrenadeHitDisabledOffset
int m_LaserHitDisabledOffset
int m_DeepFrozenOffset
int m_LiveFrozenOffset
int m_DummyHammerOffset
int m_DummyCopyOffset
int m_PracticeModeOffset
int m_Team0ModeOffset
int m_LockModeOffset

Static Private Attributes

static constexpr float MOVEMENT_INFORMATION_LINE_HEIGHT = 8.0f

Additional Inherited Members

Protected Member Functions inherited from CComponentInterfaces
class CGameClientGameClient () const
class IClientClient () const
class IKernelKernel () const
class IEngineEngine () const
class IGraphicsGraphics () const
class ITextRenderTextRender () const
class IInputInput () const
class IStorageStorage () const
class CUiUi () const
class ISoundSound () const
class CRenderToolsRenderTools () const
class CRenderMapRenderMap () const
class IConfigManagerConfigManager () const
class CConfigConfig () const
class IConsoleConsole () const
class IDemoPlayerDemoPlayer () const
class IDemoRecorderDemoRecorder (int Recorder) const
class IFavoritesFavorites () const
class IServerBrowserServerBrowser () const
class CLayersLayers () const
class CCollisionCollision () const
int64_t time () const
float LocalTime () const
class IHttpHttp () const

Member Enumeration Documentation

◆ ESpeedChange

enum class CHud::ESpeedChange
strongprivate
Enumerator
NONE 
INCREASE 
DECREASE 

Constructor & Destructor Documentation

◆ CHud()

CHud::CHud ( )

Member Function Documentation

◆ GetDigitsIndex()

int CHud::GetDigitsIndex ( int Value,
int Max )
inlineprivate

◆ GetMovementInformation()

CHud::CMovementInformation CHud::GetMovementInformation ( int ClientId,
int Conn ) const
private

◆ GetMovementInformationBoxHeight()

float CHud::GetMovementInformationBoxHeight ( )
inlineprivate

◆ OnInit()

void CHud::OnInit ( )
overridevirtual

Called to let the components run initialization code.

Reimplemented from CComponent.

◆ OnMessage()

void CHud::OnMessage ( int Msg,
void * pRawMsg )
overridevirtual

Called when receiving a network message.

Parameters
MsgThe message type.
pRawMsgThe message data.
See also
NETMSGTYPE_SV_DDRACETIME
CNetMsg_Sv_DDRaceTime

Reimplemented from CComponent.

◆ OnNewSnapshot()

void CHud::OnNewSnapshot ( )
overridevirtual

Called when a new snapshot is received.

Reimplemented from CComponent.

◆ OnRender()

void CHud::OnRender ( )
overridevirtual

Called when the component should get rendered.

The render order depends on the component insertion order.

Reimplemented from CComponent.

◆ OnReset()

void CHud::OnReset ( )
overridevirtual

Called to reset the component. This method is usually called on your component constructor to avoid code duplication.

See also
CHud::CHud()
CHud::OnReset()

Reimplemented from CComponent.

◆ OnWindowResize()

void CHud::OnWindowResize ( )
overridevirtual

Called when the window has been resized.

Reimplemented from CComponent.

◆ PrepareAmmoHealthAndArmorQuads()

void CHud::PrepareAmmoHealthAndArmorQuads ( )
private

◆ PreparePlayerStateQuads()

void CHud::PreparePlayerStateQuads ( )
private

◆ RenderAmmoHealthAndArmor()

void CHud::RenderAmmoHealthAndArmor ( const CNetObj_Character * pCharacter)
private

◆ RenderConnectionWarning()

void CHud::RenderConnectionWarning ( )
private

◆ RenderCursor()

void CHud::RenderCursor ( )
private

◆ RenderDDRaceEffects()

void CHud::RenderDDRaceEffects ( )
private

◆ RenderDummyActions()

void CHud::RenderDummyActions ( )
private

◆ RenderGameTimer()

void CHud::RenderGameTimer ( )
private

◆ RenderLocalTime()

void CHud::RenderLocalTime ( float x)
private

◆ RenderMovementInformation()

void CHud::RenderMovementInformation ( )
private

◆ RenderMovementInformationTextContainer()

void CHud::RenderMovementInformationTextContainer ( STextContainerIndex & TextContainer,
const ColorRGBA & Color,
float X,
float Y )
private

◆ RenderNinjaBarPos()

void CHud::RenderNinjaBarPos ( float x,
float y,
float Width,
float Height,
float Progress,
float Alpha = 1.0f )

◆ RenderPauseNotification()

void CHud::RenderPauseNotification ( )
private

◆ RenderPlayerState()

void CHud::RenderPlayerState ( int ClientId)
private

◆ RenderRecord()

void CHud::RenderRecord ( )
private

◆ RenderScoreHud()

void CHud::RenderScoreHud ( )
private

◆ RenderSpectatorCount()

void CHud::RenderSpectatorCount ( )
private

◆ RenderSpectatorHud()

void CHud::RenderSpectatorHud ( )
private

◆ RenderSuddenDeath()

void CHud::RenderSuddenDeath ( )
private

◆ RenderTeambalanceWarning()

void CHud::RenderTeambalanceWarning ( )
private

◆ RenderTextInfo()

void CHud::RenderTextInfo ( )
private

◆ RenderWarmupTimer()

void CHud::RenderWarmupTimer ( )
private

◆ ResetHudContainers()

void CHud::ResetHudContainers ( )

◆ Sizeof()

int CHud::Sizeof ( ) const
inlineoverridevirtual

Gets the size of the non-abstract component.

Implements CComponent.

◆ UpdateMovementInformationTextContainer()

void CHud::UpdateMovementInformationTextContainer ( STextContainerIndex & TextContainer,
float FontSize,
float Value,
float & PrevValue )
private

Member Data Documentation

◆ m_aAmmoOffset

int CHud::m_aAmmoOffset[NUM_WEAPONS]
private

◆ m_aCursorOffset

int CHud::m_aCursorOffset[NUM_WEAPONS]
private

◆ m_AirjumpEmptyOffset

int CHud::m_AirjumpEmptyOffset
private

◆ m_AirjumpOffset

int CHud::m_AirjumpOffset
private

◆ m_aLastPlayerSpeedChange

ESpeedChange CHud::m_aLastPlayerSpeedChange[2]
private

◆ m_aPlayerPositionContainers

STextContainerIndex CHud::m_aPlayerPositionContainers[2]
private

◆ m_aPlayerPrevPosition

float CHud::m_aPlayerPrevPosition[2]
private

◆ m_aPlayerPrevSpeed

float CHud::m_aPlayerPrevSpeed[2]
private

◆ m_aPlayerRecord

float CHud::m_aPlayerRecord[NUM_DUMMIES]
private

◆ m_aPlayerSpeed

int CHud::m_aPlayerSpeed[2]
private

◆ m_aPlayerSpeedTextContainers

STextContainerIndex CHud::m_aPlayerSpeedTextContainers[2]
private

◆ m_ArmorOffset

int CHud::m_ArmorOffset
private

◆ m_aScoreInfo

SScoreInfo CHud::m_aScoreInfo[2]
private

◆ m_aWeaponOffset

int CHud::m_aWeaponOffset[NUM_WEAPONS]
private

◆ m_CollisionDisabledOffset

int CHud::m_CollisionDisabledOffset
private

◆ m_DDRaceEffectsTextContainerIndex

STextContainerIndex CHud::m_DDRaceEffectsTextContainerIndex
private

◆ m_DDRaceTime

int CHud::m_DDRaceTime
private

◆ m_DeepFrozenOffset

int CHud::m_DeepFrozenOffset
private

◆ m_DummyCopyOffset

int CHud::m_DummyCopyOffset
private

◆ m_DummyHammerOffset

int CHud::m_DummyHammerOffset
private

◆ m_EmptyArmorOffset

int CHud::m_EmptyArmorOffset
private

◆ m_EmptyHealthOffset

int CHud::m_EmptyHealthOffset
private

◆ m_EndlessHookOffset

int CHud::m_EndlessHookOffset
private

◆ m_EndlessJumpOffset

int CHud::m_EndlessJumpOffset
private

◆ m_FinishTimeDiff

float CHud::m_FinishTimeDiff
private

◆ m_FinishTimeLastReceivedTick

int CHud::m_FinishTimeLastReceivedTick
private

◆ m_FlagOffset

int CHud::m_FlagOffset
private

◆ m_FPSTextContainerIndex

STextContainerIndex CHud::m_FPSTextContainerIndex
private

◆ m_GrenadeHitDisabledOffset

int CHud::m_GrenadeHitDisabledOffset
private

◆ m_GunHitDisabledOffset

int CHud::m_GunHitDisabledOffset
private

◆ m_HammerHitDisabledOffset

int CHud::m_HammerHitDisabledOffset
private

◆ m_HealthOffset

int CHud::m_HealthOffset
private

◆ m_Height

float CHud::m_Height
private

◆ m_HookHitDisabledOffset

int CHud::m_HookHitDisabledOffset
private

◆ m_HudQuadContainerIndex

int CHud::m_HudQuadContainerIndex
private

◆ m_JetpackOffset

int CHud::m_JetpackOffset
private

◆ m_LaserHitDisabledOffset

int CHud::m_LaserHitDisabledOffset
private

◆ m_LastLocalClientId

int CHud::m_LastLocalClientId = -1
private

◆ m_LastSpectatorCountTick

int CHud::m_LastSpectatorCountTick
private

◆ m_LiveFrozenOffset

int CHud::m_LiveFrozenOffset
private

◆ m_LockModeOffset

int CHud::m_LockModeOffset
private

◆ m_PlayerAngleTextContainerIndex

STextContainerIndex CHud::m_PlayerAngleTextContainerIndex
private

◆ m_PlayerPrevAngle

float CHud::m_PlayerPrevAngle
private

◆ m_PracticeModeOffset

int CHud::m_PracticeModeOffset
private

◆ m_ShotgunHitDisabledOffset

int CHud::m_ShotgunHitDisabledOffset
private

◆ m_ShowFinishTime

bool CHud::m_ShowFinishTime
private

◆ m_SoloOffset

int CHud::m_SoloOffset
private

◆ m_Team0ModeOffset

int CHud::m_Team0ModeOffset
private

◆ m_TeleportGrenadeOffset

int CHud::m_TeleportGrenadeOffset
private

◆ m_TeleportGunOffset

int CHud::m_TeleportGunOffset
private

◆ m_TeleportLaserOffset

int CHud::m_TeleportLaserOffset
private

◆ m_TimeCpDiff

float CHud::m_TimeCpDiff
private

◆ m_TimeCpLastReceivedTick

int CHud::m_TimeCpLastReceivedTick
private

◆ m_Width

float CHud::m_Width
private

◆ MOVEMENT_INFORMATION_LINE_HEIGHT

float CHud::MOVEMENT_INFORMATION_LINE_HEIGHT = 8.0f
staticconstexprprivate

The documentation for this class was generated from the following files:
  • src/game/client/components/hud.h
  • src/game/client/components/hud.cpp