about summary refs log tree commit diff
path: root/src/game/client/components
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-04-05 19:00:00 +0200
committeroy <Tom_Adams@web.de>2011-04-05 19:00:00 +0200
commit2401cc2ec3fe19c5cf7910e446df37565258c654 (patch)
tree9501c4acc6f1b2417e440c2d6d29b4e826bd8662 /src/game/client/components
parent3250beb146219dd7685243cc1d1213f8f511818f (diff)
downloadzcatch-2401cc2ec3fe19c5cf7910e446df37565258c654.tar.gz
zcatch-2401cc2ec3fe19c5cf7910e446df37565258c654.zip
highlight the followed player in scoreboard and show their score on top
Diffstat (limited to 'src/game/client/components')
-rw-r--r--src/game/client/components/scoreboard.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp
index 07e076db..47603255 100644
--- a/src/game/client/components/scoreboard.cpp
+++ b/src/game/client/components/scoreboard.cpp
@@ -156,7 +156,13 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
 	}
 	else
 	{
-		if(m_pClient->m_Snap.m_pLocalInfo)
+		if(m_pClient->m_Snap.m_SpecInfo.m_Active && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID != SPEC_FREEVIEW &&
+			m_pClient->m_Snap.m_paPlayerInfos[m_pClient->m_Snap.m_SpecInfo.m_SpectatorID])
+		{
+			int Score = m_pClient->m_Snap.m_paPlayerInfos[m_pClient->m_Snap.m_SpecInfo.m_SpectatorID]->m_Score;
+			str_format(aBuf, sizeof(aBuf), "%d", Score);
+		}
+		else if(m_pClient->m_Snap.m_pLocalInfo)
 		{
 			int Score = m_pClient->m_Snap.m_pLocalInfo->m_Score;
 			str_format(aBuf, sizeof(aBuf), "%d", Score);
@@ -216,8 +222,8 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
 		if(!pInfo || pInfo->m_Team != Team)
 			continue;
 
-		// background so it's easy to find the local player
-		if(pInfo->m_Local)
+		// background so it's easy to find the local player or the followed one in spectator mode
+		if(pInfo->m_Local || (m_pClient->m_Snap.m_SpecInfo.m_Active && pInfo->m_ClientID == m_pClient->m_Snap.m_SpecInfo.m_SpectatorID))
 		{
 			Graphics()->TextureSet(-1);
 			Graphics()->QuadsBegin();