Mercurial > mm7
comparison 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 |
comparison
equal
deleted
inserted
replaced
831:9c3f28b31b4a | 832:dfd683c4f538 |
---|---|
2 | 2 |
3 #include "MapInfo.h" | 3 #include "MapInfo.h" |
4 #include "Game.h" | 4 #include "Game.h" |
5 #include "GUIWindow.h" | 5 #include "GUIWindow.h" |
6 #include "GUIFont.h" | 6 #include "GUIFont.h" |
7 #include "GUIButton.h" | |
8 #include "GUIProgressBar.h" | 7 #include "GUIProgressBar.h" |
9 #include "Party.h" | 8 #include "Party.h" |
10 #include "AudioPlayer.h" | 9 #include "AudioPlayer.h" |
11 #include "Outdoor.h" | 10 #include "Outdoor.h" |
12 #include "IndoorCamera.h" | 11 #include "IndoorCamera.h" |
2092 unsigned __int8 v12; // of@18 | 2091 unsigned __int8 v12; // of@18 |
2093 unsigned __int16 v13; // cx@21 | 2092 unsigned __int16 v13; // cx@21 |
2094 unsigned int v14; // eax@23 | 2093 unsigned int v14; // eax@23 |
2095 //stru277 *v15; // esi@27 | 2094 //stru277 *v15; // esi@27 |
2096 //stru277 *v16; // eax@28 | 2095 //stru277 *v16; // eax@28 |
2097 GUIWindow *v17; // eax@43 | 2096 //GUIWindow *v17; // eax@43 |
2098 GUIWindow *v18; // [sp-30h] [bp-48h]@44 | 2097 //GUIWindow *v18; // [sp-30h] [bp-48h]@44 |
2099 unsigned int v19; // [sp-2Ch] [bp-44h]@44 | 2098 //unsigned int v19; // [sp-2Ch] [bp-44h]@44 |
2100 unsigned int v20; // [sp-28h] [bp-40h]@44 | 2099 //unsigned int v20; // [sp-28h] [bp-40h]@44 |
2101 unsigned int v21; // [sp-24h] [bp-3Ch]@44 | 2100 //unsigned int v21; // [sp-24h] [bp-3Ch]@44 |
2102 unsigned int v22; // [sp-20h] [bp-38h]@44 | 2101 //unsigned int v22; // [sp-20h] [bp-38h]@44 |
2103 int v23; // [sp-1Ch] [bp-34h]@44 | 2102 //int v23; // [sp-1Ch] [bp-34h]@44 |
2104 int v24; // [sp-18h] [bp-30h]@44 | 2103 //int v24; // [sp-18h] [bp-30h]@44 |
2105 unsigned int v25; // [sp-14h] [bp-2Ch]@43 | 2104 //unsigned int v25; // [sp-14h] [bp-2Ch]@43 |
2106 unsigned int v26; // [sp-10h] [bp-28h]@43 | 2105 //unsigned int v26; // [sp-10h] [bp-28h]@43 |
2107 unsigned __int8 v27; // [sp-Ch] [bp-24h]@43 | 2106 //unsigned __int8 v27; // [sp-Ch] [bp-24h]@43 |
2108 char *v28; // [sp-8h] [bp-20h]@43 | 2107 //char *v28; // [sp-8h] [bp-20h]@43 |
2109 Texture *v29; // [sp-4h] [bp-1Ch]@43 | 2108 //Texture *v29; // [sp-4h] [bp-1Ch]@43 |
2110 //__int16 a3a; // [sp+10h] [bp-8h]@1 | 2109 //__int16 a3a; // [sp+10h] [bp-8h]@1 |
2111 //__int16 a2a; // [sp+14h] [bp-4h]@1 | 2110 //__int16 a2a; // [sp+14h] [bp-4h]@1 |
2112 | 2111 |
2113 //a3a = uPlayerID; | 2112 //a3a = uPlayerID; |
2114 //a2a = a1; | 2113 //a2a = a1; |
2286 if ( a5 & 2 ) | 2285 if ( a5 & 2 ) |
2287 { | 2286 { |
2288 if ( pGUIWindow_Settings ) | 2287 if ( pGUIWindow_Settings ) |
2289 return; | 2288 return; |
2290 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | 2289 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2291 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 0, 0x31u, "", 0); | 2290 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_45, 0, 0x31u, "", 0); |
2292 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 1u, 0x32u, "", 0); | 2291 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_45, 1u, 0x32u, "", 0); |
2293 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 2u, 0x33u, "", 0); | 2292 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_45, 2u, 0x33u, "", 0); |
2294 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 3u, 0x34u, "", 0); | 2293 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_45, 3u, 0x34u, "", 0); |
2295 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | 2294 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2296 return; | 2295 return; |
2297 } | 2296 } |
2298 if ( a5 & 8 ) | 2297 if ( a5 & 8 ) |
2299 { | 2298 { |
2300 if ( pGUIWindow_Settings ) | 2299 if ( pGUIWindow_Settings ) |
2301 return; | 2300 return; |
2302 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | 2301 |
2303 v29 = 0; | 2302 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2304 v28 = ""; | 2303 pGUIWindow_Settings->CreateButton(game_viewport_x, game_viewport_y, game_viewport_width, game_viewport_height, 1, 0, UIMSG_46, 0, 0, "", 0); |
2305 v27 = 0; | |
2306 v26 = 0; | |
2307 v25 = 70; | |
2308 LABEL_44: | |
2309 v24 = 0; | |
2310 v23 = 1; | |
2311 v22 = 344; | |
2312 v21 = game_viewport_width; | |
2313 v20 = 8; | |
2314 v19 = 8; | |
2315 pGUIWindow_Settings = v17; | |
2316 v18 = v17; | |
2317 LABEL_56: | |
2318 v18->CreateButton(v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); | |
2319 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | 2304 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2320 return; | 2305 return; |
2321 } | 2306 } |
2322 if ( a5 & 0x40 ) | 2307 if ( a5 & 0x40 ) |
2323 { | 2308 { |
2324 if ( pGUIWindow_Settings ) | 2309 if ( pGUIWindow_Settings ) |
2325 return; | 2310 return; |
2326 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | 2311 |
2327 v29 = 0; | 2312 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2328 v28 = ""; | 2313 pGUIWindow_Settings->CreateButton(game_viewport_x, game_viewport_y, game_viewport_width, game_viewport_height, 1, 0, UIMSG_BE, 0, 0, "", 0); |
2329 v27 = 0; | 2314 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2330 v26 = 0; | 2315 return; |
2331 v25 = 190; | |
2332 goto LABEL_44; | |
2333 } | 2316 } |
2334 if ( (char)a5 < 0 ) | 2317 if ( (char)a5 < 0 ) |
2335 { | 2318 { |
2336 if ( pGUIWindow_Settings ) | 2319 if ( pGUIWindow_Settings ) |
2337 return; | 2320 return; |
2347 if ( HIBYTE(a5) & 1 ) | 2330 if ( HIBYTE(a5) & 1 ) |
2348 { | 2331 { |
2349 if ( pGUIWindow_Settings ) | 2332 if ( pGUIWindow_Settings ) |
2350 return; | 2333 return; |
2351 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | 2334 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2352 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 0, 0x31u, "", 0); | 2335 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_8D, 0, 0x31u, "", 0); |
2353 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 1u, 0x32u, "", 0); | 2336 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_8D, 1, 0x32u, "", 0); |
2354 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 2u, 0x33u, "", 0); | 2337 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_8D, 2, 0x33u, "", 0); |
2355 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 3u, 0x34u, "", 0); | 2338 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_8D, 3, 0x34u, "", 0); |
2356 pGUIWindow_Settings->CreateButton(8, 8, game_viewport_width, 344, 1, 0, 140, 0, 0, "", NULL); | 2339 pGUIWindow_Settings->CreateButton(8, 8, game_viewport_width, game_viewport_height, 1, 0, UIMSG_8C, 0, 0, "", NULL); |
2357 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | 2340 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2358 } | 2341 } |
2359 if ( HIBYTE(a5) & 2 && !pGUIWindow_Settings ) | 2342 if ( HIBYTE(a5) & 2 && !pGUIWindow_Settings ) |
2360 { | 2343 { |
2361 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | 2344 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2362 pBtn_NPCLeft = pGUIWindow_Settings->CreateButton( | 2345 pBtn_NPCLeft = pGUIWindow_Settings->CreateButton(469, 178, |
2363 0x1D5u, | 2346 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureWidth, |
2364 0xB2u, | 2347 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureHeight, |
2365 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24), | |
2366 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26), | |
2367 1, | 2348 1, |
2368 0, | 2349 0, |
2369 0xBCu, | 2350 UIMSG_ScrollNPCPanel, 0, |
2370 0, | |
2371 0, | 2351 0, |
2372 "", | 2352 "", |
2373 (Texture *)(uTextureID_Btn_NPCLeft != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft] : 0), | 2353 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft), 0); |
2374 0); | 2354 pBtn_NPCRight = pGUIWindow_Settings->CreateButton(626, 178, |
2375 pBtn_NPCRight = pGUIWindow_Settings->CreateButton( | 2355 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureWidth, |
2376 0x272u, | 2356 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureHeight, |
2377 0xB2u, | |
2378 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureWidth : 24), | |
2379 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26), | |
2380 1, | 2357 1, |
2381 0, | 2358 0, |
2382 0xBCu, | 2359 UIMSG_ScrollNPCPanel, 1, |
2383 1u, | |
2384 0, | 2360 0, |
2385 "", | 2361 "", |
2386 (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0), | 2362 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight), 0); |
2387 0); | 2363 pGUIWindow_Settings->CreateButton(0x1EBu, 149, 64, 74, 1, 0, UIMSG_8F, 4, 0x35u, "", 0); |
2388 pGUIWindow_Settings->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 4u, 0x35u, "", 0); | 2364 pGUIWindow_Settings->CreateButton(0x231u, 149, 64, 74, 1, 0, UIMSG_8F, 5, 0x36u, "", 0); |
2389 pGUIWindow_Settings->CreateButton(0x231u, 0x95u, 0x40u, 0x4Au, 1, 0, 0x8Fu, 5u, 0x36u, "", 0); | |
2390 } | 2365 } |
2391 } | 2366 } |
2392 } | 2367 } |
2393 | 2368 |
2394 //----- (00427D48) -------------------------------------------------------- | 2369 //----- (00427D48) -------------------------------------------------------- |
8534 | 8509 |
8535 //----- (0042FC4E) -------------------------------------------------------- | 8510 //----- (0042FC4E) -------------------------------------------------------- |
8536 void __cdecl ProcessInputActions() | 8511 void __cdecl ProcessInputActions() |
8537 { | 8512 { |
8538 ActionQueue *pActionQueue; // esi@7 | 8513 ActionQueue *pActionQueue; // esi@7 |
8539 Keyboard *v3; // ecx@8 | 8514 //Keyboard *v3; // ecx@8 |
8540 char v4; // al@9 | 8515 char v4; // al@9 |
8541 ActionQueue *v5; // ecx@19 | 8516 ActionQueue *v5; // ecx@19 |
8542 Player *v6; // ecx@86 | 8517 Player *v6; // ecx@86 |
8543 Player *v7; // esi@100 | 8518 Player *v7; // esi@100 |
8544 char v8; // bl@100 | 8519 char v8; // bl@100 |
8582 { | 8557 { |
8583 inputAction = (InputAction)0; | 8558 inputAction = (InputAction)0; |
8584 pActionQueue = pPartyActionQueue; | 8559 pActionQueue = pPartyActionQueue; |
8585 while ( 1 ) | 8560 while ( 1 ) |
8586 { | 8561 { |
8587 v3 = pGame->pKeyboardInstance; | |
8588 v17 = pKeyActionMap->pVirtualKeyCodesMapping[inputAction]; | 8562 v17 = pKeyActionMap->pVirtualKeyCodesMapping[inputAction]; |
8589 if ( pKeyActionMap->pToggleTypes[inputAction] ) | 8563 if ( pKeyActionMap->pToggleTypes[inputAction] ) |
8590 v4 = v3->WasKeyPressed(v17); | 8564 v4 = pKeyboard->WasKeyPressed(v17); |
8591 else | 8565 else |
8592 v4 = v3->IsKeyBeingHeld(v17); | 8566 v4 = pKeyboard->IsKeyBeingHeld(v17); |
8593 if ( v4 ) | 8567 if ( v4 ) |
8594 { | 8568 { |
8595 switch ( inputAction ) | 8569 switch ( inputAction ) |
8596 { | 8570 { |
8597 case INPUT_MoveForward: | 8571 case INPUT_MoveForward: |