summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroy <tom_adams@web.de>2023-06-12 22:36:03 +0200
committerGitHub <noreply@github.com>2023-06-12 22:36:03 +0200
commit8ab9c7f4ba33d816f40be9fde0a093653fdcdc27 (patch)
tree39325a8f305e5f74ceca11062fad64884836606d
parentaae3024c54b1a048a89e0383f444a0955b82b0a2 (diff)
parent84e07d6a713db672249c20a73d7b6a87dce4bfd1 (diff)
Merge pull request #3133 from Robyt3/Stats-Frags-to-Kills
Change naming of 'Frags' to 'Kills' in statboard
-rw-r--r--src/game/client/components/menus_settings.cpp14
-rw-r--r--src/game/client/components/scoreboard.cpp2
-rw-r--r--src/game/client/components/stats.cpp44
-rw-r--r--src/game/client/components/stats.h8
4 files changed, 34 insertions, 34 deletions
diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp
index e827e045d..a433646db 100644
--- a/src/game/client/components/menus_settings.cpp
+++ b/src/game/client/components/menus_settings.cpp
@@ -1501,8 +1501,8 @@ float CMenus::RenderSettingsControlsStats(CUIRect View)
CUIRect Button;
View.HSplitTop(RowHeight, &Button, &View);
- if(DoButton_CheckBox(s_aCheckboxIds + 0, Localize("Frags"), Config()->m_ClStatboardInfos & TC_STATS_FRAGS, &Button))
- Config()->m_ClStatboardInfos ^= TC_STATS_FRAGS;
+ if(DoButton_CheckBox(s_aCheckboxIds + 0, Localize("Kills"), Config()->m_ClStatboardInfos & TC_STATS_KILLS, &Button))
+ Config()->m_ClStatboardInfos ^= TC_STATS_KILLS;
View.HSplitTop(RowHeight, &Button, &View);
if(DoButton_CheckBox(s_aCheckboxIds + 1, Localize("Deaths"), Config()->m_ClStatboardInfos & TC_STATS_DEATHS, &Button))
@@ -1515,16 +1515,16 @@ float CMenus::RenderSettingsControlsStats(CUIRect View)
View.HSplitTop(RowHeight, &Button, &View);
if(DoButton_CheckBox(s_aCheckboxIds + 3, Localize("Ratio"), Config()->m_ClStatboardInfos & TC_STATS_RATIO, &Button))
Config()->m_ClStatboardInfos ^= TC_STATS_RATIO;
- UI()->DoTooltip(s_aCheckboxIds + 3, &Button, Localize("The ratio of frags to deaths."));
+ UI()->DoTooltip(s_aCheckboxIds + 3, &Button, Localize("The ratio of kills to deaths."));
View.HSplitTop(RowHeight, &Button, &View);
if(DoButton_CheckBox(s_aCheckboxIds + 4, Localize("Net score"), Config()->m_ClStatboardInfos & TC_STATS_NET, &Button))
Config()->m_ClStatboardInfos ^= TC_STATS_NET;
- UI()->DoTooltip(s_aCheckboxIds + 4, &Button, Localize("The number of frags minus the number of deaths."));
+ UI()->DoTooltip(s_aCheckboxIds + 4, &Button, Localize("The number of kills minus the number of deaths."));
View.HSplitTop(RowHeight, &Button, &View);
- if(DoButton_CheckBox(s_aCheckboxIds + 5, Localize("Frags per minute"), Config()->m_ClStatboardInfos & TC_STATS_FPM, &Button))
- Config()->m_ClStatboardInfos ^= TC_STATS_FPM;
+ if(DoButton_CheckBox(s_aCheckboxIds + 5, Localize("Kills per minute"), Config()->m_ClStatboardInfos & TC_STATS_KPM, &Button))
+ Config()->m_ClStatboardInfos ^= TC_STATS_KPM;
View.HSplitTop(RowHeight, &Button, &View);
if(DoButton_CheckBox(s_aCheckboxIds + 6, Localize("Current spree"), Config()->m_ClStatboardInfos & TC_STATS_SPREE, &Button))
@@ -1537,7 +1537,7 @@ float CMenus::RenderSettingsControlsStats(CUIRect View)
View.HSplitTop(RowHeight, &Button, &View);
if(DoButton_CheckBox(s_aCheckboxIds + 8, Localize("Weapons stats"), Config()->m_ClStatboardInfos & TC_STATS_WEAPS, &Button))
Config()->m_ClStatboardInfos ^= TC_STATS_WEAPS;
- UI()->DoTooltip(s_aCheckboxIds + 8, &Button, Localize("The proportion of frags gotten with each weapon."));
+ UI()->DoTooltip(s_aCheckboxIds + 8, &Button, Localize("The proportion of kills gotten with each weapon."));
View.HSplitTop(RowHeight, &Button, &View);
if(DoButton_CheckBox(s_aCheckboxIds + 9, Localize("Flag grabs"), Config()->m_ClStatboardInfos & TC_STATS_FLAGGRABS, &Button))
diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp
index 28229df61..b3b55a8ec 100644
--- a/src/game/client/components/scoreboard.cpp
+++ b/src/game/client/components/scoreboard.cpp
@@ -665,7 +665,7 @@ float CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const c
{
// K
TextRender()->TextColor(TextColor.r, TextColor.g, TextColor.b, 0.5f*ColorAlpha);
- str_format(aBuf, sizeof(aBuf), "%d", clamp(m_pClient->m_pStats->GetPlayerStats(pInfo->m_ClientID)->m_Frags, 0, 999));
+ str_format(aBuf, sizeof(aBuf), "%d", clamp(m_pClient->m_pStats->GetPlayerStats(pInfo->m_ClientID)->m_Kills, 0, 999));
s_Cursor.Reset();
s_Cursor.MoveTo(KillOffset+KillLength/2, y+Spacing);
s_Cursor.m_MaxWidth = KillLength;
diff --git a/src/game/client/components/stats.cpp b/src/game/client/components/stats.cpp
index b53c8f1a8..010aff0d3 100644
--- a/src/game/client/components/stats.cpp
+++ b/src/game/client/components/stats.cpp
@@ -30,14 +30,14 @@ CStats::CStats()
void CStats::CPlayerStats::Reset()
{
m_IngameTicks = 0;
- m_Frags = 0;
+ m_Kills = 0;
m_Deaths = 0;
m_Suicides = 0;
m_BestSpree = 0;
m_CurrentSpree = 0;
for(int j = 0; j < NUM_WEAPONS; j++)
{
- m_aFragsWith[j] = 0;
+ m_aKillsWith[j] = 0;
m_aDeathsFrom[j] = 0;
}
m_FlagGrabs = 0;
@@ -109,13 +109,13 @@ void CStats::OnMessage(int MsgType, void *pRawMsg)
m_aStats[pMsg->m_Victim].m_DeathsCarrying++;
if(pMsg->m_Victim != pMsg->m_Killer)
{
- m_aStats[pMsg->m_Killer].m_Frags++;
+ m_aStats[pMsg->m_Killer].m_Kills++;
m_aStats[pMsg->m_Killer].m_CurrentSpree++;
if(m_aStats[pMsg->m_Killer].m_CurrentSpree > m_aStats[pMsg->m_Killer].m_BestSpree)
m_aStats[pMsg->m_Killer].m_BestSpree = m_aStats[pMsg->m_Killer].m_CurrentSpree;
if(pMsg->m_Weapon >= 0)
- m_aStats[pMsg->m_Killer].m_aFragsWith[pMsg->m_Weapon]++;
+ m_aStats[pMsg->m_Killer].m_aKillsWith[pMsg->m_Weapon]++;
if(pMsg->m_ModeSpecial & 1)
m_aStats[pMsg->m_Killer].m_CarriersKilled++;
if(pMsg->m_ModeSpecial & 2)
@@ -178,7 +178,7 @@ void CStats::OnRender()
for(int i=0; i<9; i++)
if(Config()->m_ClStatboardInfos & (1<<i))
{
- if((1<<i) == (TC_STATS_DEATHS) && Config()->m_ClStatboardInfos & TC_STATS_FRAGS)
+ if((1<<i) == (TC_STATS_DEATHS) && Config()->m_ClStatboardInfos & TC_STATS_KILLS)
{
w += 60; // some extra for the merge
continue;
@@ -207,7 +207,7 @@ void CStats::OnRender()
{
const CPlayerStats *pStats = &m_aStats[aPlayers[i]];
for(int j=0; j<NUM_WEAPONS; j++)
- aDisplayWeapon[j] = aDisplayWeapon[j] || pStats->m_aFragsWith[j] || pStats->m_aDeathsFrom[j];
+ aDisplayWeapon[j] = aDisplayWeapon[j] || pStats->m_aKillsWith[j] || pStats->m_aDeathsFrom[j];
}
for(int i = 0; i < NUM_WEAPONS; i++)
if(aDisplayWeapon[i])
@@ -245,20 +245,20 @@ void CStats::OnRender()
s_Cursor.Reset();
s_Cursor.MoveTo(x + 10, y + HeaderHeight / 2.0f);
TextRender()->TextOutlined(&s_Cursor, Localize("Name"), -1);
- const char *apHeaders[] = { "K", "D", Localize("Suicides"), Localize("Ratio"), Localize("Net", "Net score"), Localize("FPM"), Localize("Spree"), Localize("Best spree"), Localize("Grabs", "Flag grabs") };
+ const char *apHeaders[] = { "K", "D", Localize("Suicides"), Localize("Ratio"), Localize("Net", "Net score"), Localize("KPM"), Localize("Spree"), Localize("Best spree"), Localize("Grabs", "Flag grabs") };
s_Cursor.m_Align = TEXTALIGN_MR;
for(int i = 0; i < 9; i++)
{
if(Config()->m_ClStatboardInfos & (1<<i))
{
const char *pText = apHeaders[i];
- // handle K:D merge (in the frags column)
- if(1<<i == TC_STATS_FRAGS && Config()->m_ClStatboardInfos & TC_STATS_DEATHS)
+ // handle K:D merge (in the kills column)
+ if(1<<i == TC_STATS_KILLS && Config()->m_ClStatboardInfos & TC_STATS_DEATHS)
{
pText = "K:D";
px += 60.0f; // some extra for the merge
}
- else if(1<<i == TC_STATS_DEATHS && Config()->m_ClStatboardInfos & TC_STATS_FRAGS)
+ else if(1<<i == TC_STATS_DEATHS && Config()->m_ClStatboardInfos & TC_STATS_KILLS)
continue;
// handle spree columns merge
if(1<<i == TC_STATS_BESTSPREE)
@@ -372,15 +372,15 @@ void CStats::OnRender()
s_Cursor.m_MaxWidth = -1;
s_Cursor.m_Align = TEXTALIGN_MR;
px = 325;
- if(Config()->m_ClStatboardInfos & TC_STATS_FRAGS)
+ if(Config()->m_ClStatboardInfos & TC_STATS_KILLS)
{
if(Config()->m_ClStatboardInfos & TC_STATS_DEATHS)
{
px += 60;
- str_format(aBuf, sizeof(aBuf), "%d:%d", pStats->m_Frags, pStats->m_Deaths);
+ str_format(aBuf, sizeof(aBuf), "%d:%d", pStats->m_Kills, pStats->m_Deaths);
}
else
- str_format(aBuf, sizeof(aBuf), "%d", pStats->m_Frags);
+ str_format(aBuf, sizeof(aBuf), "%d", pStats->m_Kills);
s_Cursor.Reset();
s_Cursor.MoveTo(x + px, y + LineHeight / 2.0f);
@@ -408,7 +408,7 @@ void CStats::OnRender()
if(pStats->m_Deaths == 0)
str_format(aBuf, sizeof(aBuf), "—");
else
- str_format(aBuf, sizeof(aBuf), "%.2f", (float)(pStats->m_Frags)/pStats->m_Deaths);
+ str_format(aBuf, sizeof(aBuf), "%.2f", (float)(pStats->m_Kills)/pStats->m_Deaths);
s_Cursor.Reset();
s_Cursor.MoveTo(x + px, y + LineHeight / 2.0f);
TextRender()->TextOutlined(&s_Cursor, aBuf, -1);
@@ -416,16 +416,16 @@ void CStats::OnRender()
}
if(Config()->m_ClStatboardInfos & TC_STATS_NET)
{
- str_format(aBuf, sizeof(aBuf), "%+d", pStats->m_Frags-pStats->m_Deaths);
+ str_format(aBuf, sizeof(aBuf), "%+d", pStats->m_Kills - pStats->m_Deaths);
s_Cursor.Reset();
s_Cursor.MoveTo(x + px, y + LineHeight / 2.0f);
TextRender()->TextOutlined(&s_Cursor, aBuf, -1);
px += 100;
}
- if(Config()->m_ClStatboardInfos & TC_STATS_FPM)
+ if(Config()->m_ClStatboardInfos & TC_STATS_KPM)
{
- float Fpm = pStats->m_IngameTicks > 0 ? (float)(pStats->m_Frags * Client()->GameTickSpeed() * 60) / pStats->m_IngameTicks : 0.f;
- str_format(aBuf, sizeof(aBuf), "%.1f", Fpm);
+ const float KPM = pStats->m_IngameTicks > 0 ? (float)(pStats->m_Kills * Client()->GameTickSpeed() * 60) / pStats->m_IngameTicks : 0.f;
+ str_format(aBuf, sizeof(aBuf), "%.1f", KPM);
s_Cursor.Reset();
s_Cursor.MoveTo(x + px, y + LineHeight / 2.0f);
TextRender()->TextOutlined(&s_Cursor, aBuf, -1);
@@ -470,22 +470,22 @@ void CStats::OnRender()
const float StartX = px - Offset;
const float RoundSize = BarHeight/2.0f;
float EndX = StartX; // each bar will have its width incremented by the roundsize so this avoids that last one would overflow
- int TotalFrags = 0;
+ int TotalKills = 0;
for(int i = 0; i < NUM_WEAPONS; i++)
{
if(aDisplayWeapon[i])
{
EndX += 80.0f;
- TotalFrags += pStats->m_aFragsWith[i];
+ TotalKills += pStats->m_aKillsWith[i];
}
}
float ExploitableLength = (EndX-StartX) - RoundSize;
CUIRect Rect = {x + StartX, y + LineHeight / 2.0f - BarHeight / 2.0f, 0.0f, BarHeight};
for(int i = 0; i < NUM_WEAPONS; i++)
{
- if(pStats->m_aFragsWith[i])
+ if(pStats->m_aKillsWith[i])
{
- Rect.w = ExploitableLength * pStats->m_aFragsWith[i] / (float)TotalFrags;
+ Rect.w = ExploitableLength * pStats->m_aKillsWith[i] / (float)TotalKills;
Rect.w += RoundSize;
Rect.Draw(s_aWeaponColors[i], RoundSize);
Rect.w -= RoundSize;
diff --git a/src/game/client/components/stats.h b/src/game/client/components/stats.h
index feda562a9..2200339bb 100644
--- a/src/game/client/components/stats.h
+++ b/src/game/client/components/stats.h
@@ -7,12 +7,12 @@
enum
{
- TC_STATS_FRAGS = 1,
+ TC_STATS_KILLS = 1,
TC_STATS_DEATHS = 2,
TC_STATS_SUICIDES = 4,
TC_STATS_RATIO = 8,
TC_STATS_NET = 16,
- TC_STATS_FPM = 32,
+ TC_STATS_KPM = 32,
TC_STATS_SPREE = 64,
TC_STATS_BESTSPREE = 128,
TC_STATS_FLAGGRABS = 256,
@@ -34,9 +34,9 @@ private:
}
int m_IngameTicks;
- int m_aFragsWith[NUM_WEAPONS];
+ int m_aKillsWith[NUM_WEAPONS];
int m_aDeathsFrom[NUM_WEAPONS];
- int m_Frags;
+ int m_Kills;
int m_Deaths;
int m_Suicides;
int m_BestSpree;