added returning directly to main menu from info sub-screens if needed
authorHolger Schemel <info@artsoft.org>
Mon, 12 Dec 2022 19:31:59 +0000 (20:31 +0100)
committerHolger Schemel <info@artsoft.org>
Mon, 12 Dec 2022 19:32:53 +0000 (20:32 +0100)
src/screens.c

index 394f52927f2b40a1c66251e8890a6ff367f87b89..c01d735611d6b5927e188e3661dcc4ba9da87c72 100644 (file)
@@ -318,6 +318,8 @@ static struct GadgetInfo *screen_gadget[NUM_SCREEN_GADGETS];
 static int info_mode = INFO_MODE_MAIN;
 static int setup_mode = SETUP_MODE_MAIN;
 
+static boolean info_screens_from_main = FALSE;
+
 static TreeInfo *window_sizes = NULL;
 static TreeInfo *window_size_current = NULL;
 
@@ -2537,6 +2539,18 @@ static void DrawInfoScreen_Main(void)
   int fade_mask = REDRAW_FIELD;
   int i;
 
+  // (needed after displaying info sub-screens directly from main menu)
+  if (info_screens_from_main)
+  {
+    info_screens_from_main = FALSE;
+
+    SetGameStatus(GAME_MODE_MAIN);
+
+    DrawMainMenu();
+
+    return;
+  }
+
   if (redraw_mask & REDRAW_ALL)
     fade_mask = REDRAW_ALL;
 
@@ -3856,6 +3870,7 @@ void DrawInfoScreen_FromMainMenu(int nr)
   SetGameStatus(GAME_MODE_INFO);
 
   info_mode = nr;;
+  info_screens_from_main = TRUE;
 
   FadeSetEnterScreen();