comparison GUIWindow.cpp @ 44:916bec351934

22.10.12(pCurrentScreen)
author Ritor1
date Mon, 22 Oct 2012 17:28:15 +0600
parents 93bf1d5f6a6d
children 79a30ee1ecdb 6a62c4005f0e
comparison
equal deleted inserted replaced
43:484492a6dd28 44:916bec351934
106 v6 = v2->uFrameWidth; 106 v6 = v2->uFrameWidth;
107 v2->uFrameHeight = v5; 107 v2->uFrameHeight = v5;
108 v7 = v2->uFrameHeight; 108 v7 = v2->uFrameHeight;
109 v2->uFrameZ = v6 + v2->uFrameX - 1; 109 v2->uFrameZ = v6 + v2->uFrameX - 1;
110 v2->uFrameW = v2->uFrameY + v7 - 1; 110 v2->uFrameW = v2->uFrameY + v7 - 1;
111 v2->_415551(0); 111 v2->DrawMessageBox(0);
112 v2->DrawText2(pFontArrus, 0, 0xCu, 0, pGlobalTXT_LocalizationStrings[451], 3u); 112 v2->DrawText2(pFontArrus, 0, 0xCu, 0, pGlobalTXT_LocalizationStrings[451], 3u);
113 if ( !v19 ) 113 if ( !v19 )
114 v2->DrawText2(v1, 0, 0x28u, 0, pGlobalTXT_LocalizationStrings[153], 3u); 114 v2->DrawText2(v1, 0, 0x28u, 0, pGlobalTXT_LocalizationStrings[153], 3u);
115 v20 = 0; 115 v20 = 0;
116 GetTickCount(); 116 GetTickCount();
218 v1->uFrameHeight = v9; 218 v1->uFrameHeight = v9;
219 v11 = v10 + v8 - 1; 219 v11 = v10 + v8 - 1;
220 v12 = v1->uFrameY; 220 v12 = v1->uFrameY;
221 v1->uFrameZ = v11; 221 v1->uFrameZ = v11;
222 v1->uFrameW = v9 + v12 - 1; 222 v1->uFrameW = v9 + v12 - 1;
223 v1->_415551(0); 223 v1->DrawMessageBox(0);
224 if ( pPlayer->pConditions[16] ) 224 if ( pPlayer->pConditions[16] )
225 { 225 {
226 v13 = pTexture_PlayerFaceEradicated; 226 v13 = pTexture_PlayerFaceEradicated;
227 } 227 }
228 else 228 else
367 { 367 {
368 v5 = v2 - 19; 368 v5 = v2 - 19;
369 if ( !v5 ) 369 if ( !v5 )
370 { 370 {
371 pIcons_LOD->_40F9C5(); 371 pIcons_LOD->_40F9C5();
372 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = dword_506978; 372 pCurrentScreen = dword_506978;
373 pKeyActionMap->_459ED1(3); 373 pKeyActionMap->_459ED1(3);
374 goto LABEL_26; 374 goto LABEL_26;
375 } 375 }
376 v6 = v5 - 6; 376 v6 = v5 - 6;
377 if ( !v6 ) 377 if ( !v6 )
429 LABEL_18: 429 LABEL_18:
430 pTexture_outside->Release(); 430 pTexture_outside->Release();
431 pTexture_Dialogue_Background->Release(); 431 pTexture_Dialogue_Background->Release();
432 pIcons_LOD->_40F9C5(); 432 pIcons_LOD->_40F9C5();
433 LABEL_19: 433 LABEL_19:
434 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = dword_506978; 434 pCurrentScreen = dword_506978;
435 goto LABEL_26; 435 goto LABEL_26;
436 } 436 }
437 OnCloseSpellook(); 437 OnCloseSpellook();
438 } 438 }
439 } 439 }
457 v11 = uNumVisibleWindows; 457 v11 = uNumVisibleWindows;
458 while ( v10 < v11 ) 458 while ( v10 < v11 )
459 { 459 {
460 v12 = pVisibleWindowsIdxs[v10 + 1]; 460 v12 = pVisibleWindowsIdxs[v10 + 1];
461 pVisibleWindowsIdxs[v10] = v12; 461 pVisibleWindowsIdxs[v10] = v12;
462 --*((int *)&stru_506F20.field_18 + 21 * v12); 462 --*((int *)&pTexture_PCX.field_18 + 21 * v12);
463 ++v10; 463 ++v10;
464 } 464 }
465 pVisibleWindowsIdxs[v11] = 0; 465 pVisibleWindowsIdxs[v11] = 0;
466 uNumVisibleWindows = v11 - 1; 466 uNumVisibleWindows = v11 - 1;
467 } 467 }
523 523
524 v1 = this; 524 v1 = this;
525 pAudioPlayer->StopChannels(-1, -1); 525 pAudioPlayer->StopChannels(-1, -1);
526 InitializeBookFonts(); 526 InitializeBookFonts();
527 v1->CreateButton(0x1DBu, 0x1BDu, 0x9Eu, 0x22u, 1, 0, 0x71u, 0, 0, pGlobalTXT_LocalizationStrings[79], 0); 527 v1->CreateButton(0x1DBu, 0x1BDu, 0x9Eu, 0x22u, 1, 0, 0x71u, 0, 0, pGlobalTXT_LocalizationStrings[79], 0);
528 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 3; 528 pCurrentScreen = 3;
529 dword_506524 = 0; 529 dword_506524 = 0;
530 dword_506528 = 0; 530 dword_506528 = 0;
531 dword_50651C = 0; 531 dword_50651C = 0;
532 dword_506520 = 0; 532 dword_506520 = 0;
533 if ( v1->ptr_1C == (void *)177 ) 533 if ( v1->ptr_1C == (void *)177 )
1031 1031
1032 1032
1033 1033
1034 1034
1035 //----- (00415551) -------------------------------------------------------- 1035 //----- (00415551) --------------------------------------------------------
1036 void GUIWindow::_415551(int arg0) 1036 void GUIWindow::DrawMessageBox(int arg0)
1037 { 1037 {
1038 unsigned int v2; // edi@1 1038 unsigned int v2; // edi@1
1039 GUIWindow *v3; // ebx@1 1039 GUIWindow *v3; // ebx@1
1040 signed int v4; // esi@2 1040 signed int v4; // esi@2
1041 unsigned int v5; // eax@2 1041 unsigned int v5; // eax@2
1118 v19.uFrameY += 12; 1118 v19.uFrameY += 12;
1119 v19.uFrameHeight -= 12; 1119 v19.uFrameHeight -= 12;
1120 v19.uFrameZ = v19.uFrameWidth + v19.uFrameX - 1; 1120 v19.uFrameZ = v19.uFrameWidth + v19.uFrameX - 1;
1121 v23 = v12; 1121 v23 = v12;
1122 v19.uFrameW = v19.uFrameHeight + v19.uFrameY - 1; 1122 v19.uFrameW = v19.uFrameHeight + v19.uFrameY - 1;
1123 v14 = v3->str_48; 1123 v14 = v3->Hint;
1124 if ( v14 ) 1124 if ( v14 )
1125 { 1125 {
1126 v15 = pFontLucida->CalcTextHeight(v14, &v19, 0, 0); 1126 v15 = pFontLucida->CalcTextHeight(v14, &v19, 0, 0);
1127 v12 = v23; 1127 v12 = v23;
1128 v16 = v15 + 24; 1128 v16 = v15 + 24;
1134 if ( (signed int)v16 < 64 ) 1134 if ( (signed int)v16 < 64 )
1135 v16 = 64; 1135 v16 = 64;
1136 if ( (signed int)(v16 + v12) > 479 ) 1136 if ( (signed int)(v16 + v12) > 479 )
1137 v16 = 479 - v12; 1137 v16 = 479 - v12;
1138 DrawPopupWindow(a2.y, v12, v21, v16); 1138 DrawPopupWindow(a2.y, v12, v21, v16);
1139 v17 = v3->str_48; 1139 v17 = v3->Hint;
1140 if ( v17 ) 1140 if ( v17 )
1141 { 1141 {
1142 v18 = pFontLucida->CalcTextHeight(v17, &v19, 0, 0); 1142 v18 = pFontLucida->CalcTextHeight(v17, &v19, 0, 0);
1143 v19.DrawText2(pFontLucida, 0, (signed int)(v16 - v18) / 2 - 14, 0, v17, 3u); 1143 v19.DrawText2(pFontLucida, 0, (signed int)(v16 - v18) / 2 - 14, 0, v17, 3u);
1144 } 1144 }
1475 pRenderer->DrawTextureIndexed( 1475 pRenderer->DrawTextureIndexed(
1476 _4E5E50_transui_x - 4, 1476 _4E5E50_transui_x - 4,
1477 _4E5EE0_transui_y - 4, 1477 _4E5EE0_transui_y - 4,
1478 (Texture *)(uTextureID_50795C != -1 ? &pIcons_LOD->pTextures[uTextureID_50795C] : 0)); 1478 (Texture *)(uTextureID_50795C != -1 ? &pIcons_LOD->pTextures[uTextureID_50795C] : 0));
1479 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pDialogueNPCPortraits[(signed int)v4]); 1479 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pDialogueNPCPortraits[(signed int)v4]);
1480 if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 14 ) 1480 if ( pCurrentScreen == 14 )
1481 { 1481 {
1482 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 1482 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
1483 goto LABEL_58; 1483 goto LABEL_58;
1484 } 1484 }
1485 if ( v4 || !dword_591080 ) 1485 if ( v4 || !dword_591080 )
2162 auto pWindow = &pWindowList[uNextFreeWindowID]; 2162 auto pWindow = &pWindowList[uNextFreeWindowID];
2163 pWindow->uFrameWidth = uWidth; 2163 pWindow->uFrameWidth = uWidth;
2164 pWindow->uFrameZ = uX + uWidth - 1; 2164 pWindow->uFrameZ = uX + uWidth - 1;
2165 pWindow->uFrameW = uY + uHeight - 1; 2165 pWindow->uFrameW = uY + uHeight - 1;
2166 pWindow->ptr_1C = (void *)a4; 2166 pWindow->ptr_1C = (void *)a4;
2167 pWindow->str_48 = (char *)a5; 2167 pWindow->Hint = (char *)a5;
2168 v10 = uNumVisibleWindows; 2168 v10 = uNumVisibleWindows;
2169 pWindow->uFrameX = uX; 2169 pWindow->uFrameX = uX;
2170 ++v10; 2170 ++v10;
2171 pWindow->uFrameY = uY; 2171 pWindow->uFrameY = uY;
2172 pWindow->uFrameHeight = uHeight; 2172 pWindow->uFrameHeight = uHeight;
2183 { 2183 {
2184 case WINDOW_Book: 2184 case WINDOW_Book:
2185 pWindow->InitializeBookView(); 2185 pWindow->InitializeBookView();
2186 break; 2186 break;
2187 case WINDOW_A: 2187 case WINDOW_A:
2188 dword_506978 = uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions; 2188 dword_506978 = pCurrentScreen;
2189 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 4; 2189 pCurrentScreen = 4;
2190 ptr_5076F4 = pWindow->CreateButton( 2190 ptr_5076F4 = pWindow->CreateButton(
2191 0x1D7u, 2191 0x1D7u,
2192 0x1BDu, 2192 0x1BDu,
2193 0xA9u, 2193 0xA9u,
2194 0x23u, 2194 0x23u,
2380 } 2380 }
2381 pWindow->_41D08F(a4a, 1, 0, 1); 2381 pWindow->_41D08F(a4a, 1, 0, 1);
2382 } 2382 }
2383 break; 2383 break;
2384 case WINDOW_11: 2384 case WINDOW_11:
2385 dword_506978 = uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions; 2385 dword_506978 = pCurrentScreen;
2386 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 17; 2386 pCurrentScreen = 17;
2387 ptr_5076F4 = pWindow->CreateButton( 2387 ptr_5076F4 = pWindow->CreateButton(
2388 0x236u, 2388 0x236u,
2389 0x1BDu, 2389 0x1BDu,
2390 0x4Bu, 2390 0x4Bu,
2391 0x21u, 2391 0x21u,
2405 1, 2405 1,
2406 0, 2406 0,
2407 0x5Au, 2407 0x5Au,
2408 0, 2408 0,
2409 0x59u, 2409 0x59u,
2410 pWindow->str_48, 2410 pWindow->Hint,
2411 (Texture *)(uTextureID_BUTTYES2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTYES2] : 0), 2411 (Texture *)(uTextureID_BUTTYES2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTYES2] : 0),
2412 0); 2412 0);
2413 pWindow->CreateButton( 2413 pWindow->CreateButton(
2414 _4E5E50_transui_x, 2414 _4E5E50_transui_x,
2415 _4E5EE0_transui_y, 2415 _4E5EE0_transui_y,
2418 1, 2418 1,
2419 0, 2419 0,
2420 0x5Au, 2420 0x5Au,
2421 1u, 2421 1u,
2422 0x20u, 2422 0x20u,
2423 pWindow->str_48, 2423 pWindow->Hint,
2424 0, 2424 0,
2425 0, 2425 0,
2426 0); 2426 0);
2427 pWindow->CreateButton(8u, 8u, 0x1CCu, 0x158u, 1, 0, 0x5Au, 1u, 0, pWindow->str_48, 0); 2427 pWindow->CreateButton(8u, 8u, 0x1CCu, 0x158u, 1, 0, 0x5Au, 1u, 0, pWindow->Hint, 0);
2428 break; 2428 break;
2429 case WINDOW_12: 2429 case WINDOW_12:
2430 InitializeBookTextures(); 2430 InitializeBookTextures();
2431 pWindow->_411621(); 2431 pWindow->_411621();
2432 break; 2432 break;
2433 case WINDOW_13: 2433 case WINDOW_13:
2434 dword_506978 = uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions; 2434 dword_506978 = pCurrentScreen;
2435 pKeyActionMap->_459E5A(0, 15, pWindow); 2435 pKeyActionMap->_459E5A(0, 15, pWindow);
2436 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 19; 2436 pCurrentScreen = 19;
2437 break; 2437 break;
2438 } 2438 }
2439 return pWindow; 2439 return pWindow;
2440 } 2440 }
2441 LABEL_62: 2441 LABEL_62:
2446 pWindow->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, nullstring, 0); 2446 pWindow->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, nullstring, 0);
2447 return pWindow; 2447 return pWindow;
2448 } 2448 }
2449 if (eWindowType == WINDOW_HouseInterior) 2449 if (eWindowType == WINDOW_HouseInterior)
2450 { 2450 {
2451 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 13; 2451 pCurrentScreen = 13;
2452 ptr_5076F4 = pWindow->CreateButton( 2452 ptr_5076F4 = pWindow->CreateButton(
2453 0x1D7u, 2453 0x1D7u,
2454 0x1BDu, 2454 0x1BDu,
2455 0xA9u, 2455 0xA9u,
2456 0x23u, 2456 0x23u,
2512 } 2512 }
2513 else 2513 else
2514 { 2514 {
2515 if (eWindowType == WINDOW_1A) 2515 if (eWindowType == WINDOW_1A)
2516 { 2516 {
2517 dword_506978 = uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions; 2517 dword_506978 = pCurrentScreen;
2518 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 18; 2518 pCurrentScreen = 18;
2519 ptr_5076F4 = pWindow->CreateButton( 2519 ptr_5076F4 = pWindow->CreateButton(
2520 0x236u, 2520 0x236u,
2521 0x1BDu, 2521 0x1BDu,
2522 0x4Bu, 2522 0x4Bu,
2523 0x21u, 2523 0x21u,
2537 1, 2537 1,
2538 0, 2538 0,
2539 0x19Bu, 2539 0x19Bu,
2540 0, 2540 0,
2541 0x59u, 2541 0x59u,
2542 pWindow->str_48, 2542 pWindow->Hint,
2543 (Texture *)(uTextureID_BUTTYES2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTYES2] : 0), 2543 (Texture *)(uTextureID_BUTTYES2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTYES2] : 0),
2544 0); 2544 0);
2545 pWindow->CreateButton( 2545 pWindow->CreateButton(
2546 _4E5E50_transui_x, 2546 _4E5E50_transui_x,
2547 _4E5EE0_transui_y, 2547 _4E5EE0_transui_y,
2550 1, 2550 1,
2551 0, 2551 0,
2552 0x19Bu, 2552 0x19Bu,
2553 1u, 2553 1u,
2554 0x20u, 2554 0x20u,
2555 pWindow->str_48, 2555 pWindow->Hint,
2556 0); 2556 0);
2557 pWindow->CreateButton(8u, 8u, 0x1CCu, 0x158u, 1, 0, 0x19Bu, 1u, 0, pWindow->str_48, 0); 2557 pWindow->CreateButton(8u, 8u, 0x1CCu, 0x158u, 1, 0, 0x19Bu, 1u, 0, pWindow->Hint, 0);
2558 return pWindow; 2558 return pWindow;
2559 } 2559 }
2560 if (eWindowType == WINDOW_1B) 2560 if (eWindowType == WINDOW_1B)
2561 { 2561 {
2562 pEventTimer->Pause(); 2562 pEventTimer->Pause();
2584 (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0), 2584 (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0),
2585 0); 2585 0);
2586 ShowStatusBarString(pGlobalTXT_LocalizationStrings[39], 2u); 2586 ShowStatusBarString(pGlobalTXT_LocalizationStrings[39], 2u);
2587 ++pIcons_LOD->uTexturePacksCount; 2587 ++pIcons_LOD->uTexturePacksCount;
2588 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; 2588 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
2589 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 23; 2589 pCurrentScreen = 23;
2590 if ( !pIcons_LOD->uNumPrevLoadedFiles ) 2590 if ( !pIcons_LOD->uNumPrevLoadedFiles )
2591 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; 2591 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
2592 } 2592 }
2593 } 2593 }
2594 return pWindow; 2594 return pWindow;