From 7d288047c13bb6eea6c2c95f5bdcba014b932bf0 Mon Sep 17 00:00:00 2001 From: Robert Müller Date: Thu, 3 Dec 2020 00:28:30 +0100 Subject: move ms_FontModHeight to CUI --- src/game/client/components/menus.cpp | 26 ++++++------ src/game/client/components/menus.h | 2 - src/game/client/components/menus_browser.cpp | 22 +++++----- src/game/client/components/menus_demo.cpp | 6 +-- src/game/client/components/menus_ingame.cpp | 60 +++++++++++++-------------- src/game/client/components/menus_listbox.cpp | 6 +-- src/game/client/components/menus_settings.cpp | 56 ++++++++++++------------- src/game/client/ui.cpp | 8 ++-- 8 files changed, 91 insertions(+), 95 deletions(-) diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index 9ff9c514f..3c727091d 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -33,8 +33,6 @@ #include "menus.h" #include "skins.h" -float CMenus::ms_FontmodHeight = CUI::ms_FontmodHeight; - CRenderTools *CMenus::CUIElementBase::m_pRenderTools = 0; CUI *CMenus::CUIElementBase::m_pUI = 0; IInput *CMenus::CUIElementBase::m_pInput = 0; @@ -181,7 +179,7 @@ bool CMenus::DoButton_Menu(CButtonContainer *pBC, const char *pText, bool Checke TextRender()->TextColor(1.0f-FadeVal, 1.0f-FadeVal, 1.0f-FadeVal, 1.0f); TextRender()->TextSecondaryColor(0.0f+FadeVal, 0.0f+FadeVal, 0.0f+FadeVal, 0.25f); } - UI()->DoLabel(&Text, pText, Text.h*ms_FontmodHeight, TEXTALIGN_CENTER); + UI()->DoLabel(&Text, pText, Text.h*CUI::ms_FontmodHeight, TEXTALIGN_CENTER); if(TextFade) { TextRender()->TextColor(CUI::ms_DefaultTextColor); @@ -200,7 +198,7 @@ void CMenus::DoButton_KeySelect(CButtonContainer *pBC, const char *pText, const pRect->HMargin(1.0f, &Label); TextRender()->TextColor(1.0f-FadeVal, 1.0f-FadeVal, 1.0f-FadeVal, 1.0f); TextRender()->TextSecondaryColor(0.0f+FadeVal, 0.0f+FadeVal, 0.0f+FadeVal, 0.25f); - UI()->DoLabel(&Label, pText, Label.h*ms_FontmodHeight, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, pText, Label.h*CUI::ms_FontmodHeight, TEXTALIGN_CENTER); TextRender()->TextColor(CUI::ms_DefaultTextColor); TextRender()->TextSecondaryColor(CUI::ms_DefaultTextOutlineColor); } @@ -217,7 +215,7 @@ bool CMenus::DoButton_MenuTabTop(CButtonContainer *pBC, const char *pText, bool Label.HMargin((Label.h*FontFactor)/2.0f, &Label); TextRender()->TextColor(1.0f-FadeVal, 1.0f-FadeVal, 1.0f-FadeVal, FontAlpha); TextRender()->TextSecondaryColor(0.0f+FadeVal, 0.0f+FadeVal, 0.0f+FadeVal, 0.25f*FontAlpha); - UI()->DoLabel(&Label, pText, Label.h*ms_FontmodHeight, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, pText, Label.h*CUI::ms_FontmodHeight, TEXTALIGN_CENTER); TextRender()->TextColor(CUI::ms_DefaultTextColor); TextRender()->TextSecondaryColor(CUI::ms_DefaultTextOutlineColor); return UI()->DoButtonLogic(pBC, pRect); @@ -239,7 +237,7 @@ bool CMenus::DoButton_GridHeader(const void *pID, const char *pText, bool Checke CUIRect Label; pRect->VMargin(2.0f, &Label); Label.y += 2.0f; - UI()->DoLabel(&Label, pText, Label.h*ms_FontmodHeight*0.8f, Align); + UI()->DoLabel(&Label, pText, Label.h*CUI::ms_FontmodHeight*0.8f, Align); if(Checked) { @@ -282,7 +280,7 @@ bool CMenus::DoButton_CheckBox(const void *pID, const char *pText, bool Checked, Graphics()->QuadsEnd(); Label.y += 1.0f; // lame fix - UI()->DoLabel(&Label, pText, Label.h*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Label, pText, Label.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); if(Locked) { @@ -352,7 +350,7 @@ float CMenus::DoIndependentDropdownMenu(void *pID, const CUIRect *pRect, const c // label Label = Header; Label.y += 2.0f; - UI()->DoLabel(&Label, pStr, Header.h*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, pStr, Header.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); if(UI()->DoButtonLogic(pID, &Header)) *pActive ^= 1; @@ -376,10 +374,10 @@ void CMenus::DoInfoBox(const CUIRect *pRect, const char *pLabel, const char *pVa char aBuf[32]; str_format(aBuf, sizeof(aBuf), "%s:", pLabel); Label.y += 2.0f; - UI()->DoLabel(&Label, aBuf, pRect->h*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, aBuf, pRect->h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); Value.y += 2.0f; - UI()->DoLabel(&Value, pValue, pRect->h*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Value, pValue, pRect->h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); } void CMenus::DoJoystickBar(const CUIRect *pRect, float Current, float Tolerance, bool Active) @@ -698,7 +696,7 @@ void CMenus::RenderMenubar(CUIRect Rect) Box.HMargin(2.0f, &Box); TextRender()->TextColor(CUI::ms_HighlightTextColor); TextRender()->TextSecondaryColor(CUI::ms_HighlightTextOutlineColor); - UI()->DoLabel(&Box, Localize("Demos"), Box.h*ms_FontmodHeight, TEXTALIGN_CENTER); + UI()->DoLabel(&Box, Localize("Demos"), Box.h*CUI::ms_FontmodHeight, TEXTALIGN_CENTER); TextRender()->TextColor(CUI::ms_DefaultTextColor); TextRender()->TextSecondaryColor(CUI::ms_DefaultTextOutlineColor); } @@ -1107,7 +1105,7 @@ void CMenus::RenderMenu(CUIRect Screen) Button.Draw(Color, 5.0f, CUIRect::CORNER_BL); // draw non-blending X - UI()->DoLabel(&Button, "\xE2\x9C\x95", Button.h*ms_FontmodHeight, TEXTALIGN_CENTER); + UI()->DoLabel(&Button, "\xE2\x9C\x95", Button.h*CUI::ms_FontmodHeight, TEXTALIGN_CENTER); if(UI()->DoButtonLogic(&s_QuitButton, &Button)) m_Popup = POPUP_QUIT; @@ -1234,7 +1232,7 @@ void CMenus::RenderMenu(CUIRect Screen) } const float ButtonHeight = 20.0f; - const float FontSize = ButtonHeight*ms_FontmodHeight*0.8f; + const float FontSize = ButtonHeight*CUI::ms_FontmodHeight*0.8f; const float SpacingH = 2.0f; const float SpacingW = 3.0f; CUIRect Box = Screen; @@ -1250,7 +1248,7 @@ void CMenus::RenderMenu(CUIRect Screen) CUIRect Part; Box.HSplitTop(ButtonHeight+5.0f, &Part, &Box); Part.y += 3.0f; - UI()->DoLabel(&Part, pTitle, Part.h*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Part, pTitle, Part.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); // inner box CUIRect BottomBar; diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index 5ab6ea302..6ef00370f 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -363,8 +363,6 @@ private: int64 m_LastInput; - static float ms_FontmodHeight; - // for settings bool m_NeedRestartPlayer; bool m_NeedRestartGraphics; diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index 976494b52..32bf71e44 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -520,13 +520,13 @@ int CMenus::DoBrowserEntry(const void *pID, CUIRect View, const CServerInfo *pEn { TextRender()->TextColor(TextBaseColor); TextRender()->TextSecondaryColor(TextBaseOutlineColor); - Button.y += (Button.h - FontSize/ms_FontmodHeight)/2.0f; + Button.y += (Button.h - FontSize/CUI::ms_FontmodHeight)/2.0f; UI()->DoLabelHighlighted(&Button, pEntry->m_aName, (pEntry->m_QuickSearchHit&IServerBrowser::QUICK_SERVERNAME) ? Config()->m_BrFilterString : 0, FontSize, TextBaseColor, HighlightColor); } else if(ID == COL_BROWSER_MAP) { TextRender()->TextColor(TextBaseColor); - Button.y += (Button.h - FontSize/ms_FontmodHeight)/2.0f; + Button.y += (Button.h - FontSize/CUI::ms_FontmodHeight)/2.0f; UI()->DoLabelHighlighted(&Button, pEntry->m_aMap, (pEntry->m_QuickSearchHit&IServerBrowser::QUICK_MAPNAME) ? Config()->m_BrFilterString : 0, FontSize, TextBaseColor, HighlightColor); } else if(ID == COL_BROWSER_PLAYERS) @@ -562,7 +562,7 @@ int CMenus::DoBrowserEntry(const void *pID, CUIRect View, const CServerInfo *pEn str_format(aTemp, sizeof(aTemp), "%d/%d", Num, Max); if(Config()->m_BrFilterString[0] && (pEntry->m_QuickSearchHit&IServerBrowser::QUICK_PLAYER)) TextRender()->TextColor(TextHighlightColor.r, TextHighlightColor.g, TextHighlightColor.b, TextAlpha); - Button.y += (Button.h - FontSize/ms_FontmodHeight)/2.0f; + Button.y += (Button.h - FontSize/CUI::ms_FontmodHeight)/2.0f; if(Num < 100) Button.x += s_RenderOffset; @@ -607,7 +607,7 @@ int CMenus::DoBrowserEntry(const void *pID, CUIRect View, const CServerInfo *pEn str_format(aTemp, sizeof(aTemp), "%d", Ping); TextRender()->TextColor(Color); TextRender()->TextSecondaryColor(TextBaseOutlineColor); - Button.y += (Button.h - FontSize/ms_FontmodHeight)/2.0f; + Button.y += (Button.h - FontSize/CUI::ms_FontmodHeight)/2.0f; Button.w -= 4.0f; UI()->DoLabel(&Button, aTemp, FontSize, TEXTALIGN_RIGHT); } @@ -622,7 +622,7 @@ int CMenus::DoBrowserEntry(const void *pID, CUIRect View, const CServerInfo *pEn // gametype text TextRender()->TextColor(TextBaseColor); TextRender()->TextSecondaryColor(TextBaseOutlineColor); - Button.y += (Button.h - FontSize/ms_FontmodHeight)/2.0f; + Button.y += (Button.h - FontSize/CUI::ms_FontmodHeight)/2.0f; UI()->DoLabelHighlighted(&Button, pEntry->m_aGameType, (pEntry->m_QuickSearchHit&IServerBrowser::QUICK_GAMETYPE) ? Config()->m_BrFilterString : 0, FontSize, TextBaseColor, HighlightColor); } } @@ -673,12 +673,12 @@ void CMenus::RenderFilterHeader(CUIRect View, int FilterIndex) View.VSplitLeft(20.0f, 0, &View); // little space View.y += 2.0f; - UI()->DoLabel(&View, pFilter->Name(), ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&View, pFilter->Name(), ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); View.VSplitRight(20.0f, &View, 0); // little space char aBuf[128]; str_format(aBuf, sizeof(aBuf), Localize("%d servers, %d players"), pFilter->NumSortedServers(), pFilter->NumPlayers()); - UI()->DoLabel(&View, aBuf, ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_RIGHT); + UI()->DoLabel(&View, aBuf, ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_RIGHT); EditButtons.VSplitRight(ButtonHeight, &EditButtons, &Button); Button.Margin(2.0f, &Button); @@ -1131,7 +1131,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View) // bottom float SpacingW = 3.0f; float ButtonWidth = (Status.w/6.0f)-(SpacingW*5.0)/6.0f; - float FontSize = ButtonHeight*ms_FontmodHeight*0.8f; + float FontSize = ButtonHeight*CUI::ms_FontmodHeight*0.8f; // cut view CUIRect Left, Label, EditBox, Button; @@ -1475,7 +1475,7 @@ void CMenus::RenderServerbrowserFriendTab(CUIRect View) UI()->DoLabel(&Label, Localize("Name"), FontSize, TEXTALIGN_LEFT); static char s_aName[MAX_NAME_ARRAY_SIZE] = { 0 }; static CLineInput s_NameInput(s_aName, sizeof(s_aName), MAX_NAME_LENGTH); - UI()->DoEditBox(&s_NameInput, &Button, Button.h*ms_FontmodHeight*0.8f); + UI()->DoEditBox(&s_NameInput, &Button, Button.h*CUI::ms_FontmodHeight*0.8f); BottomArea.HSplitTop(HeaderHeight, &Button, &BottomArea); BottomArea.HSplitTop(SpacingH, 0, &BottomArea); @@ -1483,7 +1483,7 @@ void CMenus::RenderServerbrowserFriendTab(CUIRect View) UI()->DoLabel(&Label, Localize("Clan"), FontSize, TEXTALIGN_LEFT); static char s_aClan[MAX_CLAN_ARRAY_SIZE] = { 0 }; static CLineInput s_ClanInput(s_aClan, sizeof(s_aClan), MAX_CLAN_LENGTH); - UI()->DoEditBox(&s_ClanInput, &Button, Button.h*ms_FontmodHeight*0.8f); + UI()->DoEditBox(&s_ClanInput, &Button, Button.h*CUI::ms_FontmodHeight*0.8f); BottomArea.HSplitTop(HeaderHeight, &Button, &BottomArea); Button.Draw(vec4(1.0f, 1.0f, 1.0f, 0.25f)); @@ -2038,7 +2038,7 @@ void CMenus::RenderDetailScoreboard(CUIRect View, const CServerInfo *pInfo, int // score if(!(pInfo->m_aClients[i].m_PlayerType&CServerInfo::CClient::PLAYERFLAG_SPEC)) { - Score.y += (Score.h - FontSize/ms_FontmodHeight)/2.0f; + Score.y += (Score.h - FontSize/CUI::ms_FontmodHeight)/2.0f; char aTemp[16]; FormatScore(aTemp, sizeof(aTemp), pInfo->m_Flags&IServerBrowser::FLAG_TIMESCORE, &pInfo->m_aClients[i]); UI()->DoLabel(&Score, aTemp, FontSize, TEXTALIGN_LEFT); diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp index 1064a1075..c9fbe31c5 100644 --- a/src/game/client/components/menus_demo.cpp +++ b/src/game/client/components/menus_demo.cpp @@ -587,7 +587,7 @@ void CMenus::RenderDemoList(CUIRect MainView) if(ID == COL_DEMO_NAME) { Button.x += FileIcon.w + 10.0f; - UI()->DoLabel(&Button, DemoItem.m_aName, Item.m_Rect.h*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Button, DemoItem.m_aName, Item.m_Rect.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); } else if(ID == COL_DEMO_LENGTH && !DemoItem.m_IsDir && DemoItem.m_InfosLoaded && DemoItem.m_Valid) { @@ -597,7 +597,7 @@ void CMenus::RenderDemoList(CUIRect MainView) Button.VMargin(4.0f, &Button); if(!Item.m_Selected) TextRender()->TextColor(CUI::ms_TransparentTextColor); - UI()->DoLabel(&Button, aLength, Item.m_Rect.h*ms_FontmodHeight*0.8f, TEXTALIGN_RIGHT); + UI()->DoLabel(&Button, aLength, Item.m_Rect.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_RIGHT); } else if(ID == COL_DEMO_DATE && !DemoItem.m_IsDir) { @@ -605,7 +605,7 @@ void CMenus::RenderDemoList(CUIRect MainView) str_timestamp_ex(DemoItem.m_Date, aDate, sizeof(aDate), FORMAT_SPACE); if(!Item.m_Selected) TextRender()->TextColor(CUI::ms_TransparentTextColor); - UI()->DoLabel(&Button, aDate, Item.m_Rect.h*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Button, aDate, Item.m_Rect.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); } TextRender()->TextColor(CUI::ms_DefaultTextColor); if(Item.m_Selected) diff --git a/src/game/client/components/menus_ingame.cpp b/src/game/client/components/menus_ingame.cpp index efffdbeb9..6d42351c3 100644 --- a/src/game/client/components/menus_ingame.cpp +++ b/src/game/client/components/menus_ingame.cpp @@ -70,7 +70,7 @@ void CMenus::RenderGame(CUIRect MainView) // game options MainView.HSplitTop(20.0f, &Label, &MainView); Label.y += 2.0f; - UI()->DoLabel(&Label, Localize("Game options"), 20.0f*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, Localize("Game options"), 20.0f*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); MainView.Draw(vec4(0.0, 0.0, 0.0, 0.25f)); if(Info.m_aNotification[0] != 0) @@ -220,7 +220,7 @@ void CMenus::RenderPlayers(CUIRect MainView) // player options MainView.HSplitTop(ButtonHeight, &Label, &MainView); Label.y += 2.0f; - UI()->DoLabel(&Label, Localize("Player options"), ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, Localize("Player options"), ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); MainView.Draw(vec4(0.0, 0.0, 0.0, 0.25f)); // prepare headline @@ -244,7 +244,7 @@ void CMenus::RenderPlayers(CUIRect MainView) Row.VSplitLeft(ButtonHeight+Spacing, 0, &Row); Row.VSplitLeft(NameWidth, &Label, &Row); Label.y += 2.0f; - UI()->DoLabel(&Label, Localize("Player"), ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Label, Localize("Player"), ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); Row.VSplitRight(2*ButtonHeight, &Row, &Label); Graphics()->TextureSet(g_pData->m_aImages[IMAGE_GUIICONS].m_Id); @@ -301,17 +301,17 @@ void CMenus::RenderPlayers(CUIRect MainView) Label.y += 2.0f; if(Config()->m_ClShowUserId) { - UI()->DrawClientID(ButtonHeight*ms_FontmodHeight*0.8f, vec2(Label.x, Label.y), i); + UI()->DrawClientID(ButtonHeight*CUI::ms_FontmodHeight*0.8f, vec2(Label.x, Label.y), i); Label.VSplitLeft(ButtonHeight, 0, &Label); } char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s", Config()->m_ClShowsocial ? m_pClient->m_aClients[i].m_aName : ""); - UI()->DoLabel(&Label, aBuf, ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Label, aBuf, ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); Row.VSplitLeft(Spacing, 0, &Row); Row.VSplitLeft(ClanWidth, &Label, &Row); Label.y += 2.0f; str_format(aBuf, sizeof(aBuf), "%s", Config()->m_ClShowsocial ? m_pClient->m_aClients[i].m_aClan : ""); - UI()->DoLabel(&Label, aBuf, ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Label, aBuf, ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); // ignore button Row.VSplitRight(ButtonHeight/2, &Row, 0); @@ -372,33 +372,33 @@ void CMenus::RenderServerInfo(CUIRect MainView) ServerInfo.HSplitTop(ButtonHeight, &Label, &ServerInfo); Label.y += 2.0f; - UI()->DoLabel(&Label, Localize("Server info"), ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, Localize("Server info"), ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); ServerInfo.Draw(vec4(0.0, 0.0, 0.0, 0.25f)); ServerInfo.Margin(5.0f, &ServerInfo); ServerInfo.HSplitTop(2*ButtonHeight, &Label, &ServerInfo); Label.y += 2.0f; - UI()->DoLabel(&Label, CurrentServerInfo.m_aName, ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT, Label.w); + UI()->DoLabel(&Label, CurrentServerInfo.m_aName, ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT, Label.w); ServerInfo.HSplitTop(ButtonHeight, &Label, &ServerInfo); Label.y += 2.0f; str_format(aBuf, sizeof(aBuf), "%s: %s", Localize("Address"), CurrentServerInfo.m_aHostname); - UI()->DoLabel(&Label, aBuf, ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Label, aBuf, ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); ServerInfo.HSplitTop(ButtonHeight, &Label, &ServerInfo); Label.y += 2.0f; str_format(aBuf, sizeof(aBuf), "%s: %d", Localize("Ping"), m_pClient->m_Snap.m_pLocalInfo->m_Latency); - UI()->DoLabel(&Label, aBuf, ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Label, aBuf, ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); ServerInfo.HSplitTop(ButtonHeight, &Label, &ServerInfo); Label.y += 2.0f; str_format(aBuf, sizeof(aBuf), "%s: %s", Localize("Version"), CurrentServerInfo.m_aVersion); - UI()->DoLabel(&Label, aBuf, ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Label, aBuf, ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); ServerInfo.HSplitTop(ButtonHeight, &Label, &ServerInfo); Label.y += 2.0f; str_format(aBuf, sizeof(aBuf), "%s: %s", Localize("Password"), CurrentServerInfo.m_Flags&IServerBrowser::FLAG_PASSWORD ? Localize("Yes", "With") : Localize("No", "Without/None")); - UI()->DoLabel(&Label, aBuf, ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Label, aBuf, ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); const bool IsFavorite = CurrentServerInfo.m_Favorite; ServerInfo.HSplitBottom(ButtonHeight, &ServerInfo, &Label); @@ -426,19 +426,19 @@ void CMenus::RenderServerInfo(CUIRect MainView) GameInfo.HSplitTop(ButtonHeight, &Label, &GameInfo); Label.y += 2.0f; - UI()->DoLabel(&Label, Localize("Game info"), ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, Localize("Game info"), ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); GameInfo.Draw(vec4(0.0, 0.0, 0.0, 0.25f)); GameInfo.Margin(5.0f, &GameInfo); GameInfo.HSplitTop(ButtonHeight, &Label, &GameInfo); Label.y += 2.0f; str_format(aBuf, sizeof(aBuf), "%s: %s", Localize("Game type"), CurrentServerInfo.m_aGameType); - UI()->DoLabel(&Label, aBuf, ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Label, aBuf, ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); GameInfo.HSplitTop(ButtonHeight, &Label, &GameInfo); Label.y += 2.0f; str_format(aBuf, sizeof(aBuf), "%s: %s", Localize("Map"), CurrentServerInfo.m_aMap); - UI()->DoLabel(&Label, aBuf, ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Label, aBuf, ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); GameInfo.HSplitTop(ButtonHeight, &Label, &GameInfo); Label.y += 2.0f; @@ -456,22 +456,22 @@ void CMenus::RenderServerInfo(CUIRect MainView) break; } str_format(aBuf, sizeof(aBuf), "%s: %s", Localize("Difficulty"), pLevelName); - UI()->DoLabel(&Label, aBuf, ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Label, aBuf, ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); GameInfo.HSplitTop(ButtonHeight, &Label, &GameInfo); Label.y += 2.0f; str_format(aBuf, sizeof(aBuf), "%s: %d", Localize("Score limit"), m_pClient->m_GameInfo.m_ScoreLimit); - UI()->DoLabel(&Label, aBuf, ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Label, aBuf, ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); GameInfo.HSplitTop(ButtonHeight, &Label, &GameInfo); Label.y += 2.0f; str_format(aBuf, sizeof(aBuf), "%s: %d", Localize("Time limit"), m_pClient->m_GameInfo.m_TimeLimit); - UI()->DoLabel(&Label, aBuf, ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Label, aBuf, ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); GameInfo.HSplitBottom(ButtonHeight, &GameInfo, &Label); Label.y += 2.0f; str_format(aBuf, sizeof(aBuf), "%s: %d/%d", Localize("Players"), m_pClient->m_GameInfo.m_NumPlayers, CurrentServerInfo.m_MaxClients); - UI()->DoLabel(&Label, aBuf, ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Label, aBuf, ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); // motd Motd.HSplitTop(2.0f, 0, &Motd); @@ -479,7 +479,7 @@ void CMenus::RenderServerInfo(CUIRect MainView) Motd.HSplitTop(ButtonHeight, &Label, &Motd); Label.y += 2.0f; - UI()->DoLabel(&Label, Localize("MOTD"), ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, Localize("MOTD"), ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); Motd.Draw(vec4(0.0, 0.0, 0.0, 0.25f)); Motd.Margin(5.0f, &Motd); @@ -487,13 +487,13 @@ void CMenus::RenderServerInfo(CUIRect MainView) vec2 ScrollOffset(0, 0); CScrollRegionParams ScrollParams; - ScrollParams.m_ScrollUnit = ButtonHeight*ms_FontmodHeight*0.8f*3; // 3 rows per scroll + ScrollParams.m_ScrollUnit = ButtonHeight*CUI::ms_FontmodHeight*0.8f*3; // 3 rows per scroll s_ScrollRegion.Begin(&Motd, &ScrollOffset, &ScrollParams); Motd.y += ScrollOffset.y; static CTextCursor s_MenuMotdCursor; - s_MenuMotdCursor.m_FontSize = ButtonHeight*ms_FontmodHeight*0.8f; + s_MenuMotdCursor.m_FontSize = ButtonHeight*CUI::ms_FontmodHeight*0.8f; s_MenuMotdCursor.MoveTo(Motd.x, Motd.y); s_MenuMotdCursor.m_MaxWidth = Motd.w; s_MenuMotdCursor.m_MaxLines = -1; @@ -503,7 +503,7 @@ void CMenus::RenderServerInfo(CUIRect MainView) // define the MOTD text area and make it scrollable CUIRect MotdTextArea; - Motd.HSplitTop(s_MenuMotdCursor.BoundingBox().Bottom()-Motd.y+ButtonHeight*ms_FontmodHeight*0.8f+5.0f, &MotdTextArea, &Motd); + Motd.HSplitTop(s_MenuMotdCursor.BoundingBox().Bottom()-Motd.y+ButtonHeight*CUI::ms_FontmodHeight*0.8f+5.0f, &MotdTextArea, &Motd); s_ScrollRegion.AddRect(MotdTextArea); s_ScrollRegion.End(); @@ -533,7 +533,7 @@ bool CMenus::RenderServerControlServer(CUIRect MainView) for(int i = pOption->m_IsSubheader ? 1 : 0; i < pOption->m_Depth; i++) Item.m_Rect.VSplitLeft(10.0f, 0, &Item.m_Rect); - UI()->DoLabel(&Item.m_Rect, pOption->m_aDescription, Item.m_Rect.h*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Item.m_Rect, pOption->m_aDescription, Item.m_Rect.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); } } @@ -590,7 +590,7 @@ void CMenus::RenderServerControlKick(CUIRect MainView, bool FilterSpectators) { Row.VSplitLeft(Row.h, &Label, &Row); Label.y += 2.0f; - UI()->DrawClientID(Label.h*ms_FontmodHeight*0.8f, vec2(Label.x, Label.y), s_aPlayerIDs[i]); + UI()->DrawClientID(Label.h*CUI::ms_FontmodHeight*0.8f, vec2(Label.x, Label.y), s_aPlayerIDs[i]); } Row.VSplitLeft(Spacing, 0, &Row); @@ -598,12 +598,12 @@ void CMenus::RenderServerControlKick(CUIRect MainView, bool FilterSpectators) Label.y += 2.0f; char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s", Config()->m_ClShowsocial ? m_pClient->m_aClients[s_aPlayerIDs[i]].m_aName : ""); - UI()->DoLabel(&Label, aBuf, Label.h*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Label, aBuf, Label.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); Row.VSplitLeft(Spacing, 0, &Row); Row.VSplitLeft(ClanWidth, &Label, &Row); Label.y += 2.0f; str_format(aBuf, sizeof(aBuf), "%s", Config()->m_ClShowsocial ? m_pClient->m_aClients[s_aPlayerIDs[i]].m_aClan : ""); - UI()->DoLabel(&Label, aBuf, Label.h*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Label, aBuf, Label.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); } } @@ -760,7 +760,7 @@ void CMenus::RenderServerControl(CUIRect MainView) if(s_ControlPage == 0) { const char *pSearchLabel = Localize("Search:"); - const float FontSize = Search.h*ms_FontmodHeight*0.8f; + const float FontSize = Search.h*CUI::ms_FontmodHeight*0.8f; CUIRect Label; Search.VSplitLeft(TextRender()->TextWidth(FontSize, pSearchLabel, -1) + 10.0f, &Label, &Search); Label.y += 2.0f; @@ -773,7 +773,7 @@ void CMenus::RenderServerControl(CUIRect MainView) if(pNotification) { Bottom.y += 2.0f; - UI()->DoLabel(&Bottom, pNotification, Bottom.h*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Bottom, pNotification, Bottom.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); } else { @@ -785,7 +785,7 @@ void CMenus::RenderServerControl(CUIRect MainView) // render reason const char *pReasonLabel = Localize("Reason:"); - const float FontSize = Reason.h*ms_FontmodHeight*0.8f; + const float FontSize = Reason.h*CUI::ms_FontmodHeight*0.8f; Reason.VSplitLeft(TextRender()->TextWidth(FontSize, pReasonLabel, -1) + 10.0f, &Label, &Reason); Label.y += 2.0f; UI()->DoLabel(&Label, pReasonLabel, FontSize, TEXTALIGN_LEFT); diff --git a/src/game/client/components/menus_listbox.cpp b/src/game/client/components/menus_listbox.cpp index be0f2fc06..a9ed04d70 100644 --- a/src/game/client/components/menus_listbox.cpp +++ b/src/game/client/components/menus_listbox.cpp @@ -37,7 +37,7 @@ void CMenus::CListBox::DoHeader(const CUIRect *pRect, const char *pTitle, // draw header View.HSplitTop(HeaderHeight, &Header, &View); Header.y += 2.0f; - m_pUI->DoLabel(&Header, pTitle, Header.h*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + m_pUI->DoLabel(&Header, pTitle, Header.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); View.HSplitTop(Spacing, &Header, &View); @@ -65,7 +65,7 @@ bool CMenus::CListBox::DoFilter(float FilterHeight, float Spacing) View.HSplitTop(FilterHeight, &Filter, &View); Filter.Margin(Spacing, &Filter); - float FontSize = Filter.h*ms_FontmodHeight*0.8f; + float FontSize = Filter.h*CUI::ms_FontmodHeight*0.8f; CUIRect Label, EditBox; Filter.VSplitLeft(Filter.w/5.0f, &Label, &EditBox); @@ -107,7 +107,7 @@ void CMenus::CListBox::DoStart(float RowHeight, int NumItems, int ItemsPerRow, i View.HSplitBottom(m_FooterHeight, &View, &Footer); Footer.VSplitLeft(10.0f, 0, &Footer); Footer.y += 2.0f; - m_pUI->DoLabel(&Footer, m_pBottomText, Footer.h*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + m_pUI->DoLabel(&Footer, m_pBottomText, Footer.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); } // setup the variables diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index b9dd42486..edf81d4ff 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -180,13 +180,13 @@ void CMenus::RenderHSLPicker(CUIRect MainView) // label Label.VSplitMid(&Label, &Button, 0.0f); Label.y += 4.0f; - UI()->DoLabel(&Label, apNames[i], SliderHeight*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, apNames[i], SliderHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); // value label char aBuf[16]; str_format(aBuf, sizeof(aBuf), "%d", *apVars[i]); Button.y += 4.0f; - UI()->DoLabel(&Button, aBuf, SliderHeight*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Button, aBuf, SliderHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); // button < Section.VSplitLeft(SliderHeight, &Button, &Bar); @@ -752,7 +752,7 @@ void CMenus::RenderLanguageSelection(CUIRect MainView, bool Header) TextRender()->TextSecondaryColor(CUI::ms_HighlightTextOutlineColor); } Item.m_Rect.y += 2.0f; - UI()->DoLabel(&Item.m_Rect, r.front().m_Name, Item.m_Rect.h*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Item.m_Rect, r.front().m_Name, Item.m_Rect.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); if(Item.m_Selected) { TextRender()->TextColor(CUI::ms_DefaultTextColor); @@ -847,7 +847,7 @@ void CMenus::RenderThemeSelection(CUIRect MainView, bool Header) TextRender()->TextSecondaryColor(CUI::ms_HighlightTextOutlineColor); } Item.m_Rect.y += 2.0f; - UI()->DoLabel(&Item.m_Rect, aName, Item.m_Rect.h*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Item.m_Rect, aName, Item.m_Rect.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); if(Item.m_Selected) { TextRender()->TextColor(CUI::ms_DefaultTextColor); @@ -903,7 +903,7 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView) // render game menu Game.HSplitTop(ButtonHeight, &Label, &Game); Label.y += 2.0f; - UI()->DoLabel(&Label, Localize("Game"), ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, Localize("Game"), ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); Game.VSplitMid(&GameLeft, &GameRight, Spacing); @@ -1015,7 +1015,7 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView) // render client menu Client.HSplitTop(ButtonHeight, &Label, &Client); Label.y += 2.0f; - UI()->DoLabel(&Label, Localize("Client"), ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, Localize("Client"), ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); Client.HSplitTop(Spacing, 0, &Client); Client.HSplitTop(ButtonHeight, &Button, &Client); @@ -1095,7 +1095,7 @@ void CMenus::RenderSettingsTeeCustom(CUIRect MainView) MainView.HSplitTop(ButtonHeight, &Label, &MainView); Label.y += 2.0f; - UI()->DoLabel(&Label, Localize("Customize"), ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, Localize("Customize"), ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); // skin part selection MainView.HSplitTop(SpacingH, 0, &MainView); @@ -1183,7 +1183,7 @@ void CMenus::RenderSettingsPlayer(CUIRect MainView) Left.HSplitTop(ButtonHeight, &Label, &Left); Label.y += 2.0f; - UI()->DoLabel(&Label, Localize("Tee"), ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, Localize("Tee"), ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); // Preview { @@ -1235,7 +1235,7 @@ void CMenus::RenderSettingsPlayer(CUIRect MainView) Top.VSplitLeft(Top.w/3.0f+SpacingW/2.0f, &Label, &Top); Label.y += 17.0f; - UI()->DoLabel(&Label, Localize("Normal:"), ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, Localize("Normal:"), ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); Top.Draw(vec4(0.0f, 0.0f, 0.0f, 0.25f)); @@ -1287,7 +1287,7 @@ void CMenus::RenderSettingsPlayer(CUIRect MainView) Bottom.VSplitLeft(Bottom.w/3.0f+SpacingW/2.0f, &Label, &Bottom); Label.y += 17.0f; - UI()->DoLabel(&Label, Localize("Team:"), ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, Localize("Team:"), ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); Bottom.VSplitMid(&TeeLeft, &TeeRight, SpacingW); @@ -1312,7 +1312,7 @@ void CMenus::RenderSettingsPlayer(CUIRect MainView) Right.HSplitTop(ButtonHeight, &Label, &Right); Label.y += 2.0f; - UI()->DoLabel(&Label, Localize("Personal"), ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, Localize("Personal"), ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); // Personal { @@ -1336,7 +1336,7 @@ void CMenus::RenderSettingsPlayer(CUIRect MainView) Bottom.VSplitLeft(100.0f, &Label, &Button); Label.y += 17.0f; - UI()->DoLabel(&Label, Localize("Flag:"), ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, Localize("Flag:"), ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); Button.w = (SkinHeight - 20.0f) * 2 + 20.0f; Button.Draw(vec4(0.0f, 0.0f, 0.0f, 0.25f)); @@ -1613,7 +1613,7 @@ bool CMenus::DoResolutionList(CUIRect* pRect, CListBox* pListBox, TextRender()->TextSecondaryColor(CUI::ms_HighlightTextOutlineColor); } Item.m_Rect.y += 2.0f; - UI()->DoLabel(&Item.m_Rect, aBuf, Item.m_Rect.h*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Item.m_Rect, aBuf, Item.m_Rect.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); if(Item.m_Selected) { TextRender()->TextColor(CUI::ms_DefaultTextColor); @@ -1680,7 +1680,7 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView) // render screen menu ScreenLeft.HSplitTop(ButtonHeight, &Label, &ScreenLeft); Label.y += 2.0f; - UI()->DoLabel(&Label, Localize("Screen"), ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, Localize("Screen"), ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); ScreenLeft.VSplitMid(&ScreenLeft, &ScreenRight, Spacing); @@ -1709,7 +1709,7 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView) Button.VSplitLeft(100.0f-25.0f, &Text, &Button); // make button appear centered with FSAA str_format(aBuf, sizeof(aBuf), Localize("Screen:")); Text.y += 2.0f; - UI()->DoLabel(&Text, aBuf, Text.h*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Text, aBuf, Text.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); Button.VSplitLeft(120.0f, &Button, 0); str_format(aBuf, sizeof(aBuf), "#%d (%dx%d)", Config()->m_GfxScreen+1, Graphics()->DesktopWidth(), Graphics()->DesktopHeight()); @@ -1732,7 +1732,7 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView) char aBuf[32]; str_format(aBuf, sizeof(aBuf), "%s:", Localize("Anti Aliasing")); Text.y += 2.0f; - UI()->DoLabel(&Text, aBuf, Text.h*ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); + UI()->DoLabel(&Text, aBuf, Text.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_LEFT); Button.VSplitLeft(70.0f, &Button, 0); str_format(aBuf, sizeof(aBuf), "%dx", Config()->m_GfxFsaaSamples); @@ -1775,7 +1775,7 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView) // render texture menu Texture.HSplitTop(ButtonHeight, &Label, &Texture); Label.y += 2.0f; - UI()->DoLabel(&Label, Localize("Texture"), ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, Localize("Texture"), ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); Texture.HSplitTop(Spacing, 0, &Texture); Texture.HSplitTop(ButtonHeight, &Button, &Texture); @@ -1813,7 +1813,7 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView) // draw header MainView.HSplitTop(ButtonHeight, &Header, &MainView); Header.y += 2.0f; - UI()->DoLabel(&Header, Localize("Resolution"), Header.h*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Header, Localize("Resolution"), Header.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); MainView.HSplitTop(Spacing, 0, &MainView); MainView.HSplitTop(ButtonHeight, &Button, &MainView); @@ -1826,11 +1826,11 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView) char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s", Localize("Recommended")); HeaderLeft.y += 2; - UI()->DoLabel(&HeaderLeft, aBuf, HeaderLeft.h*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&HeaderLeft, aBuf, HeaderLeft.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); str_format(aBuf, sizeof(aBuf), "%s", Localize("Other")); HeaderRight.y += 2; - UI()->DoLabel(&HeaderRight, aBuf, HeaderRight.h*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&HeaderRight, aBuf, HeaderRight.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); MainView.HSplitTop(Spacing, 0, &MainView); @@ -1844,7 +1844,7 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView) const float HiDPIScale = Graphics()->ScreenHiDPIScale(); str_format(aBuf, sizeof(aBuf), Localize("Current: %dx%d (%d:%d)"), (int)(s_GfxScreenWidth*HiDPIScale), (int)(s_GfxScreenHeight*HiDPIScale), s_GfxScreenWidth/g, s_GfxScreenHeight/g); Button.y += 2; - UI()->DoLabel(&Button, aBuf, Button.h*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Button, aBuf, Button.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); static int s_LastScreen = Config()->m_GfxScreen; if(s_LastScreen != Config()->m_GfxScreen) @@ -1927,7 +1927,7 @@ void CMenus::RenderSettingsSound(CUIRect MainView) // render sound menu Sound.HSplitTop(ButtonHeight, &Label, &Sound); Label.y += 2.0f; - UI()->DoLabel(&Label, Localize("Sound"), ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, Localize("Sound"), ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); Sound.HSplitTop(Spacing, 0, &Sound); CUIRect UseSoundButton; @@ -1953,7 +1953,7 @@ void CMenus::RenderSettingsSound(CUIRect MainView) // render detail menu Detail.HSplitTop(ButtonHeight, &Label, &Detail); Label.y += 2.0f; - UI()->DoLabel(&Label, Localize("Detail"), ButtonHeight*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Label, Localize("Detail"), ButtonHeight*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); // split menu CUIRect Left, Right; @@ -1972,10 +1972,10 @@ void CMenus::RenderSettingsSound(CUIRect MainView) char aBuf[32]; str_format(aBuf, sizeof(aBuf), "%s:", Localize("Sample rate")); Text.y += 2.0f; - UI()->DoLabel(&Text, aBuf, Text.h*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Text, aBuf, Text.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); Unit.y += 2.0f; - UI()->DoLabel(&Unit, "kHz", Unit.h*ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); + UI()->DoLabel(&Unit, "kHz", Unit.h*CUI::ms_FontmodHeight*0.8f, TEXTALIGN_CENTER); if(Config()->m_SndRate != 48000 && Config()->m_SndRate != 44100) Config()->m_SndRate = 48000; @@ -2143,16 +2143,16 @@ void CMenus::RenderSettings(CUIRect MainView) TextRender()->TextColor(0.973f, 0.863f, 0.207f, 1.0f); RestartWarning.y += 2.0f; if(m_NeedRestartGraphics || m_NeedRestartSound) - UI()->DoLabel(&RestartWarning, Localize("You must restart the game for all settings to take effect."), RestartWarning.h*ms_FontmodHeight*0.75f, TEXTALIGN_CENTER); + UI()->DoLabel(&RestartWarning, Localize("You must restart the game for all settings to take effect."), RestartWarning.h*CUI::ms_FontmodHeight*0.75f, TEXTALIGN_CENTER); else if(Client()->State() == IClient::STATE_ONLINE) { if(m_NeedRestartPlayer || NeedRestartTee) - UI()->DoLabel(&RestartWarning, Localize("You must reconnect to change identity."), RestartWarning.h*ms_FontmodHeight*0.75f, TEXTALIGN_CENTER); + UI()->DoLabel(&RestartWarning, Localize("You must reconnect to change identity."), RestartWarning.h*CUI::ms_FontmodHeight*0.75f, TEXTALIGN_CENTER); else if(m_SkinModified) { char aBuf[128]; str_format(aBuf, sizeof(aBuf), Localize("You have to wait %1.0f seconds to change identity."), m_pClient->m_LastSkinChangeTime+6.5f - Client()->LocalTime()); - UI()->DoLabel(&RestartWarning, aBuf, RestartWarning.h*ms_FontmodHeight*0.75f, TEXTALIGN_CENTER); + UI()->DoLabel(&RestartWarning, aBuf, RestartWarning.h*CUI::ms_FontmodHeight*0.75f, TEXTALIGN_CENTER); } } TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f); diff --git a/src/game/client/ui.cpp b/src/game/client/ui.cpp index 44c66cfa5..5ef7f9ff5 100644 --- a/src/game/client/ui.cpp +++ b/src/game/client/ui.cpp @@ -409,7 +409,7 @@ bool CUI::DoEditBox(CLineInput *pLineInput, const CUIRect *pRect, float FontSize CUIRect Textbox = *pRect; Textbox.Draw(pColorFunction->GetColor(LastActiveItem() == pLineInput, Inside), 5.0f, Corners); Textbox.VMargin(Spacing, &Textbox); - Textbox.HMargin((Textbox.h-FontSize/ms_FontmodHeight)/2, &Textbox); + Textbox.HMargin((Textbox.h-FontSize/CUI::ms_FontmodHeight)/2, &Textbox); const char *pDisplayStr = pLineInput->GetString(); char aStars[128]; @@ -480,7 +480,7 @@ void CUI::DoEditBoxOption(CLineInput *pLineInput, const CUIRect *pRect, const ch CUIRect Label, EditBox; pRect->VSplitLeft(VSplitVal, &Label, &EditBox); - const float FontSize = pRect->h*ms_FontmodHeight*0.8f; + const float FontSize = pRect->h*CUI::ms_FontmodHeight*0.8f; char aBuf[32]; str_format(aBuf, sizeof(aBuf), "%s:", pStr); Label.y += 2.0f; @@ -632,7 +632,7 @@ void CUI::DoScrollbarOption(const void *pID, int *pOption, const CUIRect *pRect, else str_format(aBuf, sizeof(aBuf), "%s: \xe2\x88\x9e", pStr); - float FontSize = pRect->h*ms_FontmodHeight*0.8f; + float FontSize = pRect->h*CUI::ms_FontmodHeight*0.8f; float VSplitVal = maximum(TextRender()->TextWidth(FontSize, aBuf, -1), TextRender()->TextWidth(FontSize, aBufMax, -1)); pRect->Draw(vec4(0.0f, 0.0f, 0.0f, 0.25f)); @@ -659,7 +659,7 @@ void CUI::DoScrollbarOptionLabeled(const void *pID, int *pOption, const CUIRect char aBuf[128]; str_format(aBuf, sizeof(aBuf), "%s: %s", pStr, aLabels[Value]); - float FontSize = pRect->h*ms_FontmodHeight*0.8f; + float FontSize = pRect->h*CUI::ms_FontmodHeight*0.8f; pRect->Draw(vec4(0.0f, 0.0f, 0.0f, 0.25f)); -- cgit v1.2.3