From 1ec8f16c579d0a0b0f8a667f9f6ff7dd282fb01c Mon Sep 17 00:00:00 2001 From: Jordy Ruiz Date: Mon, 23 Dec 2019 12:28:37 +0100 Subject: Don't render statboard if menus is active --- src/game/client/components/stats.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/game/client/components/stats.cpp b/src/game/client/components/stats.cpp index e525b0377..09a5ae3a7 100644 --- a/src/game/client/components/stats.cpp +++ b/src/game/client/components/stats.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -112,6 +113,10 @@ void CStats::OnRender() } } + // don't render scoreboard if menu is open + if(m_pClient->m_pMenus->IsActive()) + return; + if(!IsActive()) return; -- cgit v1.2.3 From ded5a0e6ba27385aca13372513627a6a08c2a652 Mon Sep 17 00:00:00 2001 From: Jordy Ruiz Date: Mon, 23 Dec 2019 12:29:12 +0100 Subject: Extra margin for large K:D and prevent weapons stats overflowing in non-team modes --- src/game/client/components/stats.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/game/client/components/stats.cpp b/src/game/client/components/stats.cpp index 09a5ae3a7..2971dfe6e 100644 --- a/src/game/client/components/stats.cpp +++ b/src/game/client/components/stats.cpp @@ -144,7 +144,7 @@ void CStats::OnRender() { if((1<m_GameInfo.m_GameFlags&GAMEFLAG_FLAGS)) @@ -164,6 +164,7 @@ void CStats::OnRender() w += 100; bool aDisplayWeapon[NUM_WEAPONS] = {false}; + bool NoDisplayedWeapon = true; if(g_Config.m_ClStatboardInfos & TC_STATS_WEAPS) { for(i=0; im_Snap.m_pGameData && m_pClient->m_GameInfo.m_GameFlags&GAMEFLAG_FLAGS)) continue; tw = TextRender()->TextWidth(0, 20.0f, pText, -1, -1.0f); @@ -240,7 +245,8 @@ void CStats::OnRender() px += 80; } Graphics()->QuadsEnd(); - // px += 10; + if(!NoDisplayedWeapon) + px += 10; } if(m_pClient->m_Snap.m_pGameData && m_pClient->m_GameInfo.m_GameFlags&GAMEFLAG_FLAGS && g_Config.m_ClStatboardInfos&TC_STATS_FLAGCAPTURES) @@ -311,7 +317,7 @@ void CStats::OnRender() { if(g_Config.m_ClStatboardInfos & TC_STATS_DEATHS) { - px += 20; + px += 60; str_format(aBuf, sizeof(aBuf), "%d:%d", pStats->m_Frags, pStats->m_Deaths); } else @@ -363,7 +369,7 @@ void CStats::OnRender() { if(g_Config.m_ClStatboardInfos & TC_STATS_BESTSPREE) { - px += 20; // extra space + px += 40; // extra space str_format(aBuf, sizeof(aBuf), "%d (%d)", pStats->m_CurrentSpree, pStats->m_BestSpree); } else @@ -431,7 +437,8 @@ void CStats::OnRender() } } px = EndX + Offset; - // px += 10; + if(!NoDisplayedWeapon) + px += 10; } if(m_pClient->m_Snap.m_pGameData && m_pClient->m_GameInfo.m_GameFlags&GAMEFLAG_FLAGS && g_Config.m_ClStatboardInfos&TC_STATS_FLAGCAPTURES) -- cgit v1.2.3