DDraceNetwork Docs
CHud Class Reference

#include <hud.h>

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

Public Member Functions

 CHud ()
 
virtual int Sizeof () const override
 
void ResetHudContainers ()
 
virtual void OnWindowResize () override
 
virtual void OnReset () override
 
virtual void OnRender () override
 
virtual void OnInit () override
 
virtual void OnNewSnapshot () override
 
virtual void OnMessage (int MsgType, void *pRawMsg) override
 
void RenderNinjaBarPos (float x, const float y, const float Width, const float Height, float Progress, float Alpha=1.0f)
 
- Public Member Functions inherited from CComponent
virtual ~CComponent ()
 
virtual int Sizeof () const =0
 
class CGameClientGameClient () const
 
class IClientClient () const
 
virtual void OnStateChange (int NewState, int OldState)
 
virtual void OnConsoleInit ()
 
virtual void OnInit ()
 
virtual void OnShutdown ()
 
virtual void OnReset ()
 
virtual void OnWindowResize ()
 
virtual void OnRefreshSkins ()
 
virtual void OnRender ()
 
virtual void OnNewSnapshot ()
 
virtual void OnRelease ()
 
virtual void OnMapLoad ()
 
virtual void OnMessage (int Msg, void *pRawMsg)
 
virtual bool OnCursorMove (float x, float y, IInput::ECursorType CursorType)
 
virtual bool OnInput (const IInput::CEvent &Event)
 

Private Types

enum class  ESpeedChange { NONE , INCREASE , DECREASE }
 

Private Member Functions

void RenderCursor ()
 
void RenderTextInfo ()
 
void RenderConnectionWarning ()
 
void RenderTeambalanceWarning ()
 
void RenderVoting ()
 
void PrepareAmmoHealthAndArmorQuads ()
 
void RenderAmmoHealthAndArmor (const CNetObj_Character *pCharacter)
 
void PreparePlayerStateQuads ()
 
void RenderPlayerState (const int ClientId)
 
void RenderDummyActions ()
 
void RenderMovementInformation (const int ClientId)
 
void UpdateMovementInformationTextContainer (STextContainerIndex &TextContainer, float FontSize, float Value, char *pPrevValue, size_t Size)
 
void RenderMovementInformationTextContainer (STextContainerIndex &TextContainer, const ColorRGBA &Color, float X, float Y)
 
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
 
float m_FrameTimeAvg
 
int m_HudQuadContainerIndex
 
SScoreInfo m_aScoreInfo [2]
 
STextContainerIndex m_FPSTextContainerIndex
 
STextContainerIndex m_DDRaceEffectsTextContainerIndex
 
STextContainerIndex m_PlayerAngleTextContainerIndex
 
char m_aPlayerAngleText [128]
 
STextContainerIndex m_aPlayerSpeedTextContainers [2]
 
char m_aaPlayerSpeedText [2][128]
 
int m_aPlayerSpeed [2]
 
ESpeedChange m_aLastPlayerSpeedChange [2]
 
STextContainerIndex m_aPlayerPositionContainers [2]
 
char m_aaPlayerPositionText [2][128]
 
int m_LastLocalClientId = -1
 
float m_TimeCpDiff
 
float m_ServerRecord
 
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 CComponent
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 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
 
- Protected Attributes inherited from CComponent
CGameClientm_pClient
 

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

◆ 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 ( const int  ClientId)
private

◆ RenderMovementInformationTextContainer()

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

◆ RenderNinjaBarPos()

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

◆ RenderPauseNotification()

void CHud::RenderPauseNotification ( )
private

◆ RenderPlayerState()

void CHud::RenderPlayerState ( const int  ClientId)
private

◆ RenderRecord()

void CHud::RenderRecord ( )
private

◆ RenderScoreHud()

void CHud::RenderScoreHud ( )
private

◆ RenderSpectatorHud()

void CHud::RenderSpectatorHud ( )
private

◆ RenderSuddenDeath()

void CHud::RenderSuddenDeath ( )
private

◆ RenderTeambalanceWarning()

void CHud::RenderTeambalanceWarning ( )
private

◆ RenderTextInfo()

void CHud::RenderTextInfo ( )
private

◆ RenderVoting()

void CHud::RenderVoting ( )
private

◆ RenderWarmupTimer()

void CHud::RenderWarmupTimer ( )
private

◆ ResetHudContainers()

void CHud::ResetHudContainers ( )

◆ Sizeof()

virtual 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,
char *  pPrevValue,
size_t  Size 
)
private

Member Data Documentation

◆ m_aAmmoOffset

int CHud::m_aAmmoOffset[NUM_WEAPONS]
private

◆ m_aaPlayerPositionText

char CHud::m_aaPlayerPositionText[2][128]
private

◆ m_aaPlayerSpeedText

char CHud::m_aaPlayerSpeedText[2][128]
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_aPlayerAngleText

char CHud::m_aPlayerAngleText[128]
private

◆ m_aPlayerPositionContainers

STextContainerIndex CHud::m_aPlayerPositionContainers[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_FrameTimeAvg

float CHud::m_FrameTimeAvg
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_LiveFrozenOffset

int CHud::m_LiveFrozenOffset
private

◆ m_LockModeOffset

int CHud::m_LockModeOffset
private

◆ m_PlayerAngleTextContainerIndex

STextContainerIndex CHud::m_PlayerAngleTextContainerIndex
private

◆ m_PracticeModeOffset

int CHud::m_PracticeModeOffset
private

◆ m_ServerRecord

float CHud::m_ServerRecord
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

constexpr float CHud::MOVEMENT_INFORMATION_LINE_HEIGHT = 8.0f
staticconstexprprivate

The documentation for this class was generated from the following files: