diff mm7_6.cpp @ 832:dfd683c4f538

Hotkeys fixed Moved GUIButton.h to GUIWindow.h
author Nomad
date Wed, 27 Mar 2013 19:50:37 +0200
parents 08d90b633131
children ceef50611567 710cf848ad24
line wrap: on
line diff
--- a/mm7_6.cpp	Wed Mar 27 15:04:59 2013 +0200
+++ b/mm7_6.cpp	Wed Mar 27 19:50:37 2013 +0200
@@ -4,7 +4,6 @@
 #include "Game.h"
 #include "GUIWindow.h"
 #include "GUIFont.h"
-#include "GUIButton.h"
 #include "GUIProgressBar.h"
 #include "Party.h"
 #include "AudioPlayer.h"
@@ -2094,19 +2093,19 @@
   unsigned int v14; // eax@23
   //stru277 *v15; // esi@27
   //stru277 *v16; // eax@28
-  GUIWindow *v17; // eax@43
-  GUIWindow *v18; // [sp-30h] [bp-48h]@44
-  unsigned int v19; // [sp-2Ch] [bp-44h]@44
-  unsigned int v20; // [sp-28h] [bp-40h]@44
-  unsigned int v21; // [sp-24h] [bp-3Ch]@44
-  unsigned int v22; // [sp-20h] [bp-38h]@44
-  int v23; // [sp-1Ch] [bp-34h]@44
-  int v24; // [sp-18h] [bp-30h]@44
-  unsigned int v25; // [sp-14h] [bp-2Ch]@43
-  unsigned int v26; // [sp-10h] [bp-28h]@43
-  unsigned __int8 v27; // [sp-Ch] [bp-24h]@43
-  char *v28; // [sp-8h] [bp-20h]@43
-  Texture *v29; // [sp-4h] [bp-1Ch]@43
+  //GUIWindow *v17; // eax@43
+  //GUIWindow *v18; // [sp-30h] [bp-48h]@44
+  //unsigned int v19; // [sp-2Ch] [bp-44h]@44
+  //unsigned int v20; // [sp-28h] [bp-40h]@44
+  //unsigned int v21; // [sp-24h] [bp-3Ch]@44
+  //unsigned int v22; // [sp-20h] [bp-38h]@44
+  //int v23; // [sp-1Ch] [bp-34h]@44
+  //int v24; // [sp-18h] [bp-30h]@44
+  //unsigned int v25; // [sp-14h] [bp-2Ch]@43
+  //unsigned int v26; // [sp-10h] [bp-28h]@43
+  //unsigned __int8 v27; // [sp-Ch] [bp-24h]@43
+  //char *v28; // [sp-8h] [bp-20h]@43
+  //Texture *v29; // [sp-4h] [bp-1Ch]@43
   //__int16 a3a; // [sp+10h] [bp-8h]@1
   //__int16 a2a; // [sp+14h] [bp-4h]@1
 
@@ -2288,10 +2287,10 @@
         if ( pGUIWindow_Settings )
           return;
         pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0);
-        pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 0, 0x31u, "", 0);
-        pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 1u, 0x32u, "", 0);
-        pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 2u, 0x33u, "", 0);
-        pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 3u, 0x34u, "", 0);
+        pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_45, 0, 0x31u, "", 0);
+        pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_45, 1u, 0x32u, "", 0);
+        pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_45, 2u, 0x33u, "", 0);
+        pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_45, 3u, 0x34u, "", 0);
         sub_421B2C_PlaceInInventory_or_DropPickedItem();
         return;
       }
@@ -2299,23 +2298,9 @@
       {
         if ( pGUIWindow_Settings )
           return;
-        v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0);
-        v29 = 0;
-        v28 = "";
-        v27 = 0;
-        v26 = 0;
-        v25 = 70;
-LABEL_44:
-        v24 = 0;
-        v23 = 1;
-        v22 = 344;
-        v21 = game_viewport_width;
-        v20 = 8;
-        v19 = 8;
-        pGUIWindow_Settings = v17;
-        v18 = v17;
-LABEL_56:
-        v18->CreateButton(v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29);
+
+        pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0);
+        pGUIWindow_Settings->CreateButton(game_viewport_x, game_viewport_y, game_viewport_width, game_viewport_height, 1, 0, UIMSG_46, 0, 0, "", 0);
         sub_421B2C_PlaceInInventory_or_DropPickedItem();
         return;
       }
@@ -2323,13 +2308,11 @@
       {
         if ( pGUIWindow_Settings )
           return;
-        v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0);
-        v29 = 0;
-        v28 = "";
-        v27 = 0;
-        v26 = 0;
-        v25 = 190;
-        goto LABEL_44;
+
+        pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0);
+        pGUIWindow_Settings->CreateButton(game_viewport_x, game_viewport_y, game_viewport_width, game_viewport_height, 1, 0, UIMSG_BE, 0, 0, "", 0);
+        sub_421B2C_PlaceInInventory_or_DropPickedItem();
+        return;
       }
       if ( (char)a5 < 0 )
       {
@@ -2349,44 +2332,36 @@
         if ( pGUIWindow_Settings )
           return;
         pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0);
-        pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 0, 0x31u, "", 0);
-        pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 1u, 0x32u, "", 0);
-        pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 2u, 0x33u, "", 0);
-        pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 3u, 0x34u, "", 0);
-		pGUIWindow_Settings->CreateButton(8, 8, game_viewport_width, 344, 1, 0, 140, 0, 0, "", NULL);
+        pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_8D, 0, 0x31u, "", 0);
+        pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_8D, 1, 0x32u, "", 0);
+        pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_8D, 2, 0x33u, "", 0);
+        pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_8D, 3, 0x34u, "", 0);
+		pGUIWindow_Settings->CreateButton(8, 8, game_viewport_width, game_viewport_height, 1, 0, UIMSG_8C, 0, 0, "", NULL);
 		sub_421B2C_PlaceInInventory_or_DropPickedItem();
       }
       if ( HIBYTE(a5) & 2 && !pGUIWindow_Settings )
       {
         pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0);
-        pBtn_NPCLeft = pGUIWindow_Settings->CreateButton(
-                       0x1D5u,
-                       0xB2u,
-                       (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24),
-                       (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26),
+        pBtn_NPCLeft = pGUIWindow_Settings->CreateButton(469, 178,
+                       pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureWidth,
+                       pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureHeight,
                        1,
                        0,
-                       0xBCu,
-                       0,
+                       UIMSG_ScrollNPCPanel, 0,
                        0,
                        "",
-                       (Texture *)(uTextureID_Btn_NPCLeft != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft] : 0),
-                       0);
-        pBtn_NPCRight = pGUIWindow_Settings->CreateButton(
-                       0x272u,
-                       0xB2u,
-                       (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureWidth : 24),
-                       (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26),
+                       pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft), 0);
+        pBtn_NPCRight = pGUIWindow_Settings->CreateButton(626, 178,
+                       pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureWidth,
+                       pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureHeight,
                        1,
                        0,
-                       0xBCu,
-                       1u,
+                       UIMSG_ScrollNPCPanel, 1,
                        0,
                        "",
-                       (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0),
-                       0);
-        pGUIWindow_Settings->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 4u, 0x35u, "", 0);
-        pGUIWindow_Settings->CreateButton(0x231u, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 5u, 0x36u, "", 0);
+                       pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight), 0);
+        pGUIWindow_Settings->CreateButton(0x1EBu, 149, 64, 74, 1, 0, UIMSG_8F, 4, 0x35u, "", 0);
+        pGUIWindow_Settings->CreateButton(0x231u, 149, 64, 74, 1, 0, UIMSG_8F, 5, 0x36u, "", 0);
       }
     }
 }
@@ -8536,7 +8511,7 @@
 void __cdecl ProcessInputActions()
 {
   ActionQueue *pActionQueue; // esi@7
-  Keyboard *v3; // ecx@8
+  //Keyboard *v3; // ecx@8
   char v4; // al@9
   ActionQueue *v5; // ecx@19
   Player *v6; // ecx@86
@@ -8584,12 +8559,11 @@
     pActionQueue = pPartyActionQueue;
     while ( 1 )
     {
-      v3 = pGame->pKeyboardInstance;
       v17 = pKeyActionMap->pVirtualKeyCodesMapping[inputAction];
       if ( pKeyActionMap->pToggleTypes[inputAction] )
-        v4 = v3->WasKeyPressed(v17);
+        v4 = pKeyboard->WasKeyPressed(v17);
       else
-        v4 = v3->IsKeyBeingHeld(v17);
+        v4 = pKeyboard->IsKeyBeingHeld(v17);
       if ( v4 )
       {
         switch ( inputAction )