added storing last game mode when setting new game mode
authorHolger Schemel <info@artsoft.org>
Mon, 19 Dec 2016 20:57:34 +0000 (21:57 +0100)
committerHolger Schemel <info@artsoft.org>
Mon, 19 Dec 2016 23:59:21 +0000 (00:59 +0100)
src/screens.c
src/tools.c

index 6ece1110727fd797d8743884607b9a33c298c6d7..a4dca87a5fb8ae6e5ada6a16496f7d94db3346a1 100644 (file)
@@ -1452,8 +1452,6 @@ void DrawMainMenu()
 
   if (CheckTitleScreen(levelset_has_changed))
   {
-    game_status_last_screen = GAME_MODE_MAIN;
-
     SetGameStatus(GAME_MODE_TITLE);
 
     DrawTitleScreen();
@@ -1602,6 +1600,9 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
        /* switch game mode from title screen mode back to info screen mode */
        SetGameStatus(GAME_MODE_INFO);
 
+       /* store that last screen was info screen, not main menu screen */
+       game_status_last_screen = GAME_MODE_INFO;
+
        DrawInfoScreen_NotAvailable("Title screen information:",
                                    "No title screen for this level set.");
        return;
@@ -2678,8 +2679,6 @@ void DrawInfoScreen_HelpText(int element, int action, int direction, int ypos)
 
 void DrawInfoScreen_TitleScreen()
 {
-  game_status_last_screen = GAME_MODE_INFO;
-
   SetGameStatus(GAME_MODE_TITLE);
 
   DrawTitleScreen();
index 794174c1d1ccbe0ccf34b87a474b9fb59d596c4e..e99d26ce169ad18c33f601c674a684d6165ff0d6 100644 (file)
@@ -8507,6 +8507,9 @@ void SetAnimStatus(int anim_status_new)
 
 void SetGameStatus(int game_status_new)
 {
+  if (game_status_new != game_status)
+    game_status_last_screen = game_status;
+
   game_status = game_status_new;
 
   SetAnimStatus(game_status_new);