From 3434900a3b2c76ab18a99f0ae4d38772703217eb Mon Sep 17 00:00:00 2001 From: Elinsrc Date: Thu, 28 Nov 2024 16:21:29 +0500 Subject: [PATCH] novgui scoreboard: fixed DeathMsg --- cl_dll/ui/hud/MOTD.cpp | 2 +- cl_dll/ui/hud/death.cpp | 4 +++- cl_dll/ui/hud/hud.cpp | 9 ++++++++- cl_dll/ui/hud/scoreboard.cpp | 10 +++++----- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/cl_dll/ui/hud/MOTD.cpp b/cl_dll/ui/hud/MOTD.cpp index cb3c1e7..486ede3 100644 --- a/cl_dll/ui/hud/MOTD.cpp +++ b/cl_dll/ui/hud/MOTD.cpp @@ -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; diff --git a/cl_dll/ui/hud/death.cpp b/cl_dll/ui/hud/death.cpp index d81811a..10b623b 100644 --- a/cl_dll/ui/hud/death.cpp +++ b/cl_dll/ui/hud/death.cpp @@ -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 ); diff --git a/cl_dll/ui/hud/hud.cpp b/cl_dll/ui/hud/hud.cpp index fa0c674..95b16f0 100644 --- a/cl_dll/ui/hud/hud.cpp +++ b/cl_dll/ui/hud/hud.cpp @@ -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 diff --git a/cl_dll/ui/hud/scoreboard.cpp b/cl_dll/ui/hud/scoreboard.cpp index 4943ae0..e486250 100644 --- a/cl_dll/ui/hud/scoreboard.cpp +++ b/cl_dll/ui/hud/scoreboard.cpp @@ -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 @@ -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(); @@ -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 ) {