Mercurial > mm7
diff Game/MainMenu.cpp @ 2558:5d6fb8eb023c
Слияние
author | Ritor1 |
---|---|
date | Wed, 13 May 2015 20:09:12 +0600 |
parents | 48708da03b7f |
children | f9bdfe26d03d |
line wrap: on
line diff
--- a/Game/MainMenu.cpp Wed May 13 20:09:00 2015 +0600 +++ b/Game/MainMenu.cpp Wed May 13 20:09:12 2015 +0600 @@ -17,6 +17,7 @@ #include "Media/Audio/AudioPlayer.h" #include "Game/MainMenu.h" +#include "Game/MainMenuLoad.h" RGBTexture main_menu_background; @@ -71,7 +72,7 @@ new OnButtonClick2(495, 337, 0, 0, (int)pMainMenu_BtnExit, 0); SetCurrentMenuID(MENU_EXIT_GAME); break; - case UIMSG_PlayerCreation_SelectAttribute: + /*case UIMSG_PlayerCreation_SelectAttribute: pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; uPlayerCreationUI_SelectedCharacter = pParam; @@ -183,17 +184,18 @@ uPlayerCreationUI_SelectedCharacter = pParam; pKeyActionMap->EnterText(0, 15, pGUIWindow_CurrentMenu); pGUIWindow_CurrentMenu->ptr_1C = v3; - break; + break;*/ case UIMSG_ChangeGameState: uGameState = GAME_FINISHED; break; case UIMSG_ChangeCursor: pMouse->SetCursorBitmap("MICON2"); break; - case UIMSG_3A: + case UIMSG_DebugBlv: + __debugbreak();//some debugging tool SetCurrentMenuID(MENU_DebugBLVLevel); break; - case UIMSG_LoadGame: + /*case UIMSG_LoadGame: if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot]) break; SetCurrentMenuID(MENU_LoadingProcInMainMenu); @@ -233,22 +235,24 @@ pSaveListPosition = 0; pWindow = pGUIWindow_CurrentMenu; new OnButtonClick2(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 323, 0, 0, (int)pBtnDownArrow, 0); - break; + break;*/ case UIMSG_Cancel: new OnCancel3(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, (int)pBtnCancel, 0); break; - case UIMSG_ArrowUp: + /*case UIMSG_ArrowUp: --pSaveListPosition; if (pSaveListPosition < 0) pSaveListPosition = 0; pWindow = pGUIWindow_CurrentMenu; new OnButtonClick2(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 197, 0, 0, (int)pBtnArrowUp, 0); - break; + break;*/ case UIMSG_AD: + __debugbreak();//some debugging tool new OnButtonClick2(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, (int)pMainMenu_BtnNew, 0); SetCurrentMenuID(MENU_LoadingProcInMainMenu); break; - case UIMSG_AE: + case UIMSG_DebugBlv2: + __debugbreak();//some debugging tool new OnButtonClick2(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, (int)pMainMenu_BtnExit, 0); SetCurrentMenuID(MENU_DebugBLVLevel); break; @@ -283,7 +287,7 @@ pMessageQueue_50CBD0->AddGUIMessage(UIMSG_ChangeGameState, 0, 0); break; } - if (GetCurrentMenuID() == MENU_CREDITSPROC && !current_screen_type) + if (GetCurrentMenuID() == MENU_CREDITSPROC && current_screen_type == SCREEN_GAME) { //if ( current_screen_type == SCREEN_VIDEO ) //pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag); @@ -300,7 +304,7 @@ pMessageQueue_50CBD0->AddGUIMessage(UIMSG_ChangeGameState, 0, 0); break; } - if (current_screen_type == SCREEN_LOADGAME) + /*if (current_screen_type == SCREEN_LOADGAME) { pIcons_LOD->RemoveTexturesPackFromTextureList(); //crt_deconstruct_ptr_6A0118(); @@ -315,7 +319,7 @@ current_screen_type = SCREEN_GAME; viewparams->bRedrawGameUI = v15; break; - } + }*/ if (current_screen_type == SCREEN_VIDEO) { //pVideoPlayer->Unload(); @@ -323,10 +327,17 @@ else { if (current_screen_type != SCREEN_1B) - { - pGUIWindow_CurrentMenu->Release(); - pGUIWindow2->Release(); - pGUIWindow2 = 0; + { // MENU_CREDITSCLOSE for example + if (pGUIWindow_CurrentMenu) + { + pGUIWindow_CurrentMenu->Release(); + pGUIWindow_CurrentMenu = nullptr; + } + if (pGUIWindow2) + { + pGUIWindow2->Release(); + pGUIWindow2 = 0; + } pEventTimer->Resume(); current_screen_type = SCREEN_GAME; viewparams->bRedrawGameUI = v15; @@ -368,12 +379,14 @@ SetCurrentMenuID(MENU_MAIN); SetForegroundWindow(window->GetApiHandle()); SendMessageW(window->GetApiHandle(), WM_ACTIVATEAPP, 1, 0); - while (GetCurrentMenuID() == MENU_MAIN || GetCurrentMenuID() == MENU_SAVELOAD) + + //while (GetCurrentMenuID() == MENU_MAIN || GetCurrentMenuID() == MENU_SAVELOAD) + while (GetCurrentMenuID() == MENU_MAIN) { POINT pt; pMouse->GetCursorPos(&pt); pWindow = pWindow_MainMenu; - if (GetCurrentMenuID() == MENU_SAVELOAD) + /*if (GetCurrentMenuID() == MENU_SAVELOAD) { if (current_screen_type != SCREEN_LOADGAME) { @@ -385,7 +398,7 @@ pGUIWindow_CurrentMenu = new GUIWindow_Load(false); } pWindow = pGUIWindow_CurrentMenu; - } + }*/ while (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE)) { @@ -417,11 +430,11 @@ pRenderer->EndScene(); pRenderer->Present(); main_menu_background.Release(); - if (pGUIWindow2) + /*if (pGUIWindow2) { pGUIWindow2->Release(); pGUIWindow2 = 0; - } + }*/ pWindow_MainMenu->Release(); pIcons_LOD->RemoveTexturesPackFromTextureList(); } \ No newline at end of file