mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Extract CMenus::UpdateColors
function
This commit is contained in:
parent
878eedeed7
commit
322e06e4a5
|
@ -2309,29 +2309,7 @@ void CMenus::OnRender()
|
|||
return;
|
||||
}
|
||||
|
||||
// update colors
|
||||
ms_GuiColor = color_cast<ColorRGBA>(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<ColorRGBA>(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();
|
||||
|
|
|
@ -509,6 +509,7 @@ protected:
|
|||
|
||||
void SetNeedSendInfo();
|
||||
void SetActive(bool Active);
|
||||
void UpdateColors();
|
||||
|
||||
IGraphics::CTextureHandle m_TextureBlob;
|
||||
|
||||
|
|
Loading…
Reference in a new issue