diff Game/Game.cpp @ 2542:bacf9809126a

.
author a.parshin
date Sun, 10 May 2015 02:04:52 +0200
parents a902abdfc7f2
children b6140dfeac27
line wrap: on
line diff
--- a/Game/Game.cpp	Sun May 10 01:29:11 2015 +0200
+++ b/Game/Game.cpp	Sun May 10 02:04:52 2015 +0200
@@ -683,7 +683,7 @@
                 continue;
             case UIMSG_OpenQuestBook:
                 DoThatMessageThing();
-                if (current_screen_type)
+                if (current_screen_type != SCREEN_GAME)
                     pGUIWindow_CurrentMenu->Release();
                 pEventTimer->Pause();
                 pAudioPlayer->StopChannels(-1, -1);
@@ -693,7 +693,7 @@
                 continue;
             case UIMSG_OpenAutonotes:
                 DoThatMessageThing();
-                if (current_screen_type)
+                if (current_screen_type != SCREEN_GAME)
                     pGUIWindow_CurrentMenu->Release();
                 pEventTimer->Pause();
                 pAudioPlayer->StopChannels(-1, -1);
@@ -703,7 +703,7 @@
                 continue;
             case UIMSG_OpenMapBook:
                 DoThatMessageThing();
-                if (current_screen_type)
+                if (current_screen_type != SCREEN_GAME)
                     pGUIWindow_CurrentMenu->Release();
                 pEventTimer->Pause();
                 viewparams->sViewCenterX = pParty->vPosition.x;
@@ -714,7 +714,7 @@
                 continue;
             case UIMSG_OpenCalendar:
                 DoThatMessageThing();
-                if (current_screen_type)
+                if (current_screen_type != SCREEN_GAME)
                     pGUIWindow_CurrentMenu->Release();
                 pEventTimer->Pause();
                 pAudioPlayer->StopChannels(-1, -1);
@@ -723,7 +723,7 @@
                 continue;
             case UIMSG_OpenHistoryBook:
                 DoThatMessageThing();
-                if (current_screen_type)
+                if (current_screen_type != SCREEN_GAME)
                     pGUIWindow_CurrentMenu->Release();
                 pEventTimer->Pause();
                 pAudioPlayer->StopChannels(-1, -1);
@@ -763,7 +763,7 @@
                     pRenderer->ClearZBuffer(0, 479);
                     viewparams->bRedrawGameUI = 1;
                     viewparams->field_48 = 1;
-                    if (current_screen_type)
+                    if (current_screen_type != SCREEN_GAME)
                     {
                         if (current_screen_type > SCREEN_67)
                         {
@@ -1265,33 +1265,8 @@
                         if (!pIcons_LOD->uNumPrevLoadedFiles)
                             pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
 
-                        pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_OptionsButtons, 0, 0);
-                        uTextureID_Options = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE);
-                        uTextureID_New1 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE);
-                        uTextureID_Load1 = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE);
-                        uTextureID_Save1 = pIcons_LOD->LoadTexture("save1", TEXTURE_16BIT_PALETTE);
-                        uTextureID_Controls1 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE);
-                        uTextureID_Resume1 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE);
-                        uTextureID_Quit1 = pIcons_LOD->LoadTexture("quit1", TEXTURE_16BIT_PALETTE);
-                        pBtn_NewGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x9Bu, 0xD6u, 0x28u, 1, 0, UIMSG_StartNewGame, 0, 0x4Eu,
-                            pGlobalTXT_LocalizationStrings[614],// "New Game"
-                            pIcons_LOD->GetTexture(uTextureID_New1), 0);
-                        pBtn_SaveGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0xD1u, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenSaveGameDialog, 0, 0x53u,
-                            pGlobalTXT_LocalizationStrings[615],// "Save Game"
-                            pIcons_LOD->GetTexture(uTextureID_Save1), 0);
-                        pBtn_LoadGame = pGUIWindow_CurrentMenu->CreateButton(19, 263, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenLoadGameDialog, 0, 0x4Cu,
-                            pGlobalTXT_LocalizationStrings[616],// "Load Game"
-                            pIcons_LOD->GetTexture(uTextureID_Load1), 0);
-                        pBtn_GameControls = pGUIWindow_CurrentMenu->CreateButton(241, 155, 214, 40, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0x43u,
-                            pGlobalTXT_LocalizationStrings[617],// ""Sound, Keyboard, Game Options:""
-                            pIcons_LOD->GetTexture(uTextureID_Controls1), 0);
-                        pBtn_QuitGame = pGUIWindow_CurrentMenu->CreateButton(241, 209, 214, 40, 1, 0, UIMSG_Quit, 0, 0x51u,
-                            pGlobalTXT_LocalizationStrings[618],// "Quit"
-                            pIcons_LOD->GetTexture(uTextureID_Quit1), 0);
-                        pBtn_Resume = pGUIWindow_CurrentMenu->CreateButton(241, 263, 214, 40, 1, 0, UIMSG_GameMenu_ReturnToGame, 0, 0x52u,
-                            pGlobalTXT_LocalizationStrings[619],// "Return to Game"
-                            pIcons_LOD->GetTexture(uTextureID_Resume1), 0);
-                        pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(6, 1, 0, 0);
+                        pGUIWindow_CurrentMenu = GameMenuUI_Load();
+
                         viewparams->field_48 = 1;
 
                         stru_506E40.Release();
@@ -1310,6 +1285,7 @@
                 }
                 ModalWindow_Release();
                 continue;
+
             case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel
                 if (uMessageParam)
                 {
@@ -1334,6 +1310,7 @@
                 }
                 GameUI_DrawHiredNPCs();
                 continue;
+
             case UIMSG_TransitionUI_Confirm:
                 DoThatMessageThing();
                 dword_50CDC8 = 1;
@@ -1508,7 +1485,7 @@
                     pParty->vPosition.y = 22528;
                 DialogueEnding();
                 current_screen_type = SCREEN_GAME;
-                viewparams->bRedrawGameUI = 1;
+                viewparams->bRedrawGameUI = true;
                 continue;
             case UIMSG_CastSpell_Telekinesis:
                 //if ( pRenderer->pRenderD3D )
@@ -1642,6 +1619,7 @@
                     }
                 }
                 continue;
+
             case UIMSG_BF:
                 __debugbreak();
                 dword_50CDC8 = 1;