diff mm7_5.cpp @ 2:2ca04ccb612a

NoCD, main menu, various
author Nomad
date Wed, 10 Oct 2012 14:21:15 +0200
parents 8b8875f5b359
children 540178ef9b18
line wrap: on
line diff
--- a/mm7_5.cpp	Tue Oct 09 13:09:08 2012 +0200
+++ b/mm7_5.cpp	Wed Oct 10 14:21:15 2012 +0200
@@ -583,7 +583,7 @@
           uTextureID_507CB0 = pIcons_LOD->LoadTexture("option03", TEXTURE_16BIT_PALETTE);
           uTextureID_507CB8 = pIcons_LOD->LoadTexture("option02", TEXTURE_16BIT_PALETTE);
           uTextureID_507CB4 = pIcons_LOD->LoadTexture("option01", TEXTURE_16BIT_PALETTE);
-          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, WINDOW_Options, 0, 0);
+          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Options, 0, 0);
           pGUIWindow_CurrentMenu->CreateButton(
             0x16u,
             0x10Eu,
@@ -785,7 +785,7 @@
           uTextureID_507BFC = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE);
           uTextureID_507C00 = pIcons_LOD->LoadTexture("optkb_1", TEXTURE_16BIT_PALETTE);
           uTextureID_507C04 = pIcons_LOD->LoadTexture("optkb_2", TEXTURE_16BIT_PALETTE);
-          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, WINDOW_KeyMappingOptions, 0, 0);
+          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_KeyMappingOptions, 0, 0);
           pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, 0x71u, 0, 0, nullstring, 0);
           pGUIWindow_CurrentMenu->CreateButton(19u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, 0x1A0u, 0, 0, nullstring, 0);
           pGUIWindow_CurrentMenu->CreateButton(127u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, 0x1A1u, 0, 0, nullstring, 0);
@@ -891,7 +891,7 @@
           uTextureID_507C50 = pIcons_LOD->LoadTexture("opvdG-bs", TEXTURE_16BIT_PALETTE);
           uTextureID_507C54 = pIcons_LOD->LoadTexture("opvdG-cl", TEXTURE_16BIT_PALETTE);
           uTextureID_507C58 = pIcons_LOD->LoadTexture("opvdG-tn", TEXTURE_16BIT_PALETTE);
-          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, WINDOW_VideoOptions, 0, 0);
+          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_VideoOptions, 0, 0);
           pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, v0, 0, 0x71u, 0, 0, v1, 0);
           if ( pRenderer->pRenderD3D )
           {
@@ -1175,7 +1175,7 @@
             }
             goto LABEL_184;
           }
-          ModalWindow(pstr_722494, 0);
+          ModalWindow(pNPCTopics[453].pText, 0);
           goto _continue;
         case UIMSG_SkillUp|0x2:
           pGUIWindow_CurrentMenu->Release();
@@ -1225,7 +1225,7 @@
             pGUIWindow_CurrentMenu->Release();
           pEventTimer->Pause();
           pAudioPlayer->StopChannels(-1, -1);
-          v26 = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, WINDOW_Book, uMessage, 0);
+          v26 = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0);
           v27 = 354;
           v28 = 570;
           v170 = 0;
@@ -1241,7 +1241,7 @@
             pGUIWindow_CurrentMenu->Release();
           pEventTimer->Pause();
           pAudioPlayer->StopChannels(-1, -1);
-          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, WINDOW_Book, uMessage, 0);
+          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0);
           ptr_507BE0 = GUIWindow::Create(0x258u, 0x169u, 0, 0, (enum WindowType)99, (int)ptr_507A00, 0);
           bFlashHistoryBook = 0;
           goto _continue;
@@ -1588,7 +1588,7 @@
               uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = v0;
               if ( !pIcons_LOD->uNumPrevLoadedFiles )
                 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
-              pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, (enum WindowType)3, 0, 0);
+              pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)3, 0, 0);
               uTextureID_507944 = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE);
               uTextureID_507940 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE);
               uTextureID_50793C = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE);
@@ -2041,7 +2041,7 @@
 LABEL_438:
           v141 = (WindowType)9;
 LABEL_439:
-          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, v141, v148, v162);
+          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, v141, v148, v162);
           goto _continue;
         case UIMSG_B2:
           v165 = 0;
@@ -2468,7 +2468,7 @@
           if ( !uActiveCharacter
             || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
             goto LABEL_90;
-          ptr_507BC8 = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, (enum WindowType)104, uMessageParam, 0);
+          ptr_507BC8 = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)104, uMessageParam, 0);
           uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 25;
           pEventTimer->Pause();
           goto _continue;
@@ -2881,7 +2881,7 @@
                 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, (enum WindowType)90, (int)ptr_5079F8, 0);
                 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 8;
                 pEventTimer->Pause();
-                pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, (enum WindowType)18, 0, 0);
+                pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)18, 0, 0);
                 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
                 viewparams->field_48 = v0;
                 goto _continue;
@@ -2902,7 +2902,7 @@
           pEventTimer->Pause();
           pAudioPlayer->StopChannels(-1, -1);
           uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 104;
-          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, (enum WindowType)12, 5, 0);
+          pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)12, 5, 0);
           papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE);
           ptr_5076F4 = pGUIWindow_CurrentMenu->CreateButton(
                          0x187u,
@@ -2944,12 +2944,12 @@
             dword_50651C = -1;
           goto _continue;
         case UIMSG_A9:
-          GUIWindow::Create(ptr_507B9C->uX, ptr_507B9C->uY, 0, 0, WINDOW_HouseInterior|0x42, (int)ptr_507B9C, 0);
+          GUIWindow::Create(ptr_507B9C->uX, ptr_507B9C->uY, 0, 0, (WindowType)(WINDOW_HouseInterior|0x42), (int)ptr_507B9C, 0);
 LABEL_707:
           dword_506548 = v0;
           goto _continue;
         case UIMSG_AA:
-          GUIWindow::Create(ptr_507BA0->uX, ptr_507BA0->uY, 0, 0, WINDOW_HouseInterior|0x42, (int)ptr_507BA0, 0);
+          GUIWindow::Create(ptr_507BA0->uX, ptr_507BA0->uY, 0, 0, (WindowType)(WINDOW_HouseInterior|0x42), (int)ptr_507BA0, 0);
 LABEL_709:
           dword_506544 = v0;
           goto _continue;
@@ -3069,7 +3069,7 @@
             pCharacterScreen_AwardsBtn->uY,
             0,
             0,
-            WINDOW_HouseInterior|0x42,
+            (WindowType)(WINDOW_HouseInterior|0x42),
             (int)pCharacterScreen_AwardsBtn,
             0);
           sub_419100();
@@ -3371,7 +3371,7 @@
 //----- (00435748) --------------------------------------------------------
 void __cdecl GUI_MainMenuMessageProc()
 {
-  AudioPlayer *v0; // ebp@2
+  //AudioPlayer *v0; // ebp@2
   char *v1; // ebx@2
   unsigned int v2; // ecx@18
   void *v3; // edi@21
@@ -3421,7 +3421,7 @@
 
   if ( pMessageQueue_50CBD0->uNumMessages )
   {
-    v0 = pAudioPlayer;
+    //v0 = pAudioPlayer;
     v1 = (char *)pParty->pPlayers;
     do
     {
@@ -3521,7 +3521,7 @@
               (enum WindowType)92,
               (int)pCreationUI_BtnPressLeft[v25],
               1);
-            v0 = pAudioPlayer;
+            //v0 = pAudioPlayer;
             pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0);
             v22 = (Player *)v23;
             goto LABEL_117;
@@ -3550,7 +3550,7 @@
               (enum WindowType)92,
               (int)pCreationUI_BtnPressRight[v21],
               1);
-            v0 = pAudioPlayer;
+            //v0 = pAudioPlayer;
             pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0);
             v22 = (Player *)v19;
 LABEL_117:
@@ -3904,7 +3904,7 @@
                 v40 = 2;
                 goto LABEL_89;
               }
-              if ( v45 == 57 )
+              if ( v45 == UIMSG_ExitToWindows )
               {
                 GUIWindow::Create(0x1EFu, 0x151u, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnExit, 0);
                 v40 = 4;
@@ -14245,7 +14245,7 @@
   v3 = a4;
   pEventTimer->Pause();
   dword_506F0C[0] = uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions;
-  result = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, WINDOW_FinalWindow, v3, (int)v2);
+  result = GUIWindow::Create(0, 0, 640, 480, WINDOW_FinalWindow, v3, (int)v2);
   ptr_507BDC = result;
   uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 22;
   return result;
@@ -14903,12 +14903,13 @@
   GUIButton Dst; // [sp+28h] [bp-E0h]@133
   ItemGen v51; // [sp+E4h] [bp-24h]@129
 
-  if ( GetCurrentMenuID() != 6 )
-    sub_41CD4F(0x22u);
+  if (GetCurrentMenuID() != MENU_CREATEPARTY)
+    sub_41CD4F(34);
   for ( i = 1; i <= uNumVisibleWindows; ++i )
   {
-    v0 = (GUIWindow *)&pWindowList_at_506F50_minus1_indexing[21 * pVisibleWindowsIdxs[i]];
-    v1 = v0->uWindowType;
+    //v0 = (GUIWindow *)&pWindowList_at_506F50_minus1_indexing[21 * pVisibleWindowsIdxs[i]];
+    v0 = &pWindowList[pVisibleWindowsIdxs[i] - 1];
+    v1 = v0->eWindowType;
     if ( (signed int)v1 > 70 )
     {
       if ( (signed int)v1 > 95 )
@@ -15889,7 +15890,7 @@
       if ( v5 )
       {
         if ( a2 == 57 )
-          v7 = (const CHAR *)dword_72266C;
+          v7 = pNPCTopics[512].pText;
         else
           v7 = (const CHAR *)*(&pNPCStats->field_13A5C + 5 * v5->uProfession);
         lpsz = v7;
@@ -16406,7 +16407,8 @@
       return;
     while ( 1 )
     {
-      v8 = (GUIWindow *)&pWindowList_at_506F50_minus1_indexing[21 * pVisibleWindowsIdxs[v7]];
+      //v8 = (GUIWindow *)&pWindowList_at_506F50_minus1_indexing[21 * pVisibleWindowsIdxs[v7]];
+      v8 = &pWindowList[pVisibleWindowsIdxs[v7] - 1];
       if ( x >= (signed int)v8->uFrameX )
       {
         if ( x <= (signed int)v8->uFrameZ && y >= (signed int)v8->uFrameY && y <= (signed int)v8->uFrameW )
@@ -16516,7 +16518,7 @@
 {
   if ( pArcomageGame->bGameInProgress == 1 )
   {
-    if ( pAsyncMouse )
+    if (pAsyncMouse)
       pArcomageGame->stru1.field_0 = 7;
   }
 }
@@ -16526,7 +16528,7 @@
 {
   if ( pArcomageGame->bGameInProgress == 1 )
   {
-    if ( pAsyncMouse )
+    if (pAsyncMouse)
       pArcomageGame->stru1.field_0 = 8;
   }
 }