Skip to content

Commit

Permalink
Added Cvar: hud_rainbow_deathnotice
Browse files Browse the repository at this point in the history
  • Loading branch information
Elinsrc committed Feb 29, 2024
1 parent 55303dd commit 0e7c022
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ hud_rainbow_val [value], default value is 100.
hud_rainbow_speed [value], default value is 40.
hud_rainbow_xphase [value], default value is 0.4.
hud_rainbow_yphase [value], default value is 0.7.
hud_rainbow_chat [0/1], default value is 0
hud_rainbow_chat [0/1], default value is 0.
hud_rainbow_deathnotice [0/1], default value is 0.
cl_gauss_balls [0/1] - Small bouncing balls from Gauss hits, defaut value is 1.
cl_gauss_hits [0/1] - A large glowing sprite from a Gauss hits, defaut value is 1.
Expand Down
10 changes: 10 additions & 0 deletions cl_dll/death.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "vgui_TeamFortressViewport.h"
#endif

cvar_t *m_HUD_rainbow_death;

DECLARE_MESSAGE( m_DeathNotice, DeathMsg )

struct DeathNoticeItem {
Expand Down Expand Up @@ -83,6 +85,7 @@ int CHudDeathNotice::Init( void )
// OpenAG
m_pCvarKillSnd = CVAR_CREATE( "cl_killsound", "1", FCVAR_ARCHIVE );
m_pCvarKillSndPath = CVAR_CREATE( "cl_killsound_path", "buttons/bell1.wav", FCVAR_ARCHIVE );
m_HUD_rainbow_death = gEngfuncs.pfnRegisterVariable( "hud_rainbow_deathnotice", "0", FCVAR_ARCHIVE );

return 1;
}
Expand All @@ -101,6 +104,10 @@ int CHudDeathNotice::VidInit( void )

int CHudDeathNotice::Draw( float flTime )
{
bool enableRainbow = m_HUD_rainbow_death->value;
if (!enableRainbow)
gHUD.m_Rainbow.PushDisable();

int x, y, r, g, b;

for( int i = 0; i < MAX_DEATHNOTICES; i++ )
Expand Down Expand Up @@ -163,6 +170,9 @@ int CHudDeathNotice::Draw( float flTime )
}
}

if (!enableRainbow)
gHUD.m_Rainbow.PopDisable();

return 1;
}

Expand Down

0 comments on commit 0e7c022

Please sign in to comment.