From 0114e03f2ab3b08091f049efc01f62c34fd3af43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Tue, 29 Aug 2023 21:46:39 +0200 Subject: [PATCH] Fix some `CLocConstString`s being localized twice Column and key names are stored as `CLocConstString`s, which automatically return the localized string with the operator `const char *()`. Calling `Localize` manually for these is unnecessary. --- src/game/client/components/menus_browser.cpp | 2 +- src/game/client/components/menus_ingame.cpp | 2 +- src/game/client/components/menus_settings.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index e5dff168b45..e3c258c2c7c 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -143,7 +143,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View) if(PlayersOrPing && g_Config.m_BrSortOrder == 2 && (s_aCols[i].m_Sort == IServerBrowser::SORT_NUMPLAYERS || s_aCols[i].m_Sort == IServerBrowser::SORT_PING)) Checked = 2; - if(DoButton_GridHeader(s_aCols[i].m_Caption, Localize(s_aCols[i].m_Caption), Checked, &s_aCols[i].m_Rect)) + if(DoButton_GridHeader(s_aCols[i].m_Caption, s_aCols[i].m_Caption, Checked, &s_aCols[i].m_Rect)) { if(s_aCols[i].m_Sort != -1) { diff --git a/src/game/client/components/menus_ingame.cpp b/src/game/client/components/menus_ingame.cpp index 0d3c0b91482..94e82819020 100644 --- a/src/game/client/components/menus_ingame.cpp +++ b/src/game/client/components/menus_ingame.cpp @@ -1022,7 +1022,7 @@ void CMenus::RenderGhost(CUIRect MainView) // do headers for(int i = 0; i < NumCols; i++) - DoButton_GridHeader(s_aCols[i].m_Caption, Localize(s_aCols[i].m_Caption), 0, &s_aCols[i].m_Rect); + DoButton_GridHeader(s_aCols[i].m_Caption, s_aCols[i].m_Caption, 0, &s_aCols[i].m_Rect); View.Draw(ColorRGBA(0, 0, 0, 0.15f), 0, 0); diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 740fd39c719..bb070acd488 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -1009,7 +1009,7 @@ void CMenus::DoSettingsControlsButtons(int Start, int Stop, CUIRect View) Button.VSplitLeft(135.0f, &Label, &Button); char aBuf[64]; - str_format(aBuf, sizeof(aBuf), "%s:", Localize((const char *)Key.m_Name)); + str_format(aBuf, sizeof(aBuf), "%s:", (const char *)Key.m_Name); UI()->DoLabel(&Label, aBuf, 13.0f, TEXTALIGN_ML); int OldId = Key.m_KeyId, OldModifierCombination = Key.m_ModifierCombination, NewModifierCombination;