diff mm7_5.cpp @ 3:540178ef9b18

Main menu functionality
author Nomad
date Wed, 10 Oct 2012 19:10:15 +0200
parents 2ca04ccb612a
children 4acbadf78023
line wrap: on
line diff
--- a/mm7_5.cpp	Wed Oct 10 14:21:15 2012 +0200
+++ b/mm7_5.cpp	Wed Oct 10 19:10:15 2012 +0200
@@ -3426,6 +3426,37 @@
     do
     {
       pMessageQueue_50CBD0->PopMessage(&v45, (int *)uClass, &v46);
+      switch (v45)
+      {
+        case UIMSG_MainMenu_ShowPartyCreationWnd:
+        {
+          GUIWindow::Create(495, 172, 0, 0, WINDOW_5A, (int)pMainMenu_BtnNew, 0);
+          SetCurrentMenuID(MENU_NEWGAME);
+        }
+        continue;
+
+        case UIMSG_MainMenu_ShowLoadWindow:
+        {
+          GUIWindow::Create(495, 227, 0, 0, WINDOW_5A, (int)pMainMenu_BtnLoad, 0);
+          SetCurrentMenuID(MENU_SAVELOAD);
+        }
+        continue;
+
+        case UIMSG_ShowCredits:
+        {
+          GUIWindow::Create(495, 282, 0, 0, WINDOW_5A, (int)pMainMenu_BtnCredits, 0);
+          SetCurrentMenuID(MENU_CREDITS);
+        }
+        continue;
+
+        case UIMSG_ExitToWindows:
+        {
+          GUIWindow::Create(495, 337, 0, 0, WINDOW_5A, (int)pMainMenu_BtnExit, 0);
+          SetCurrentMenuID(MENU_FINISHED);
+        }
+        continue;
+      }
+
       if ( (signed int)v45 > 75 )
       {
         if ( v45 > UIMSG_A3 )
@@ -3886,30 +3917,6 @@
               pMouse->SetCursorBitmap("MICON2");
               break;
             default:
-              if ( v45 == 54 )
-              {
-                GUIWindow::Create(0x1EFu, 0xACu, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnNew, 0);
-                v2 = 1;
-                goto LABEL_90;
-              }
-              if ( v45 == 55 )
-              {
-                GUIWindow::Create(0x1EFu, 0xE3u, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnLoad, 0);
-                v40 = 3;
-                goto LABEL_89;
-              }
-              if ( v45 == 56 )
-              {
-                GUIWindow::Create(0x1EFu, 0x11Au, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnCredits, 0);
-                v40 = 2;
-                goto LABEL_89;
-              }
-              if ( v45 == UIMSG_ExitToWindows )
-              {
-                GUIWindow::Create(0x1EFu, 0x151u, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnExit, 0);
-                v40 = 4;
-                goto LABEL_89;
-              }
               if ( v45 == 58 )
                 goto LABEL_114;
               break;
@@ -14910,6 +14917,15 @@
     //v0 = (GUIWindow *)&pWindowList_at_506F50_minus1_indexing[21 * pVisibleWindowsIdxs[i]];
     v0 = &pWindowList[pVisibleWindowsIdxs[i] - 1];
     v1 = v0->eWindowType;
+
+    switch (v0->eWindowType)
+    {
+      case WINDOW_MainMenu_Load:
+        GameUI_MainMenu_DrawLoad();
+        continue;
+    }
+
+
     if ( (signed int)v1 > 70 )
     {
       if ( (signed int)v1 > 95 )
@@ -15268,8 +15284,8 @@
               v9 = v8 - 3;
               if ( v9 )
               {
-                if ( v9 == 1 )
-                  sub_4606F7();
+                //if ( v9 == 1 )
+                //  sub_4606F7();
               }
               else
               {