From ef6d4b5de639d3a769e6d6a73b732f34f4e1be5f Mon Sep 17 00:00:00 2001 From: Ryozuki Date: Fri, 5 Apr 2019 12:41:01 +0200 Subject: [PATCH 1/2] add clan color to people with same clan as you --- src/game/client/components/scoreboard.cpp | 16 +++++++++++++--- src/game/variables.h | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp index b92847132..d88922042 100644 --- a/src/game/client/components/scoreboard.cpp +++ b/src/game/client/components/scoreboard.cpp @@ -473,14 +473,24 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch Cursor.m_LineWidth = NameLength; TextRender()->TextEx(&Cursor, m_pClient->m_aClients[pInfo->m_ClientID].m_aName, -1); } - TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f); // clan - tw = TextRender()->TextWidth(0, FontSize, m_pClient->m_aClients[pInfo->m_ClientID].m_aClan, -1); - TextRender()->SetCursor(&Cursor, ClanOffset+ClanLength/2-tw/2, y + (LineHeight - FontSize) / 2.f, FontSize, TEXTFLAG_RENDER|TEXTFLAG_STOP_AT_END); + if(str_comp(m_pClient->m_aClients[pInfo->m_ClientID].m_aClan, + m_pClient->m_aClients[GameClient()->m_LocalIDs[0]].m_aClan) == 0) + { + vec4 Color = m_pClient->m_pSkins->GetColorV4(g_Config.m_ClAuthedPlayerColor); + TextRender()->TextColor(Color.r, Color.g, Color.b, Color.a); + } + else + TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f); + + tw = TextRender()->TextWidth(nullptr, FontSize, m_pClient->m_aClients[pInfo->m_ClientID].m_aClan, -1); + TextRender()->SetCursor(&Cursor, ClanOffset + ClanLength / 2 - tw / 2, y + (LineHeight - FontSize) / 2.f, FontSize, TEXTFLAG_RENDER|TEXTFLAG_STOP_AT_END); Cursor.m_LineWidth = ClanLength; TextRender()->TextEx(&Cursor, m_pClient->m_aClients[pInfo->m_ClientID].m_aClan, -1); + TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f); + // country flag vec4 Color(1.0f, 1.0f, 1.0f, 0.5f); m_pClient->m_pCountryFlags->Render(m_pClient->m_aClients[pInfo->m_ClientID].m_Country, &Color, diff --git a/src/game/variables.h b/src/game/variables.h index fff0b607f..1a8d05c31 100644 --- a/src/game/variables.h +++ b/src/game/variables.h @@ -20,6 +20,7 @@ MACRO_CONFIG_INT(ClNameplatesClanSize, cl_nameplates_clan_size, 30, 0, 100, CFGF MACRO_CONFIG_INT(ClNameplatesOwn, cl_nameplates_own, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show own name plate (useful for demo recording)") MACRO_CONFIG_INT(ClTextEntities, cl_text_entities, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Render textual entity data") MACRO_CONFIG_INT(ClAuthedPlayerColor, cl_authed_player_color, 5898183, 0, 0xFFFFFF, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Color of name of authenticated player in scoreboard") +MACRO_CONFIG_INT(ClSameClanColor, cl_same_clan_color, 5898183, 0, 0xFFFFFF, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Clan Color of players with the same clan as you in scoreboard.") #if defined(__ANDROID__) MACRO_CONFIG_INT(ClAutoswitchWeapons, cl_autoswitch_weapons, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Auto switch weapon on pickup") MACRO_CONFIG_INT(ClAutoswitchWeaponsOutOfAmmo, cl_autoswitch_weapons_out_of_ammo, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Auto switch weapon when out of ammo") From 4e3b2191a297553b7e8150839b84f8192e1877fb Mon Sep 17 00:00:00 2001 From: Ryozuki Date: Fri, 5 Apr 2019 13:47:38 +0200 Subject: [PATCH 2/2] fix wrong variable --- src/game/client/components/scoreboard.cpp | 2 +- src/game/variables.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp index d88922042..e474db53e 100644 --- a/src/game/client/components/scoreboard.cpp +++ b/src/game/client/components/scoreboard.cpp @@ -478,7 +478,7 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch if(str_comp(m_pClient->m_aClients[pInfo->m_ClientID].m_aClan, m_pClient->m_aClients[GameClient()->m_LocalIDs[0]].m_aClan) == 0) { - vec4 Color = m_pClient->m_pSkins->GetColorV4(g_Config.m_ClAuthedPlayerColor); + vec4 Color = m_pClient->m_pSkins->GetColorV4(g_Config.m_ClSameClanColor); TextRender()->TextColor(Color.r, Color.g, Color.b, Color.a); } else diff --git a/src/game/variables.h b/src/game/variables.h index 1a8d05c31..446f6ce64 100644 --- a/src/game/variables.h +++ b/src/game/variables.h @@ -20,7 +20,7 @@ MACRO_CONFIG_INT(ClNameplatesClanSize, cl_nameplates_clan_size, 30, 0, 100, CFGF MACRO_CONFIG_INT(ClNameplatesOwn, cl_nameplates_own, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show own name plate (useful for demo recording)") MACRO_CONFIG_INT(ClTextEntities, cl_text_entities, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Render textual entity data") MACRO_CONFIG_INT(ClAuthedPlayerColor, cl_authed_player_color, 5898183, 0, 0xFFFFFF, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Color of name of authenticated player in scoreboard") -MACRO_CONFIG_INT(ClSameClanColor, cl_same_clan_color, 5898183, 0, 0xFFFFFF, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Clan Color of players with the same clan as you in scoreboard.") +MACRO_CONFIG_INT(ClSameClanColor, cl_same_clan_color, 5898183, 0, 0xFFFFFF, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Clan color of players with the same clan as you in scoreboard.") #if defined(__ANDROID__) MACRO_CONFIG_INT(ClAutoswitchWeapons, cl_autoswitch_weapons, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Auto switch weapon on pickup") MACRO_CONFIG_INT(ClAutoswitchWeaponsOutOfAmmo, cl_autoswitch_weapons_out_of_ammo, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Auto switch weapon when out of ammo")