Skip to content

Commit

Permalink
novgui scoreboard: fixed DeathMsg
Browse files Browse the repository at this point in the history
  • Loading branch information
Elinsrc committed Nov 28, 2024
1 parent fc00a92 commit 3434900
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cl_dll/ui/hud/MOTD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int CHudMOTD::Draw( float fTime )

// find where to start drawing the line
if( ( ypos > ROW_RANGE_MIN ) && ( ypos + LINE_HEIGHT <= ypos_r + height ) )
gHUD.DrawHudString( xpos, ypos, ch, 255, 180, 0 );
gHUD.DrawHudStringWithColorTags( xpos, ypos, ch, 255, 180, 0 );

ypos += LINE_HEIGHT;

Expand Down
4 changes: 3 additions & 1 deletion cl_dll/ui/hud/death.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,11 @@ int CHudDeathNotice::MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbu
strncat( killedwith, READ_STRING(), sizeof(killedwith) - strlen(killedwith) - 1 );
killedwith[sizeof(killedwith) - 1] = '\0';

#if USE_VGUI
#if USE_VGUI && !USE_NOVGUI_SCOREBOARD
if (gViewPort)
gViewPort->DeathMsg( killer, victim );
#else
gHUD.m_Scoreboard.DeathMsg( killer, victim );
#endif

gHUD.m_Spectator.DeathMessage( victim );
Expand Down
9 changes: 8 additions & 1 deletion cl_dll/ui/hud/hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,15 @@ int __MsgFunc_Spectator( const char *pszName, int iSize, void *pbuf )
#if USE_VGUI
if (gViewPort)
return gViewPort->MsgFunc_Spectator( pszName, iSize, pbuf );
#else
BEGIN_READ( pbuf, iSize );
short cl = READ_BYTE();
if( cl > 0 && cl <= MAX_PLAYERS )
{
g_IsSpectator[cl] = READ_BYTE();
}
return 1;
#endif
return 0;
}

#if USE_VGUI
Expand Down
10 changes: 5 additions & 5 deletions cl_dll/ui/hud/scoreboard.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1999, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
Expand Down Expand Up @@ -131,7 +131,7 @@ int CHudScoreboard::Draw( float fTime )

if( !m_iShowscoresHeld && gHUD.m_Health.m_iHealth > 0 && !gHUD.m_iIntermission )
return 1;

gHUD.m_iNoConsolePrint |= 1 << 0;

GetAllPlayersInfo();
Expand Down Expand Up @@ -588,7 +588,7 @@ int CHudScoreboard::MsgFunc_TeamInfo( const char *pszName, int iSize, void *pbuf
// accepts three values:
// string: team name
// short: teams kills
// short: teams deaths
// short: teams deaths
// if this message is never received, then scores will simply be the combined totals of the players.
int CHudScoreboard::MsgFunc_TeamScore( const char *pszName, int iSize, void *pbuf )
{
Expand Down

0 comments on commit 3434900

Please sign in to comment.