From 1c7f83f381088a683b7d22d9b548992e55fb0ba7 Mon Sep 17 00:00:00 2001 From: oy Date: Fri, 23 Oct 2015 09:24:43 +0200 Subject: [PATCH] update video modes in settings when screen changes --- src/game/client/components/menus_settings.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 6af2cf3d6..e7c2d13cd 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -1306,10 +1306,13 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView) // supported modes button MainView.HSplitTop(Spacing, 0, &MainView); MainView.HSplitTop(ButtonHeight, &Button, &MainView); + static int s_ActScreen = g_Config.m_GfxScreen; static int s_GfxDisplayAllModes = 0; - if(DoButton_CheckBox(&s_GfxDisplayAllModes, Localize("Show only supported"), g_Config.m_GfxDisplayAllModes^1, &Button)) + if(DoButton_CheckBox(&s_GfxDisplayAllModes, Localize("Show only supported"), g_Config.m_GfxDisplayAllModes^1, &Button) || (s_ActScreen != g_Config.m_GfxScreen)) { - g_Config.m_GfxDisplayAllModes ^= 1; + if(s_ActScreen == g_Config.m_GfxScreen) + g_Config.m_GfxDisplayAllModes ^= 1; + s_ActScreen = g_Config.m_GfxScreen; m_NumModes = Graphics()->GetVideoModes(m_aModes, MAX_RESOLUTIONS, g_Config.m_GfxScreen); UpdateVideoFormats();