From ae364942c80e0b67e096b2a4ceaab3d34e849fbe Mon Sep 17 00:00:00 2001 From: gerdoe-jr Date: Wed, 10 Jul 2024 21:50:45 +0300 Subject: [PATCH] Add spectator clans rendering in scoreboard Show client ID before spectator clan --- src/game/client/components/scoreboard.cpp | 32 +++++++++++++++++++---- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp index de08db6a8..0b7dbe42d 100644 --- a/src/game/client/components/scoreboard.cpp +++ b/src/game/client/components/scoreboard.cpp @@ -199,17 +199,39 @@ void CScoreboard::RenderSpectators(CUIRect Spectators) break; } - if(GameClient()->m_aClients[pInfo->m_ClientId].m_AuthLevel) - { - TextRender()->TextColor(color_cast(ColorHSLA(g_Config.m_ClAuthedPlayerColor))); - } - if(g_Config.m_ClShowIds) { char aClientId[5]; str_format(aClientId, sizeof(aClientId), "%d: ", pInfo->m_ClientId); TextRender()->TextEx(&Cursor, aClientId); } + + { + const char *pClanName = GameClient()->m_aClients[pInfo->m_ClientId].m_aClan; + + if(pClanName[0] != '\0') + { + if(str_comp(pClanName, GameClient()->m_aClients[GameClient()->m_aLocalIds[g_Config.m_ClDummy]].m_aClan) == 0) + { + TextRender()->TextColor(color_cast(ColorHSLA(g_Config.m_ClSameClanColor))); + } + else + { + TextRender()->TextColor(ColorRGBA(0.7f, 0.7f, 0.7f)); + } + + TextRender()->TextEx(&Cursor, pClanName); + TextRender()->TextEx(&Cursor, " "); + + TextRender()->TextColor(TextRender()->DefaultTextColor()); + } + } + + if(GameClient()->m_aClients[pInfo->m_ClientId].m_AuthLevel) + { + TextRender()->TextColor(color_cast(ColorHSLA(g_Config.m_ClAuthedPlayerColor))); + } + TextRender()->TextEx(&Cursor, GameClient()->m_aClients[pInfo->m_ClientId].m_aName); TextRender()->TextColor(TextRender()->DefaultTextColor());