From 2401cc2ec3fe19c5cf7910e446df37565258c654 Mon Sep 17 00:00:00 2001 From: oy Date: Tue, 5 Apr 2011 19:00:00 +0200 Subject: highlight the followed player in scoreboard and show their score on top --- src/game/client/components/scoreboard.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/game/client/components/scoreboard.cpp') 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(); -- cgit 1.4.1