From 53b3811a4d12faf0e448d0d269792ddc8ed1a72d Mon Sep 17 00:00:00 2001 From: Misa Date: Thu, 22 Apr 2021 16:19:20 -0700 Subject: [PATCH] Move graphic options menu update to toggleFullScreen This fixes a bug where using the fullscreen toggle keybind (Alt+Enter, Alt+F, or F11) wouldn't update the color of the "resize to nearest" menu option. The color doesn't functionally change anything - the option still won't work, and will still have the message telling you that you need to be in windowed mode when you move your menu selection to it - but it's an easy inconsistency to fix; just move the menu recreation in to Screen::toggleFullScreen() itself. --- desktop_version/src/Input.cpp | 4 ---- desktop_version/src/Screen.cpp | 7 +++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/desktop_version/src/Input.cpp b/desktop_version/src/Input.cpp index 3c713294..28d9529d 100644 --- a/desktop_version/src/Input.cpp +++ b/desktop_version/src/Input.cpp @@ -456,10 +456,6 @@ static void menuactionpress(void) case 0: music.playef(11); graphics.screenbuffer->toggleFullScreen(); - - // Recreate menu to update "resize to nearest" - game.createmenu(game.currentmenuname, true); - game.savestatsandsettings_menu(); break; case 1: diff --git a/desktop_version/src/Screen.cpp b/desktop_version/src/Screen.cpp index a232634e..654980b0 100644 --- a/desktop_version/src/Screen.cpp +++ b/desktop_version/src/Screen.cpp @@ -4,6 +4,7 @@ #include #include "FileSystemUtils.h" +#include "Game.h" #include "GraphicsUtil.h" // Used to create the window icon @@ -328,6 +329,12 @@ void Screen::toggleFullScreen(void) { isWindowed = !isWindowed; ResizeScreen(-1, -1); + + if (game.currentmenuname == Menu::graphicoptions) + { + /* Recreate menu to update "resize to nearest" */ + game.createmenu(game.currentmenuname, true); + } } void Screen::toggleStretchMode(void)