changeset 2563:65c97624c047

Saving & loading works from both main menu and game
author a.parshin
date Tue, 19 May 2015 22:00:56 +0200
parents b8a56afc6ba1
children f9bdfe26d03d
files Engine/Engine.cpp Engine/SaveLoad.cpp Game/Game.cpp
diffstat 3 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Engine/Engine.cpp	Sun May 17 22:42:13 2015 +0600
+++ b/Engine/Engine.cpp	Tue May 19 22:00:56 2015 +0200
@@ -1825,6 +1825,11 @@
             else if (GetCurrentMenuID() == MENU_SAVELOAD)
             {
                 MainMenuLoad_Loop();
+                if (GetCurrentMenuID() == MENU_LoadingProcInMainMenu)
+                {
+                    uGameState = GAME_STATE_PLAYING;
+                    Game_Loop();
+                }
                 break;
             }
             else if (GetCurrentMenuID() == MENU_NEWGAME)
--- a/Engine/SaveLoad.cpp	Sun May 17 22:42:13 2015 +0600
+++ b/Engine/SaveLoad.cpp	Tue May 19 22:00:56 2015 +0200
@@ -179,11 +179,11 @@
     }
   }
 
-  if (pGUIWindow_CurrentMenu)
+  /*if (pGUIWindow_CurrentMenu)
   {
       pGUIWindow_CurrentMenu->Release();
       pGUIWindow_CurrentMenu = nullptr;
-  }
+  }*/
   current_screen_type = SCREEN_GAME;
 
   viewparams->bRedrawGameUI = true;
--- a/Game/Game.cpp	Sun May 17 22:42:13 2015 +0600
+++ b/Game/Game.cpp	Tue May 19 22:00:56 2015 +0200
@@ -2755,7 +2755,11 @@
                 uGameState = GAME_STATE_PLAYING;
                 continue;
             }
-            if ((signed int)uGameState <= GAME_STATE_5 || uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU)//GAME_STATE_NEWGAME_OUT_GAMEMENU, GAME_STATE_LOADING_GAME
+            //if ((signed int)uGameState <= GAME_STATE_5 || uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU)//GAME_STATE_NEWGAME_OUT_GAMEMENU, GAME_STATE_LOADING_GAME
+            if (uGameState == GAME_STATE_LOADING_GAME
+                || uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU
+                || uGameState == GAME_STATE_5
+                || uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU)
             {
                 game_finished = true;
                 continue;