summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroy <tom_adams@web.de>2019-12-23 14:50:47 +0100
committerGitHub <noreply@github.com>2019-12-23 14:50:47 +0100
commit28f9da3d10ea82d6ee1c3ee0bb5e4b2509761a10 (patch)
tree4c801ad9c15519090115450875dfeb5284397d8c
parent5bce4246d86f374f9910cb0ea940e6092daf44f5 (diff)
parentded5a0e6ba27385aca13372513627a6a08c2a652 (diff)
Merge pull request #2343 from Dune-jr/fix-statboard0.7.4
Couple more bugfixes
-rw-r--r--src/game/client/components/stats.cpp30
1 files changed, 21 insertions, 9 deletions
diff --git a/src/game/client/components/stats.cpp b/src/game/client/components/stats.cpp
index e525b0377..2971dfe6e 100644
--- a/src/game/client/components/stats.cpp
+++ b/src/game/client/components/stats.cpp
@@ -3,6 +3,7 @@
#include <engine/graphics.h>
#include <engine/serverbrowser.h>
#include <game/client/animstate.h>
+#include <game/client/components/menus.h>
#include <game/client/components/sounds.h>
#include <game/client/gameclient.h>
#include <generated/client_data.h>
@@ -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;
@@ -139,7 +144,7 @@ void CStats::OnRender()
{
if((1<<i) == (TC_STATS_DEATHS) && g_Config.m_ClStatboardInfos & TC_STATS_FRAGS)
{
- w += 20;
+ w += 60; // some extra for the merge
continue;
}
else if((1<<i) == (TC_STATS_BESTSPREE))
@@ -147,7 +152,7 @@ void CStats::OnRender()
if(!(g_Config.m_ClStatboardInfos & TC_STATS_SPREE))
w += 140; // Best spree is a long column name, add a bit more
else
- w += 20; // The combined colunms are a bit long, add some extra
+ w += 40; // The combined colunms are a bit long, add some extra
continue;
}
else if((1<<i) == (TC_STATS_FLAGGRABS) && !(m_pClient->m_GameInfo.m_GameFlags&GAMEFLAG_FLAGS))
@@ -159,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; i<NumPlayers; i++)
@@ -169,8 +175,12 @@ void CStats::OnRender()
}
for(i=0; i<NUM_WEAPONS; i++)
if(aDisplayWeapon[i])
+ {
w += 80;
- // w += 10;
+ NoDisplayedWeapon = false;
+ }
+ if(!NoDisplayedWeapon)
+ w += 10;
}
float x = Width/2-w/2;
@@ -197,7 +207,7 @@ void CStats::OnRender()
if(1<<i == TC_STATS_FRAGS && g_Config.m_ClStatboardInfos & TC_STATS_DEATHS)
{
pText = "K:D";
- px += 20.0f; // some extra for the merge
+ px += 60.0f; // some extra for the merge
}
else if(1<<i == TC_STATS_DEATHS && g_Config.m_ClStatboardInfos & TC_STATS_FRAGS)
continue;
@@ -209,7 +219,7 @@ void CStats::OnRender()
px += 40.0f; // some extra for the long name
}
else if(1<<i == TC_STATS_SPREE && g_Config.m_ClStatboardInfos & TC_STATS_BESTSPREE)
- px += 20.0f; // some extra for the merge
+ px += 40.0f; // some extra for the merge
if(1<<i == TC_STATS_FLAGGRABS && !(m_pClient->m_Snap.m_pGameData && m_pClient->m_GameInfo.m_GameFlags&GAMEFLAG_FLAGS))
continue;
tw = TextRender()->TextWidth(0, 20.0f, pText, -1, -1.0f);
@@ -235,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)
@@ -306,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
@@ -358,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
@@ -426,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)