diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index 1d074995e..fab3ef599 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -2309,29 +2309,7 @@ void CMenus::OnRender() return; } - // update colors - ms_GuiColor = color_cast(ColorHSLA(g_Config.m_UiColor, true)); - - ms_ColorTabbarInactiveOutgame = ColorRGBA(0, 0, 0, 0.25f); - ms_ColorTabbarActiveOutgame = ColorRGBA(0, 0, 0, 0.5f); - ms_ColorTabbarHoverOutgame = ColorRGBA(1, 1, 1, 0.25f); - - float ColorIngameScaleI = 0.5f; - float ColorIngameAcaleA = 0.2f; - - ms_ColorTabbarInactiveIngame = ColorRGBA( - ms_GuiColor.r * ColorIngameScaleI, - ms_GuiColor.g * ColorIngameScaleI, - ms_GuiColor.b * ColorIngameScaleI, - ms_GuiColor.a * 0.8f); - - ms_ColorTabbarActiveIngame = ColorRGBA( - ms_GuiColor.r * ColorIngameAcaleA, - ms_GuiColor.g * ColorIngameAcaleA, - ms_GuiColor.b * ColorIngameAcaleA, - ms_GuiColor.a); - - ms_ColorTabbarHoverIngame = ColorRGBA(1, 1, 1, 0.75f); + UpdateColors(); // update the ui const CUIRect *pScreen = UI()->Screen(); @@ -2362,6 +2340,32 @@ void CMenus::OnRender() UI()->ClearHotkeys(); } +void CMenus::UpdateColors() +{ + ms_GuiColor = color_cast(ColorHSLA(g_Config.m_UiColor, true)); + + ms_ColorTabbarInactiveOutgame = ColorRGBA(0.0f, 0.0f, 0.0f, 0.25f); + ms_ColorTabbarActiveOutgame = ColorRGBA(0.0f, 0.0f, 0.0f, 0.5f); + ms_ColorTabbarHoverOutgame = ColorRGBA(1.0f, 1.0f, 1.0f, 0.25f); + + const float ColorIngameScaleI = 0.5f; + const float ColorIngameAcaleA = 0.2f; + + ms_ColorTabbarInactiveIngame = ColorRGBA( + ms_GuiColor.r * ColorIngameScaleI, + ms_GuiColor.g * ColorIngameScaleI, + ms_GuiColor.b * ColorIngameScaleI, + ms_GuiColor.a * 0.8f); + + ms_ColorTabbarActiveIngame = ColorRGBA( + ms_GuiColor.r * ColorIngameAcaleA, + ms_GuiColor.g * ColorIngameAcaleA, + ms_GuiColor.b * ColorIngameAcaleA, + ms_GuiColor.a); + + ms_ColorTabbarHoverIngame = ColorRGBA(1.0f, 1.0f, 1.0f, 0.75f); +} + void CMenus::RenderBackground() { Graphics()->BlendNormal(); diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index c856bfd35..04fb79d21 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -509,6 +509,7 @@ protected: void SetNeedSendInfo(); void SetActive(bool Active); + void UpdateColors(); IGraphics::CTextureHandle m_TextureBlob;