diff Engine/Engine.cpp @ 2553:48708da03b7f

Party Creation UI logic separated from MainMenu
author a.parshin
date Wed, 13 May 2015 02:20:05 +0200
parents ac16f4a3a91e
children f2a8ed07e921
line wrap: on
line diff
--- a/Engine/Engine.cpp	Wed May 13 01:33:20 2015 +0200
+++ b/Engine/Engine.cpp	Wed May 13 02:20:05 2015 +0200
@@ -1,76 +1,76 @@
-
-
 #define _CRTDBG_MAP_ALLOC
+#define _CRT_SECURE_NO_WARNINGS
 #include <stdlib.h>
 #include <crtdbg.h>
-
-#define _CRT_SECURE_NO_WARNINGS
+#include <direct.h>
 
 #include "Engine/Engine.h"
-
-#include "Arcomage\Arcomage.h"
-
+#include "Engine/Party.h"
+#include "Engine/Timer.h"
+#include "Engine/LOD.h"
+#include "Engine/Events.h"
+#include "Engine/OurMath.h"
+#include "Engine/texts.h"
+#include "Engine/stru123.h"
+#include "Engine/LuaVM.h"
+#include "Engine/MMT.h"
+#include "Engine/SaveLoad.h"
+#include "Engine/Registry.h"
 #include "Engine/Graphics/Vis.h"
 #include "Engine/Graphics/Weather.h"
 #include "Engine/Graphics/LightmapBuilder.h"
 #include "Engine/Graphics/DecalBuilder.h"
 #include "Engine/Graphics/ParticleEngine.h"
-#include "IO/Mouse.h"
-#include "IO/Keyboard.h"
 #include "Engine/Graphics/GammaControl.h"
-#include "stru6.h"
 #include "Engine/Graphics/stru9.h"
 #include "Engine/Graphics/stru10.h"
-
-#include "Engine/Party.h"
 #include "Engine/Graphics/Viewport.h"
-#include "Engine/Timer.h"
 #include "Engine/Graphics/Outdoor.h"
 #include "Engine/Graphics/Overlays.h"
-#include "Media/Audio/AudioPlayer.h"
-#include "Engine/LOD.h"
-#include "GUI/GUIWindow.h"
+#include "Engine/Graphics/Lights.h"
+#include "Engine/Graphics/Level/Decoration.h"
+#include "Engine/Graphics/PaletteManager.h"
+#include "Engine/Graphics/DecorationList.h"
+#include "Engine/Graphics/RenderD3D11.h"
+#include "Engine/Graphics/Sprites.h"
 #include "Engine/TurnEngine/TurnEngine.h"
-#include "Media/Video/Bink_Smacker.h"
-#include "Engine/Events.h"
-#include "Engine/OurMath.h"
-#include "Engine/texts.h"
-#include "GUI/GUIFont.h"
-#include "Engine/Graphics/Lights.h"
 #include "Engine/Spells/CastSpellInfo.h"
 #include "Engine/Tables/FrameTableInc.h"
 #include "Engine/Objects/Actor.h"
+#include "Engine/Objects/ObjectList.h"
+#include "Engine/Objects/SpriteObject.h"
+#include "Engine/Objects/Chest.h"
+
+#include "Arcomage\Arcomage.h"
+
+#include "IO/Mouse.h"
+#include "IO/Keyboard.h"
+
+#include "GUI/GUIWindow.h"
 #include "GUI/GUIProgressBar.h"
-#include "Engine/Objects/ObjectList.h"
-#include "Engine/Graphics/Level/Decoration.h"
-#include "Engine/Graphics/PaletteManager.h"
+#include "GUI/GUIFont.h"
+#include "GUI/UI/UIGame.h"
 #include "GUI/UI/UIHouses.h"
 #include "GUI/UI/UIShops.h"
 #include "GUI/UI/UIPartyCreation.h"
-#include "Engine/SaveLoad.h"
-#include "Engine/Objects/SpriteObject.h"
-#include "Engine/Graphics/Sprites.h"
-#include "Engine/Registry.h"
-#include "Engine/Objects/Chest.h"
-
-#include "GUI/UI/UIGame.h"
-
-#include "Engine/Graphics/DecorationList.h"
+
+#include "GUI/NewUI/MainMenu.h"
+
+#include "Media/Audio/AudioPlayer.h"
+#include "Media/Video/Bink_Smacker.h"
+
 #include "Engine/Tables/IconFrameTable.h"
 #include "Engine/Tables/PlayerFrameTable.h"
-#include "Engine/MapsLongTimer.h"
 #include "Engine/Tables/StorylineTextTable.h"
 #include "Engine/Tables/FactionTable.h"
-#include "Engine/stru123.h"
-#include "Engine/LuaVM.h"
-#include "Engine/Graphics/RenderD3D11.h"
-#include "Engine/MMT.h"
-#include "GUI/NewUI\MainMenu.h"
+#include "Engine/MapsLongTimer.h"
 
 #include "Game/Game.h"
 #include "Game/MainMenu.h"
-
-#include <direct.h>
+#include "Game/MainMenuLoad.h"
+#include "Game/CreateParty.h"
+
+#include "stru6.h"
 
 
 
@@ -1822,27 +1822,16 @@
                 pEngine->Deinitialize();
                 return true;
             }
-
-            if (GetCurrentMenuID() == MENU_NEWGAME)
+            else if (GetCurrentMenuID() == MENU_SAVELOAD)
             {
-                if (use_music_folder)
-                    alSourceStop(mSourceID);
-                else
-                {
-                    if (pAudioPlayer->hAILRedbook)
-                        AIL_redbook_stop(pAudioPlayer->hAILRedbook);
-                }
-                pParty->Reset();
-                pOtherOverlayList->Reset();
-                strcpy(pCurrentMapName, pStartingMapName);
-                pParty->CreateDefaultParty(0);
-                PlayerCreationUI_Initialize();
-                if (PlayerCreationUI_Loop())
-                {
-                    DeleteCCharFont();
+                MainMenuLoad_Loop();
+                break;
+            }
+            else if (GetCurrentMenuID() == MENU_NEWGAME)
+            {
+                if (!CreateParty_Loop())
                     break;
-                }
-                DeleteCCharFont();
+
                 bFlashQuestBook = true;
                 pMediaPlayer->PlayFullscreenMovie(MOVIE_Emerald, true);
                 SaveNewGame();