diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index 0911ecf88..77990e4d1 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -35,6 +35,7 @@ float CMenus::ms_ButtonHeight = 25.0f; float CMenus::ms_ListheaderHeight = 17.0f; float CMenus::ms_FontmodHeight = 0.8f; +float CMenus::ms_BackgroundAlpha = 0.25f; CMenus::CMenus() diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index 81f0b4418..dd37c9529 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -220,6 +220,7 @@ private: static float ms_ButtonHeight; static float ms_ListheaderHeight; static float ms_FontmodHeight; + static float ms_BackgroundAlpha; // for settings bool m_NeedRestartGraphics; diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp index 23a9061ec..78d6dec7a 100644 --- a/src/game/client/components/menus_demo.cpp +++ b/src/game/client/components/menus_demo.cpp @@ -320,6 +320,7 @@ void CMenus::RenderDemoList(CUIRect MainView) // cut view MainView.HSplitBottom(80.0f, &MainView, &BottomView); + RenderTools()->DrawUIRect(&MainView, vec4(0.0f, 0.0f, 0.0f, ms_BackgroundAlpha), CUI::CORNER_ALL, 5.0f); BottomView.HSplitTop(20.f, 0, &BottomView); static int s_Inited = 0; diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 4846f27e3..9016a24a2 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -685,6 +685,7 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView) float BackgroundHeight = (float)(NumOptions+1)*ButtonHeight+(float)NumOptions*Spacing; MainView.HSplitTop(20.0f, 0, &MainView); + RenderTools()->DrawUIRect(&MainView, vec4(0.0f, 0.0f, 0.0f, ms_BackgroundAlpha), CUI::CORNER_ALL, 5.0f); MainView.HSplitTop(BackgroundHeight, &Game, &MainView); RenderTools()->DrawUIRect(&Game, vec4(0.0f, 0.0f, 0.0f, 0.25f), CUI::CORNER_ALL, 5.0f); @@ -901,6 +902,7 @@ void CMenus::RenderSettingsPlayer(CUIRect MainView) MainView.HSplitTop(20.0f, 0, &MainView); MainView.HSplitBottom(80.0f, &MainView, 0); // now we have the total rect for the settings + RenderTools()->DrawUIRect(&MainView, vec4(0.0f, 0.0f, 0.0f, 0.25f), CUI::CORNER_ALL, 5.0f); MainView.HSplitTop(BackgroundHeight, &TopView, &MainView); RenderTools()->DrawUIRect(&TopView, vec4(0.0f, 0.0f, 0.0f, 0.25f), CUI::CORNER_ALL, 5.0f); @@ -989,7 +991,6 @@ void CMenus::RenderSettingsTeeCustom(CUIRect MainView) float BoxSize = 297.0f; float BackgroundHeight = (ButtonHeight+SpacingH)*3.0f+BoxSize; - MainView.HSplitTop(BackgroundHeight, &MainView, 0); RenderTools()->DrawUIRect(&MainView, vec4(0.0f, 0.0f, 0.0f, 0.25f), CUI::CORNER_ALL, 5.0f); MainView.HSplitTop(ButtonHeight, &Label, &MainView); @@ -1046,6 +1047,7 @@ void CMenus::RenderSettingsTee(CUIRect MainView) BackgroundHeight = (ButtonHeight+SpacingH)*2.0f+SkinHeight; MainView.HSplitTop(20.0f, 0, &MainView); + RenderTools()->DrawUIRect(&MainView, vec4(0.0f, 0.0f, 0.0f, ms_BackgroundAlpha), CUI::CORNER_ALL, 5.0f); MainView.HSplitTop(BackgroundHeight, &Preview, &MainView); RenderTools()->DrawUIRect(&Preview, vec4(0.0f, 0.0f, 0.0f, 0.25f), CUI::CORNER_ALL, 5.0f); @@ -1184,6 +1186,7 @@ void CMenus::RenderSettingsControls(CUIRect MainView) CUIRect BottomView, Button; MainView.HSplitBottom(80.0f, &MainView, &BottomView); BottomView.HSplitTop(20.f, 0, &BottomView); + RenderTools()->DrawUIRect(&MainView, vec4(0.0f, 0.0f, 0.0f, ms_BackgroundAlpha), CUI::CORNER_ALL, 5.0f); // split scrollbar from main view CUIRect Scroll; @@ -1346,6 +1349,7 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView) float BackgroundHeight = (float)(NumOptions+1)*ButtonHeight+(float)NumOptions*Spacing; MainView.HSplitTop(20.0f, 0, &MainView); + RenderTools()->DrawUIRect(&MainView, vec4(0.0f, 0.0f, 0.0f, ms_BackgroundAlpha), CUI::CORNER_ALL, 5.0f); MainView.HSplitTop(BackgroundHeight, &ScreenLeft, &MainView); RenderTools()->DrawUIRect(&ScreenLeft, vec4(0.0f, 0.0f, 0.0f, 0.25f), CUI::CORNER_ALL, 5.0f); @@ -1589,8 +1593,13 @@ void CMenus::RenderSettingsSound(CUIRect MainView) float ButtonHeight = 20.0f; float Spacing = 2.0f; float BackgroundHeight = (float)(NumOptions+1)*ButtonHeight+(float)NumOptions*Spacing; + float TotalHeight = BackgroundHeight; + if(g_Config.m_SndEnable) + TotalHeight += 10.0f+2.0f*ButtonHeight+Spacing; MainView.HSplitTop(20.0f, 0, &MainView); + MainView.HSplitTop(TotalHeight, &MainView, &BottomView); + RenderTools()->DrawUIRect(&MainView, vec4(0.0f, 0.0f, 0.0f, ms_BackgroundAlpha), CUI::CORNER_ALL, 5.0f); MainView.HSplitTop(BackgroundHeight, &Sound, &MainView); RenderTools()->DrawUIRect(&Sound, vec4(0.0f, 0.0f, 0.0f, 0.25f), CUI::CORNER_ALL, 5.0f); @@ -1713,7 +1722,7 @@ void CMenus::RenderSettingsSound(CUIRect MainView) } // reset button - MainView.HSplitBottom(60.0f, 0, &BottomView); + BottomView.HSplitBottom(60.0f, 0, &BottomView); Spacing = 3.0f; float ButtonWidth = (BottomView.w/6.0f)-(Spacing*5.0)/6.0f;