comparison GUIWindow.cpp @ 961:5a12082c803d

UIMSG and WINDOW_Type(continue)
author Ritor1
date Mon, 06 May 2013 17:33:40 +0600
parents 9a5db2cf999a
children 0423c40d7e88
comparison
equal deleted inserted replaced
960:9a5db2cf999a 961:5a12082c803d
300 300
301 301
302 //----- (0041C26A) -------------------------------------------------------- 302 //----- (0041C26A) --------------------------------------------------------
303 void GUIWindow::Release() 303 void GUIWindow::Release()
304 { 304 {
305 GUIWindow *v1; // esi@1 305 //GUIWindow *v1; // esi@1
306 int i; // edi@20 306 int i; // edi@20
307 GUIButton *v8; // eax@26 307 //GUIButton *v8; // eax@26
308 GUIButton *v9; // edi@27 308 GUIButton *pNextBtn; // edi@27
309 int v10; // esi@28 309 //int v10; // esi@28
310 int v11; // ecx@28 310 //int v11; // ecx@28
311 int v12; // edx@29 311 int v12; // edx@29
312 312
313 v1 = this; 313 //v1 = this;
314 if ( !this ) 314 if ( !this )
315 return; 315 return;
316 316
317 switch( this->eWindowType ) 317 switch( this->eWindowType )
318 { 318 {
383 default: 383 default:
384 { 384 {
385 break; 385 break;
386 } 386 }
387 } 387 }
388 v8 = v1->pControlsHead; 388 //v8 = this->pControlsHead;
389 if ( v8 ) 389 if ( this->pControlsHead )
390 { 390 {
391 do 391 do
392 { 392 {
393 v9 = v8->pNext; 393 pNextBtn = this->pControlsHead->pNext;
394 pAllocator->FreeChunk(v8); 394 pAllocator->FreeChunk(this->pControlsHead);
395 v8 = v9; 395 this->pControlsHead = pNextBtn;
396 } 396 }
397 while ( v9 ); 397 while ( pNextBtn );
398 } 398 }
399 v1->pControlsHead = 0; 399 this->pControlsHead = 0;
400 v1->pControlsTail = 0; 400 this->pControlsTail = 0;
401 v1->uNumControls = 0; 401 this->uNumControls = 0;
402 v1->eWindowType = WINDOW_null; 402 this->eWindowType = WINDOW_null;
403 v10 = v1->numVisibleWindows; 403 while ( this->numVisibleWindows < uNumVisibleWindows )
404 v11 = uNumVisibleWindows; 404 {
405 while ( v10 < v11 ) 405 v12 = pVisibleWindowsIdxs[this->numVisibleWindows + 1];
406 { 406 pVisibleWindowsIdxs[this->numVisibleWindows] = v12;
407 v12 = pVisibleWindowsIdxs[v10 + 1];
408 pVisibleWindowsIdxs[v10] = v12;
409 --*((int *)&pTexture_PCX.field_18 + 21 * v12); 407 --*((int *)&pTexture_PCX.field_18 + 21 * v12);
410 ++v10; 408 ++this->numVisibleWindows;
411 } 409 }
412 pVisibleWindowsIdxs[v11] = 0; 410 pVisibleWindowsIdxs[uNumVisibleWindows] = 0;
413 uNumVisibleWindows = v11 - 1; 411 uNumVisibleWindows = uNumVisibleWindows - 1;
414 } 412 }
415 413
416 414
417 415
418 416
475 dword_506528 = 0; 473 dword_506528 = 0;
476 dword_50651C = 0; 474 dword_50651C = 0;
477 num_achieved_awards = 0; 475 num_achieved_awards = 0;
478 switch (v1->par1C) 476 switch (v1->par1C)
479 { 477 {
480 case WINDOW_Lloyd:{ 478 case WINDOW_LloydsBeacon:{
481 byte_506360 = 0; 479 byte_506360 = 0;
482 pTexture_CurrentBook = pIcons_LOD->LoadTexturePtr("lb_bordr", TEXTURE_16BIT_PALETTE); 480 pTexture_CurrentBook = pIcons_LOD->LoadTexturePtr("lb_bordr", TEXTURE_16BIT_PALETTE);
483 pTexture_LloydBeacons[0] = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); 481 pTexture_LloydBeacons[0] = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE);
484 pTexture_50635C = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); 482 pTexture_50635C = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE);
485 pTex_tab_an_6b__zoom_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); 483 pTex_tab_an_6b__zoom_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE);
486 pTex_tab_an_6a__zoom_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); 484 pTex_tab_an_6a__zoom_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE);
487 485
488 pBtn_Book_1 = v1->CreateButton(415, 13, 39, 36, 1, 0, UIMSG_B2, 0, 0, pGlobalTXT_LocalizationStrings[375], 0); // Set Beacon 486 pBtn_Book_1 = v1->CreateButton(415, 13, 39, 36, 1, 0, UIMSG_LloydsBeacon_FlippingBtn, 0, 0, pGlobalTXT_LocalizationStrings[375], 0); // Set Beacon
489 pBtn_Book_2 = v1->CreateButton(415, 48, 39, 36, 1, 0, UIMSG_B2, 1, 0, pGlobalTXT_LocalizationStrings[523], 0); // Recall Beacon 487 pBtn_Book_2 = v1->CreateButton(415, 48, 39, 36, 1, 0, UIMSG_LloydsBeacon_FlippingBtn, 1, 0, pGlobalTXT_LocalizationStrings[523], 0); // Recall Beacon
490 488
491 v17 = &pParty->pPlayers[_506348_current_lloyd_playerid]; 489 v17 = &pParty->pPlayers[_506348_current_lloyd_playerid];
492 v23 = 1; 490 v23 = 1;
493 v18 = v17->pActiveSkills[14]; 491 v18 = v17->pActiveSkills[14];
494 if ( HIBYTE(v18) & 1 || (v18 & 0x80u) != 0 ) 492 if ( HIBYTE(v18) & 1 || (v18 & 0x80u) != 0 )
503 v19 = 0; 501 v19 = 0;
504 if ( v23 > 0 ) 502 if ( v23 > 0 )
505 { 503 {
506 do 504 do
507 { 505 {
508 v1->CreateButton(pLloydsBeaconsPreviewXs[v19], pLloydsBeaconsPreviewYs[v19], 0x5Cu, 0x44u, 1, 180, UIMSG_B3, v19, 0, "", 0); 506 v1->CreateButton(pLloydsBeaconsPreviewXs[v19], pLloydsBeaconsPreviewYs[v19], 0x5Cu, 0x44u, 1, 180, UIMSG_InstallBeacon, v19, 0, "", 0);
509 ++v19; 507 ++v19;
510 } 508 }
511 while ( (signed int)v19 < v23 ); 509 while ( (signed int)v19 < v23 );
512 } 510 }
513 v20 = 0; 511 v20 = 0;
534 pTexture_TownPortalIcons[3] = pIcons_LOD->LoadTexturePtr("tpisland", TEXTURE_16BIT_PALETTE); 532 pTexture_TownPortalIcons[3] = pIcons_LOD->LoadTexturePtr("tpisland", TEXTURE_16BIT_PALETTE);
535 pTexture_TownPortalIcons[4] = pIcons_LOD->LoadTexturePtr("tpheaven", TEXTURE_16BIT_PALETTE); 533 pTexture_TownPortalIcons[4] = pIcons_LOD->LoadTexturePtr("tpheaven", TEXTURE_16BIT_PALETTE);
536 pTexture_TownPortalIcons[5] = pIcons_LOD->LoadTexturePtr("tphell", TEXTURE_16BIT_PALETTE); 534 pTexture_TownPortalIcons[5] = pIcons_LOD->LoadTexturePtr("tphell", TEXTURE_16BIT_PALETTE);
537 535
538 for (uint i = 0; i < 6; ++i) 536 for (uint i = 0; i < 6; ++i)
539 v1->CreateButton(pTownPortalBook_xs[i], pTownPortalBook_ys[i], pTownPortalBook_ws[i], pTownPortalBook_hs[i], 1, 182, UIMSG_B7, i, 0, "", nullptr); 537 v1->CreateButton(pTownPortalBook_xs[i], pTownPortalBook_ys[i], pTownPortalBook_ws[i], pTownPortalBook_hs[i], 1, 182, UIMSG_ClickTownInTP, i, 0, "", nullptr);
540 /*v16 = 0; 538 /*v16 = 0;
541 do 539 do
542 { 540 {
543 v1->CreateButton(pTownPortalBook_xs[v16], pTownPortalBook_ys[v16], pTownPortalBook_ws[v16], pTownPortalBook_hs[v16], 1, 182, 0xB7u, v16, 0, "", 0); 541 v1->CreateButton(pTownPortalBook_xs[v16], pTownPortalBook_ys[v16], pTownPortalBook_ws[v16], pTownPortalBook_hs[v16], 1, 182, 0xB7u, v16, 0, "", 0);
544 ++v16; 542 ++v16;
1919 v29 = (char*)pGlobalTXT_LocalizationStrings[435]; 1917 v29 = (char*)pGlobalTXT_LocalizationStrings[435];
1920 } 1918 }
1921 sprintfex(byte_591180[v26], v29, v30); 1919 sprintfex(byte_591180[v26], v29, v30);
1922 HouseNPCData[v26 + 7] = (NPCData *)pWindow->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v26], 1920 HouseNPCData[v26 + 7] = (NPCData *)pWindow->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v26],
1923 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v26], 1921 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v26],
1924 0x3Fu, 0x49u, 1, 0, UIMSG_19A, v26, 0, byte_591180[v26], 0, 0, 0); 1922 0x3Fu, 0x49u, 1, 0, UIMSG_ClickHouseNPCPortrait, v26, 0, byte_591180[v26], 0, 0, 0);
1925 v25 = uNumDialogueNPCPortraits; 1923 v25 = uNumDialogueNPCPortraits;
1926 } 1924 }
1927 } 1925 }
1928 if ( v25 == 1 ) 1926 if ( v25 == 1 )
1929 { 1927 {
1941 pBtn_YES = pWindow->CreateButton(0x1E6u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, UIMSG_TransitionUI_Confirm, 0, 'Y', pWindow->Hint, pIcons_LOD->GetTexture(uTextureID_BUTTYES2), 0); 1939 pBtn_YES = pWindow->CreateButton(0x1E6u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, UIMSG_TransitionUI_Confirm, 0, 'Y', pWindow->Hint, pIcons_LOD->GetTexture(uTextureID_BUTTYES2), 0);
1942 pWindow->CreateButton(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 0x3Fu, 0x49u, 1, 0, UIMSG_TransitionUI_Confirm, 1, 0x20u, pWindow->Hint, 0); 1940 pWindow->CreateButton(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 0x3Fu, 0x49u, 1, 0, UIMSG_TransitionUI_Confirm, 1, 0x20u, pWindow->Hint, 0);
1943 pWindow->CreateButton(8, 8, 0x1CCu, 0x158u, 1, 0, UIMSG_TransitionUI_Confirm, 1u, 0, pWindow->Hint, 0); 1941 pWindow->CreateButton(8, 8, 0x1CCu, 0x158u, 1, 0, UIMSG_TransitionUI_Confirm, 1u, 0, pWindow->Hint, 0);
1944 return pWindow; 1942 return pWindow;
1945 } 1943 }
1946 if (eWindowType == WINDOW_1B) 1944 if (eWindowType == WINDOW_CastSpell)
1947 { 1945 {
1948 pEventTimer->Pause(); 1946 pEventTimer->Pause();
1949 pAudioPlayer->StopChannels(-1, -1); 1947 pAudioPlayer->StopChannels(-1, -1);
1950 pMouse->SetCursorBitmap("MICON2"); 1948 pMouse->SetCursorBitmap("MICON2");
1951 ShowStatusBarString(pGlobalTXT_LocalizationStrings[39], 2u);//Выберите цель 1949 ShowStatusBarString(pGlobalTXT_LocalizationStrings[39], 2u);//Выберите цель