comparison UI/UIHouses.cpp @ 1636:ff3d7af671ec

SimpleHouseDialog cleaning(continue)
author Ritor1
date Tue, 17 Sep 2013 17:34:31 +0600
parents 08ebd0fee604
children b60ddd777d50
comparison
equal deleted inserted replaced
1635:04cae215a13c 1636:ff3d7af671ec
3258 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)pPlayers[uActiveCharacter]->_achieved_awards_bits, word_4F0754[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) ) 3258 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)pPlayers[uActiveCharacter]->_achieved_awards_bits, word_4F0754[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) )
3259 { 3259 {
3260 pTextHeight = pFontArrus->CalcTextHeight(pNPCTopics[171].pText, &dialog_window, 0, 0);// 3260 pTextHeight = pFontArrus->CalcTextHeight(pNPCTopics[171].pText, &dialog_window, 0, 0);//
3261 dialog_window.DrawTitleText(pFontArrus, 0, (212 - pTextHeight) / 2 + 101, TargetColor(0xFFu, 0xFFu, 0x9Bu), pNPCTopics[171].pText, 3); 3261 dialog_window.DrawTitleText(pFontArrus, 0, (212 - pTextHeight) / 2 + 101, TargetColor(0xFFu, 0xFFu, 0x9Bu), pNPCTopics[171].pText, 3);
3262 pDialogueWindow->pNumPresenceButton = 0; 3262 pDialogueWindow->pNumPresenceButton = 0;
3263 return ; 3263 return;
3264 } 3264 }
3265 if ( !HouseUI_CheckIfPlayerCanInteract() ) 3265 if ( !HouseUI_CheckIfPlayerCanInteract() )
3266 return; 3266 return;
3267 v34 = 0; 3267 v34 = 0;
3268 for ( int i = pDialogueWindow->pStartingPosActiveItem; 3268 for ( int i = pDialogueWindow->pStartingPosActiveItem;
3384 unsigned int v45; // ecx@60 3384 unsigned int v45; // ecx@60
3385 unsigned __int16 v46; // ax@60 3385 unsigned __int16 v46; // ax@60
3386 GUIFont *v47; // ebx@64 3386 GUIFont *v47; // ebx@64
3387 int v48; // esi@64 3387 int v48; // esi@64
3388 GUIWindow w; // [sp+Ch] [bp-110h]@64 3388 GUIWindow w; // [sp+Ch] [bp-110h]@64
3389 GUIWindow v52; // [sp+60h] [bp-BCh]@13 3389 GUIWindow right_panel_window; // [sp+60h] [bp-BCh]@13
3390 GUIWindow house_window; // [sp+B4h] [bp-68h]@1 3390 GUIWindow house_window; // [sp+B4h] [bp-68h]@1
3391 char *pInString; // [sp+114h] [bp-8h]@12 3391 char *pInString; // [sp+114h] [bp-8h]@12
3392 3392
3393 memcpy(&house_window, pDialogueWindow, sizeof(house_window)); 3393 memcpy(&house_window, pDialogueWindow, sizeof(house_window));
3394 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) 3394 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic )
3433 pDialogueWindow->DrawText(pFontArrus, 13, 354 - (pFontArrus->CalcTextHeight(pInString, &house_window, 13, 0) + 7), 3433 pDialogueWindow->DrawText(pFontArrus, 13, 354 - (pFontArrus->CalcTextHeight(pInString, &house_window, 13, 0) + 7),
3434 0, FitTextInAWindow(pInString, pFontArrus, &house_window, 0xDu, 0), 0, 0, 0); 3434 0, FitTextInAWindow(pInString, pFontArrus, &house_window, 0xDu, 0), 0, 0, 0);
3435 } 3435 }
3436 } 3436 }
3437 } 3437 }
3438 memcpy(&v52, pDialogueWindow, sizeof(v52)); 3438 //for right panel
3439 v52.uFrameX = 483; 3439 memcpy(&right_panel_window, pDialogueWindow, sizeof(right_panel_window));
3440 v52.uFrameWidth = 148; 3440 right_panel_window.uFrameX = 483;
3441 v52.uFrameZ = 334; 3441 right_panel_window.uFrameWidth = 148;
3442 3442 right_panel_window.uFrameZ = 334;
3443 if ( v52.pStartingPosActiveItem < v52.pStartingPosActiveItem + v52.pNumPresenceButton ) 3443 for ( int i = right_panel_window.pStartingPosActiveItem;
3444 { 3444 i < right_panel_window.pStartingPosActiveItem + right_panel_window.pNumPresenceButton; ++i )
3445 v15 = ""; 3445 {
3446 for ( int i = v52.pStartingPosActiveItem; i < v52.pStartingPosActiveItem + v52.pNumPresenceButton; ++i ) 3446 pButton = right_panel_window.GetControl(i);
3447 { 3447 switch ( pButton->msg_param )
3448 pButton = v52.GetControl(i); 3448 {
3449 if ( (signed int)pButton->msg_param > 24 ) 3449 case 19://evt_A
3450 { 3450 v15 = (char *)pNPCTopics[pNPC->evt_A-1].pTopic;
3451 if ( pButton->msg_param == 76 ) 3451 if ( !v15 )
3452 { 3452 {
3453 v15 = pGlobalTXT_LocalizationStrings[406];//Нанять 3453 pButton->msg_param = 0;
3454 strcpy(pButton->pButtonName, v15); 3454 v15 = "";
3455 continue; 3455 }
3456 } 3456 strcpy(pButton->pButtonName, v15);
3457 if ( pButton->msg_param == 77 ) 3457 continue;
3458 { 3458 case 20://evt_B
3459 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[407]);//Подробнее 3459 v15 = (char *)pNPCTopics[pNPC->evt_B-1].pTopic;
3460 continue; 3460 if ( !v15 )
3461 } 3461 {
3462 if ( pButton->msg_param == 79 ) 3462 pButton->msg_param = 0;
3463 { 3463 v15 = "";
3464 strcpy(pButton->pButtonName, _4B254D_SkillMasteryTeacher((int)v52.ptr_1C));
3465 continue;
3466 }
3467 if ( pButton->msg_param == 82 )
3468 {
3469 strcpy(pButton->pButtonName, ContractSelectText((int)v52.ptr_1C));
3470 continue;
3471 }
3472 if ( pButton->msg_param == 83 )
3473 {
3474 v29 = pMonsterStats->pInfos[bountyHunting_monster_id_for_hunting].pName;
3475 v31 = *(int *)v29;
3476 sprintfex(pTmpBuf.data(), "\f%05d%s\f%05d", TargetColor(0xFFu, 0xFFu, 0x9Bu), v31, TargetColor(0xFFu, 0xFFu, 0xFFu));
3477 sprintfex(pTmpBuf2.data(), bountyHunting_text, pTmpBuf.data(), 100 * (unsigned __int8)v29[8]);
3478 current_npc_text = pTmpBuf2.data();
3479 strcpy(pButton->pButtonName, "");
3480 continue;
3481 }
3482 if ( pButton->msg_param != 93 )
3483 {
3484 strcpy(pButton->pButtonName, "");
3485 continue;
3486 }
3487 }
3488 else
3489 {
3490 if ( pButton->msg_param == 24 )//evt_F
3491 {
3492 v15 = (char *)pNPCTopics[pNPC->evt_F-1].pTopic;
3493 if ( !v15 )
3494 {
3495 pButton->msg_param = 0;
3496 v15 = "";
3497 }
3498 strcpy(pButton->pButtonName, v15);
3499 continue;
3500 }
3501 v18 = pButton->msg_param - 13;
3502 if ( v18 )
3503 {
3504 if ( pButton->msg_param == 19 )//evt_A
3505 {
3506 v15 = (char *)pNPCTopics[pNPC->evt_A-1].pTopic;
3507 if ( !v15 )
3508 {
3509 pButton->msg_param = 0;
3510 v15 = "";
3511 }
3512 strcpy(pButton->pButtonName, v15);
3513 continue;
3514 }
3515 if ( pButton->msg_param == 20 )//evt_B
3516 {
3517 v15 = (char *)pNPCTopics[pNPC->evt_B-1].pTopic;
3518 if ( !v15 )
3519 {
3520 pButton->msg_param = 0;
3521 v15 = "";
3522 } 3464 }
3523 if ( uDialogueType != 84 ) 3465 if ( uDialogueType != 84 )
3524 { 3466 {
3525 strcpy(pButton->pButtonName, v15); 3467 strcpy(pButton->pButtonName, v15);
3526 continue; 3468 continue;
3528 sprintf(pTmpBuf.data(), format_4E2D80, TargetColor(0xE1u, 0xCDu, 0x23u), pItemsTable->pItems[contract_approved].pUnidentifiedName); 3470 sprintf(pTmpBuf.data(), format_4E2D80, TargetColor(0xE1u, 0xCDu, 0x23u), pItemsTable->pItems[contract_approved].pUnidentifiedName);
3529 sprintf(pTmpBuf2.data(), current_npc_text, pTmpBuf.data()); 3471 sprintf(pTmpBuf2.data(), current_npc_text, pTmpBuf.data());
3530 current_npc_text = pTmpBuf2.data(); 3472 current_npc_text = pTmpBuf2.data();
3531 strcpy(pButton->pButtonName, v15); 3473 strcpy(pButton->pButtonName, v15);
3532 continue; 3474 continue;
3533 } 3475 case 21://evt_C
3534 if ( pButton->msg_param == 21 )//evt_C
3535 {
3536 v15 = (char *)pNPCTopics[pNPC->evt_C-1].pTopic; 3476 v15 = (char *)pNPCTopics[pNPC->evt_C-1].pTopic;
3537 if ( !v15 ) 3477 if ( !v15 )
3538 { 3478 {
3539 pButton->msg_param = 0; 3479 pButton->msg_param = 0;
3540 v15 = ""; 3480 v15 = "";
3541 } 3481 }
3542 strcpy(pButton->pButtonName, v15); 3482 strcpy(pButton->pButtonName, v15);
3543 continue; 3483 continue;
3544 } 3484 case 22://evt_D
3545 if ( pButton->msg_param == 22 )//evt_D
3546 {
3547 v15 = (char *)pNPCTopics[pNPC->evt_D-1].pTopic; 3485 v15 = (char *)pNPCTopics[pNPC->evt_D-1].pTopic;
3548 if ( !v15 ) 3486 if ( !v15 )
3549 { 3487 {
3550 pButton->msg_param = 0; 3488 pButton->msg_param = 0;
3551 v15 = ""; 3489 v15 = "";
3552 } 3490 }
3553 strcpy(pButton->pButtonName, v15); 3491 strcpy(pButton->pButtonName, v15);
3554 continue; 3492 continue;
3555 } 3493 case 23://evt_E
3556 if ( pButton->msg_param == 23 )//evt_E
3557 {
3558 v15 = (char *)pNPCTopics[pNPC->evt_E-1].pTopic; 3494 v15 = (char *)pNPCTopics[pNPC->evt_E-1].pTopic;
3559 if ( !v15 ) 3495 if ( !v15 )
3560 { 3496 {
3561 pButton->msg_param = 0; 3497 pButton->msg_param = 0;
3562 v15 = ""; 3498 v15 = "";
3563 } 3499 }
3564 strcpy(pButton->pButtonName, v15); 3500 strcpy(pButton->pButtonName, v15);
3565 continue; 3501 continue;
3566 } 3502 case 24://evt_F
3503 v15 = (char *)pNPCTopics[pNPC->evt_F-1].pTopic;
3504 if ( !v15 )
3505 {
3506 pButton->msg_param = 0;
3507 v15 = "";
3508 }
3509 strcpy(pButton->pButtonName, v15);
3510 continue;
3511 case 76:
3512 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[406]);//Нанять
3513 continue;
3514 case 77:
3515 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[407]);//Подробнее
3516 continue;
3517 case 79:
3518 strcpy(pButton->pButtonName, _4B254D_SkillMasteryTeacher((int)right_panel_window.ptr_1C));
3519 continue;
3520 case 82:
3521 strcpy(pButton->pButtonName, ContractSelectText((int)right_panel_window.ptr_1C));
3522 continue;
3523 case 83:
3524 v29 = pMonsterStats->pInfos[bountyHunting_monster_id_for_hunting].pName;
3525 v31 = *(int *)v29;
3526 sprintfex(pTmpBuf.data(), "\f%05d%s\f%05d", TargetColor(0xFFu, 0xFFu, 0x9Bu), v31, TargetColor(0xFFu, 0xFFu, 0xFFu));
3527 sprintfex(pTmpBuf2.data(), bountyHunting_text, pTmpBuf.data(), 100 * (unsigned __int8)v29[8]);
3528 current_npc_text = pTmpBuf2.data();
3529 strcpy(pButton->pButtonName, "");
3530 continue;
3531 }
3532 if ( pButton->msg_param < 13 )
3533 {
3534 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[122]);//Вступить
3535 continue;
3536 }
3537 if ( pButton->msg_param > 13 && pButton->msg_param < 19 )
3538 {
3567 strcpy(pButton->pButtonName, ""); 3539 strcpy(pButton->pButtonName, "");
3568 continue; 3540 continue;
3569 } 3541 }
3570 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[122]);//Вступить 3542 if ( pButton->msg_param != 93 )
3571 } 3543 {
3572 } 3544 strcpy(pButton->pButtonName, "");
3573 } 3545 continue;
3546 }
3547 }
3574 v34 = 0; 3548 v34 = 0;
3575 v36 = pDialogueWindow->pStartingPosActiveItem; 3549 v36 = pDialogueWindow->pStartingPosActiveItem;
3576 for ( i = v36 + pDialogueWindow->pNumPresenceButton; (signed int)v36 < (signed int)i; i = pDialogueWindow->pNumPresenceButton 3550 for ( i = v36 + pDialogueWindow->pNumPresenceButton; (signed int)v36 < (signed int)i; i = pDialogueWindow->pNumPresenceButton
3577 + pDialogueWindow->pStartingPosActiveItem ) 3551 + pDialogueWindow->pStartingPosActiveItem )
3578 { 3552 {
3579 v37 = pDialogueWindow->GetControl(v36); 3553 v37 = pDialogueWindow->GetControl(v36);
3580 v38 = pFontArrus->CalcTextHeight(v37->pButtonName, &v52, 0, 0); 3554 v38 = pFontArrus->CalcTextHeight(v37->pButtonName, &right_panel_window, 0, 0);
3581 v34 += v38; 3555 v34 += v38;
3582 ++v36; 3556 ++v36;
3583 } 3557 }
3584 v39 = pDialogueWindow->pNumPresenceButton; 3558 v39 = pDialogueWindow->pNumPresenceButton;
3585 if ( v39 ) 3559 if ( v39 )
3593 { 3567 {
3594 pButton = pDialogueWindow->GetControl(i); 3568 pButton = pDialogueWindow->GetControl(i);
3595 //v42 = v41; 3569 //v42 = v41;
3596 v43 = pButton->pButtonName; 3570 v43 = pButton->pButtonName;
3597 pButton->uY = (unsigned int)((char *)pNPC + v40); 3571 pButton->uY = (unsigned int)((char *)pNPC + v40);
3598 v44 = pFontArrus->CalcTextHeight(pButton->pButtonName, &v52, 0, 0); 3572 v44 = pFontArrus->CalcTextHeight(pButton->pButtonName, &right_panel_window, 0, 0);
3599 v45 = pButton->uY; 3573 v45 = pButton->uY;
3600 pButton->uHeight = v44; 3574 pButton->uHeight = v44;
3601 v40 = v45 + v44 - 1; 3575 v40 = v45 + v44 - 1;
3602 pButton->uW = v40; 3576 pButton->uW = v40;
3603 v46 = TargetColor(0xE1u, 0xCDu, 0x23u); 3577 v46 = TargetColor(0xE1u, 0xCDu, 0x23u);
3604 if ( (char *)pDialogueWindow->pCurrentPosActiveItem != pInString ) 3578 if ( (char *)pDialogueWindow->pCurrentPosActiveItem != pInString )
3605 v46 = TargetColor(0xFFu, 0xFFu, 0xFFu); 3579 v46 = TargetColor(0xFFu, 0xFFu, 0xFFu);
3606 v52.DrawTitleText(pFontArrus, 0, v45, v46, v43, 3); 3580 right_panel_window.DrawTitleText(pFontArrus, 0, v45, v46, v43, 3);
3607 ++pInString; 3581 ++pInString;
3608 } 3582 }
3609 } 3583 }
3610 if ( current_npc_text ) 3584 if ( current_npc_text )
3611 { 3585 {