Skip to content

Commit

Permalink
Add a CVAR to draw death notices when hud_draw = 0
Browse files Browse the repository at this point in the history
cl_draw_deathnotices_always
  • Loading branch information
YaLTeR committed Apr 29, 2017
1 parent 2b1b507 commit b7d482e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions cl_dll/hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ void CHud :: Init( void )
default_fov = CVAR_CREATE( "default_fov", "90", 0 );
m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE );
m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE );
m_pCvarDrawDeathNoticesAlways = CVAR_CREATE( "cl_draw_deathnotices_always", "0", FCVAR_ARCHIVE );
m_pCvarColor = CVAR_CREATE( "hud_color", "", FCVAR_ARCHIVE );
cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" );

Expand Down
1 change: 1 addition & 0 deletions cl_dll/hud.h
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ class CHud
int m_iRes;
cvar_t *m_pCvarStealMouse;
cvar_t *m_pCvarDraw;
cvar_t *m_pCvarDrawDeathNoticesAlways;

int m_iFontHeight;

Expand Down
14 changes: 10 additions & 4 deletions cl_dll/hud_redraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,18 @@ int CHud :: Redraw( float flTime, int intermission )
}
else
{
// Hack to draw CHudCrosshairs even when hud_draw is 0.
// Hack to draw some HUDs even when hud_draw is 0.
if (!Bench_Active()
&& !intermission
&& !(m_iHideHUDDisplay & HIDEHUD_ALL)
&& m_Crosshairs.m_iFlags & HUD_ACTIVE)
m_Crosshairs.Draw(flTime);
&& !(m_iHideHUDDisplay & HIDEHUD_ALL))
{
if (m_Crosshairs.m_iFlags & HUD_ACTIVE)
m_Crosshairs.Draw(flTime);

if (gHUD.m_pCvarDrawDeathNoticesAlways->value != 0.0f
&& m_DeathNotice.m_iFlags & HUD_ACTIVE)
m_DeathNotice.Draw(flTime);
}
}

// are we in demo mode? do we need to draw the logo in the top corner?
Expand Down

0 comments on commit b7d482e

Please sign in to comment.