diff mm7_5.cpp @ 2:89240115d392

MainMenuBtn(work)
author Ritor1
date Sun, 13 Jan 2013 01:47:51 +0600
parents 98b091cbabf7
children bf31c505f4d3
line wrap: on
line diff
--- a/mm7_5.cpp	Sat Jan 12 11:30:46 2013 +0600
+++ b/mm7_5.cpp	Sun Jan 13 01:47:51 2013 +0600
@@ -456,45 +456,45 @@
           v148 = 0;
           pWindowType = (WindowType)8;
           goto LABEL_439;
-        case UIMSG_A2:
-          --dword_6A0C9C;
-          if ( dword_6A0C9C < 0 )
-            dword_6A0C9C = 0;
+        case UIMSG_ArrowUp:
+          --pSaveListPosition;
+          if ( pSaveListPosition < 0 )
+            pSaveListPosition = 0;
           v163 = 0;
           v8 = 199;
-          pButton2 = ptr_69BD5C;
+          pButton2 = pBtnArrowUp;
           //goto LABEL_60;
-		  pWindowType1 = (WindowType)90;
+          pWindowType1 = (WindowType)90;
           v137 = 17;
           v133 = 17;
           v9 = 215;
           goto LABEL_733;
-        case UIMSG_A3:
-          ++dword_6A0C9C;
-          if ( dword_6A0C9C >= uMessageParam )
-            dword_6A0C9C = uMessageParam - 1;
+        case UIMSG_DownArrow:
+          ++pSaveListPosition;
+          if ( pSaveListPosition >= uMessageParam )
+            pSaveListPosition = uMessageParam - 1;
           v163 = 0;
           v8 = 323;
-          pButton2 = ptr_69BD58;
+          pButton2 = pBtnDownArrow;
 //LABEL_60:
           pWindowType1 = (WindowType)90;
           v137 = 17;
           v133 = 17;
           v9 = 215;
           goto LABEL_733;
-        case UIMSG_A6:
+        case UIMSG_Cancel:
           v163 = 0;
           v8 = 302;
-          pButton2 = ptr_69BD60;
+          pButton2 = pBtnCancel;
           v9 = 350;
           pWindowType1 = (WindowType)96;
           v137 = 42;
           v133 = 106;
           goto LABEL_733;
-        case UIMSG_A4:
+        case UIMSG_LoadSlot:
           v163 = 0;
           v8 = 302;
-          pButton2 = ptr_69BD64;
+          pButton2 = pBtnLoadSlot;
           v9 = 241;
           pWindowType1 = (WindowType)94;
           v137 = 42;
@@ -503,10 +503,10 @@
         case UIMSG_A5:
           if ( pGUIWindow_CurrentMenu->field_40 == v0 )
             pKeyActionMap->_459ED1(0);
-          if ( pCurrentScreen != 11 || uLoadGameUI_SelectedSlot != dword_6A0C9C + uMessageParam )
-          {
-            v10 = dword_6A0C9C + uMessageParam;
-            if ( dword_6BE138 == dword_6A0C9C + uMessageParam )
+          if ( pCurrentScreen != 11 || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam )
+          {
+            v10 = pSaveListPosition + uMessageParam;
+            if ( dword_6BE138 == pSaveListPosition + uMessageParam )
             {
               if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
               {
@@ -3081,7 +3081,7 @@
 void __cdecl GUI_MainMenuMessageProc()
 {
   //AudioPlayer *v0; // ebp@2
-  char *v1; // ebx@2
+  //Player *pPlayer1; // ebx@2
   unsigned int v2; // ecx@18
   void *v3; // edi@21
   signed int v4; // eax@29
@@ -3128,38 +3128,38 @@
   if ( pMessageQueue_50CBD0->uNumMessages )
   {
     //v0 = pAudioPlayer;
-    v1 = (char *)pParty->pPlayers;
-	pPlayer = pParty->pPlayers;
+    //pPlayer1 = pParty->pPlayers;
+    pPlayer = pParty->pPlayers;
     do
     {
       pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &uNum, &pSex);
-      switch (pUIMessageType)
-      {
-        case UIMSG_MainMenu_ShowPartyCreationWnd:
+      switch (pUIMessageType) //создание окон из главного меню
+      {
+        case UIMSG_MainMenu_ShowPartyCreationWnd:// Окно создания группы
         {
           GUIWindow::Create(495, 172, 0, 0, WINDOW_5A, (int)pMainMenu_BtnNew, 0);
           SetCurrentMenuID(MENU_NEWGAME);
         }
         continue;
-        case UIMSG_MainMenu_ShowLoadWindow:
+        case UIMSG_MainMenu_ShowLoadWindow:// Окно Загрузка
         {
           GUIWindow::Create(495, 227, 0, 0, WINDOW_5A, (int)pMainMenu_BtnLoad, 0);
           SetCurrentMenuID(MENU_SAVELOAD);
         }
         continue;
-        case UIMSG_ShowCredits:
+        case UIMSG_ShowCredits:// Окно Создатели
         {
           GUIWindow::Create(495, 282, 0, 0, WINDOW_5A, (int)pMainMenu_BtnCredits, 0);
           SetCurrentMenuID(MENU_CREDITS);
         }
         continue;
-        case UIMSG_ExitToWindows:
+        case UIMSG_ExitToWindows:// Окно Выход
         {
           GUIWindow::Create(495, 337, 0, 0, WINDOW_5A, (int)pMainMenu_BtnExit, 0);
           SetCurrentMenuID(MENU_FINISHED);
         }
         continue;
-        case UIMSG_LoadGame:
+        case UIMSG_LoadGame:// Процесс загрузки
         {
           if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot])
             continue;
@@ -3174,13 +3174,13 @@
             //main menu save/load wnd   clicking on savegame lines
           if (pGUIWindow_CurrentMenu->field_40 == 1)
             pKeyActionMap->_459ED1(0);
-          if ( pCurrentScreen != 11 || uLoadGameUI_SelectedSlot != uNum + dword_6A0C9C )
+          if ( pCurrentScreen != 11 || uLoadGameUI_SelectedSlot != uNum + pSaveListPosition )
           {
             //load clicked line
-              v26 = uNum + dword_6A0C9C;
-              if ( dword_6BE138 == uNum + dword_6A0C9C )
+              v26 = uNum + pSaveListPosition;
+              if ( dword_6BE138 == uNum + pSaveListPosition )
               {
-                pMessageQueue_50CBD0->SendMessage(UIMSG_A4, 0, 0);
+                pMessageQueue_50CBD0->SendMessage(UIMSG_LoadSlot, 0, 0);
                 pMessageQueue_50CBD0->SendMessage(UIMSG_LoadGame, 0, 0);
               }
               uLoadGameUI_SelectedSlot = v26;
@@ -3195,19 +3195,19 @@
           }
         }
         continue;
-        case UIMSG_A4:
-        {
-          GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_5E, (int)ptr_69BD64, 0);
+        case UIMSG_LoadSlot: // Нажатие на слот в окне Загрузка
+        {
+          GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_5E, (int)pBtnLoadSlot, 0);
         }
         continue;
       }
       if ( (signed int)pUIMessageType > UIMSG_PlayerCreationRemoveDownSkill )
       {
-        if ( pUIMessageType > UIMSG_A3 )
-        {
-          if ( pUIMessageType == UIMSG_A6 )
-          {
-            GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, (WindowType)95, (int)ptr_69BD60, 0);
+        if ( pUIMessageType > UIMSG_DownArrow )
+        {
+          if ( pUIMessageType == UIMSG_Cancel )// Нажатие кнопки Отмена
+          {
+            GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, (WindowType)95, (int)pBtnCancel, 0);
             continue;
           }
           if ( pUIMessageType == UIMSG_SelectFacePlayerBack )
@@ -3231,13 +3231,13 @@
             pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0.0, 0);
             v22 = pPlayer;
             v22->PlaySound(102, 0);
-            v1 = (char *)pParty->pPlayers;
+            //v1 = (char *)pParty->pPlayers;
             continue;
           }
           if ( pUIMessageType == UIMSG_SelectFacePlayerForward )
           {
             pPlayer = &pParty->pPlayers[uNum];
-			v20 = (char)((int)pPlayer->uFace + 1) % 20;
+            v20 = (char)((int)pPlayer->uFace + 1) % 20;
             pPlayer->uFace = v20;
             pPlayer->uVoiceID = v20;
             pPlayer->SetInitialStats();
@@ -3248,12 +3248,12 @@
                                                       % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
             uPlayerCreationUI_SelectedCharacter = v21;
             GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, (enum WindowType)92,
-			  (int)pCreationUI_BtnPressRight[v21], 1);
+            (int)pCreationUI_BtnPressRight[v21], 1);
             //v0 = pAudioPlayer;
             pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0);
             v22 = pPlayer;
             v22->PlaySound(102, 0);
-            v1 = (char *)pParty->pPlayers;
+            //v1 = (char *)pParty->pPlayers;
             continue;
           }
           if ( pUIMessageType == UIMSG_AD )
@@ -3265,25 +3265,24 @@
           if ( pUIMessageType != UIMSG_AE )
             continue;
           GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnExit, 0);
-LABEL_114:
+//LABEL_114:
           v40 = 10;
-LABEL_89:
+//LABEL_89:
           v2 = v40;
           SetCurrentMenuID((MENU_STATE)v2);
           continue;
         }
-        if ( pUIMessageType == UIMSG_A3 )
-        {
-          ++dword_6A0C9C;
-          if ( dword_6A0C9C >= uNum )
-            dword_6A0C9C = uNum - 1;
-          if ( dword_6A0C9C < 1 )
-            dword_6A0C9C = 0;
+        if ( pUIMessageType == UIMSG_DownArrow )//нажатие стрелки вниз
+        {
+          ++pSaveListPosition;
+          if ( pSaveListPosition >= uNum )
+            pSaveListPosition = uNum - 1;
+          if ( pSaveListPosition < 1 )
+            pSaveListPosition = 0;
           pWindow = pGUIWindow_CurrentMenu;
-          v43 = 0;
-          v39 = (int)ptr_69BD58;
           v8 = pGUIWindow_CurrentMenu->uFrameY + 323;
-          goto LABEL_105;
+          GUIWindow::Create(pWindow->uFrameX + 215, v8, 0, 0, (WindowType)90, (int)pBtnDownArrow, 0);
+          continue;
         }
         if ( pUIMessageType == UIMSG_6B )
         {
@@ -3326,12 +3325,18 @@
             if (GetCurrentMenuID() == MENU_7)
             {
               v40 = 6;
-              goto LABEL_89;
+              //goto LABEL_89;
+              v2 = v40;
+              SetCurrentMenuID((MENU_STATE)v2);
+              continue;
             }
             if (GetCurrentMenuID() == MENU_Credits)
             {
               v40 = 11;
-              goto LABEL_89;
+              //goto LABEL_89;
+              v2 = v40;
+              SetCurrentMenuID((MENU_STATE)v2);
+              continue;
             }
             if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
             {
@@ -3356,7 +3361,7 @@
             pTexture_PCX.Load("title.pcx", 0);
             SetCurrentMenuID(MENU_MAIN);
             v15 = 1;
-LABEL_81:
+//LABEL_81:
             pGUIWindow_CurrentMenu->Release();
             pGUIWindow2->Release();
             pGUIWindow2 = 0;
@@ -3372,7 +3377,16 @@
           else
           {
             if ( pCurrentScreen != 27 )
-              goto LABEL_81;
+              //goto LABEL_81;
+            {
+              pGUIWindow_CurrentMenu->Release();
+              pGUIWindow2->Release();
+              pGUIWindow2 = 0;
+              pEventTimer->Resume();
+              pCurrentScreen = 0;
+              viewparams->bRedrawGameUI = v15;
+              continue;
+            }
             //VideoPlayer::dtor();
           }
         }
@@ -3420,17 +3434,14 @@
             pCurrentPlayer->PlaySound(102, 0);
             continue;
           }
-          if ( pUIMessageType == UIMSG_A2 )
-          {
-            --dword_6A0C9C;
-            if ( dword_6A0C9C < 0 )
-              dword_6A0C9C = 0;
+          if ( pUIMessageType == UIMSG_ArrowUp )// Кнопка Вверх
+          {
+            --pSaveListPosition;
+            if ( pSaveListPosition < 0 )
+              pSaveListPosition = 0;
             pWindow = pGUIWindow_CurrentMenu;
-            v43 = 0;
-            v39 = (int)ptr_69BD5C;
             v8 = pGUIWindow_CurrentMenu->uFrameY + 197;
-LABEL_105:
-            GUIWindow::Create(pWindow->uFrameX + 215, v8, 0, 0, (WindowType)90, v39, v43);
+            GUIWindow::Create(pWindow->uFrameX + 215, v8, 0, 0, (WindowType)90, (int)pBtnArrowUp, 0);
             continue;
           }
         }
@@ -3441,7 +3452,7 @@
         {
           uPlayerCreationUI_SelectedCharacter = uNum;
           v41 = 3;
-          v1 = (char *)pParty->pPlayers;
+          //v1 = (char *)pParty->pPlayers;
           v5 = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7
              + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
           pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5;
@@ -3531,7 +3542,13 @@
               break;
             default:
               if ( pUIMessageType == 58 )
-                goto LABEL_114;
+                //goto LABEL_114;
+              {
+                v40 = 10;
+                v2 = v40;
+                SetCurrentMenuID((MENU_STATE)v2);
+                continue;
+              }
               break;
           }
         }