Skip to content

Commit 95151e2

Browse files
Vladislav4KZa1batross
authored andcommitted
hud: introduce the cl_show_scoreboard_on_death cvar to toggle scoreboard display upon player death
1 parent 0224395 commit 95151e2

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

cl_dll/hud.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ class CHudScoreboard: public CHudBase
388388
bool m_bDrawStroke;
389389
cvar_t *cl_showpacketloss;
390390
cvar_t *cl_showplayerversion;
391+
cvar_t *cl_show_scoreboard_on_death;
391392
};
392393

393394
//

cl_dll/hud/scoreboard.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ int CHudScoreboard :: Init( void )
107107

108108
cl_showpacketloss = CVAR_CREATE( "cl_showpacketloss", "0", FCVAR_ARCHIVE );
109109
cl_showplayerversion = CVAR_CREATE( "cl_showplayerversion", "0", 0 );
110+
cl_show_scoreboard_on_death = CVAR_CREATE( "cl_show_scoreboard_on_death", "0", FCVAR_ARCHIVE );
110111

111112
return 1;
112113
}
@@ -149,7 +150,10 @@ bool CHudScoreboard :: ShouldDrawScoreboard() const
149150
if( m_bForceDraw )
150151
return true;
151152

152-
if( m_bShowscoresHeld || gHUD.m_Health.m_iHealth <= 0 || gHUD.m_iIntermission )
153+
if( m_bShowscoresHeld || gHUD.m_iIntermission )
154+
return true;
155+
156+
if( cl_show_scoreboard_on_death && cl_show_scoreboard_on_death->value && gHUD.m_Health.m_iHealth <= 0 )
153157
return true;
154158

155159
return false;

cl_dll/input.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ int CL_ButtonBits( int bResetState )
845845
bits |= IN_SCORE;
846846
}
847847

848-
// Dead or in intermission? Shore scoreboard, too
848+
// Intermission? Show scoreboard too
849849
if( gHUD.m_Scoreboard.ShouldDrawScoreboard( ))
850850
{
851851
bits |= IN_SCORE;

0 commit comments

Comments
 (0)