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 6ece111..a4dca87 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 794174c..e99d26c 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);