Mercurial > mm7
comparison mm7_4.cpp @ 1411:2423bc2af692
+InitializaDialogueOptions
+InitializaDialogueOptions_Shops
+InitializaDialogueOptions_Tavern
author | Nomad |
---|---|
date | Fri, 26 Jul 2013 23:35:34 +0200 |
parents | 38df78aba732 |
children | 3881d2f94eb1 |
comparison
equal
deleted
inserted
replaced
1410:38df78aba732 | 1411:2423bc2af692 |
---|---|
3537 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534], | 3537 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534], |
3538 pGlobalTXT_LocalizationStrings[225], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Великий Магистр | 3538 pGlobalTXT_LocalizationStrings[225], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Великий Магистр |
3539 return pTmpBuf2.data(); | 3539 return pTmpBuf2.data(); |
3540 } | 3540 } |
3541 | 3541 |
3542 //----- (004B3A72) -------------------------------------------------------- | |
3543 void sub_4B3A72( int a1 ) | |
3544 { | |
3545 int num_buttons; // esi@1 | |
3546 | |
3547 num_buttons = 0; | |
3548 if ( a1 == 21 ) | |
3549 { | |
3550 CreateButtonInColumn(0, 0x66u); | |
3551 num_buttons = 2; | |
3552 CreateButtonInColumn(1, 0x67u); | |
3553 if ( pParty->HasItem(651) ) //Arcomage Deck | |
3554 { | |
3555 num_buttons = 3; | |
3556 CreateButtonInColumn(2, 0x68u); | |
3557 } | |
3558 } | |
3559 pDialogueWindow->_41D08F_set_keyboard_control_group(num_buttons, 1, 0, 2); | |
3560 dword_F8B1E0 = pDialogueWindow->pNumPresenceButton; | |
3561 } | |
3562 // F8B1E0: using guessed type int dword_F8B1E0; | |
3563 | |
3564 //----- (004B3AD4) -------------------------------------------------------- | |
3565 void sub_4B3AD4( signed int a1 ) | |
3566 { | |
3567 if ( a1 > 0 ) | |
3568 { | |
3569 if ( a1 <= 3 ) | |
3570 { | |
3571 CreateButtonInColumn(0, 3u); | |
3572 CreateButtonInColumn(1, 4u); | |
3573 CreateButtonInColumn(2, 5u); | |
3574 pDialogueWindow->_41D08F_set_keyboard_control_group(3, 1, 0, 2); | |
3575 } | |
3576 if ( a1 == 4 ) | |
3577 { | |
3578 CreateButtonInColumn(0, 3u); | |
3579 CreateButtonInColumn(1, 4u); | |
3580 pDialogueWindow->_41D08F_set_keyboard_control_group(2, 1, 0, 2); | |
3581 } | |
3582 } | |
3583 dword_F8B1E0 = pDialogueWindow->pNumPresenceButton; | |
3584 } | |
3585 // F8B1E0: using guessed type int dword_F8B1E0; | |
3586 | |
3587 //----- (004B3B42) -------------------------------------------------------- | |
3588 void sub_4B3B42( signed int a1 ) | |
3589 { | |
3590 int v1; // ecx@18 | |
3591 int v2; // ecx@19 | |
3592 int v3; // ecx@20 | |
3593 signed int v4; // esi@22 | |
3594 signed int v5; // eax@22 | |
3595 unsigned int v6; // edx@24 | |
3596 int v7; // ecx@24 | |
3597 int result; // eax@43 | |
3598 int v9; // [sp-10h] [bp-14h]@28 | |
3599 int v10; // [sp-Ch] [bp-10h]@28 | |
3600 int v11; // [sp-8h] [bp-Ch]@28 | |
3601 unsigned int v12; // [sp-4h] [bp-8h]@4 | |
3602 unsigned int v13; // [sp-4h] [bp-8h]@5 | |
3603 unsigned int v14; // [sp-4h] [bp-8h]@9 | |
3604 unsigned int v15; // [sp-4h] [bp-8h]@10 | |
3605 unsigned int v16; // [sp-4h] [bp-8h]@14 | |
3606 int v17; // [sp-4h] [bp-8h]@28 | |
3607 | |
3608 if ( a1 > 13 ) | |
3609 { | |
3610 if ( a1 > 22 ) | |
3611 { | |
3612 if ( a1 == 23 ) | |
3613 { | |
3614 CreateButtonInColumn(0, 0xAu); | |
3615 CreateButtonInColumn(1, 0xBu); | |
3616 v14 = 96; | |
3617 LABEL_41: | |
3618 CreateButtonInColumn(2, v14); | |
3619 v17 = 2; | |
3620 v11 = 0; | |
3621 v10 = 1; | |
3622 v9 = 3; | |
3623 goto LABEL_42; | |
3624 } | |
3625 if ( a1 <= 26 ) | |
3626 goto LABEL_43; | |
3627 if ( a1 > 28 ) | |
3628 { | |
3629 if ( a1 != 30 ) | |
3630 goto LABEL_43; | |
3631 CreateButtonInColumn(0, 0x11u); | |
3632 v16 = 96; | |
3633 goto LABEL_37; | |
3634 } | |
3635 CreateButtonInColumn(0, 0x69u); | |
3636 CreateButtonInColumn(1, 0x6Au); | |
3637 CreateButtonInColumn(2, 0x6Bu); | |
3638 v12 = 108; | |
3639 } | |
3640 else | |
3641 { | |
3642 if ( a1 == 22 ) | |
3643 { | |
3644 CreateButtonInColumn(0, 7u); | |
3645 v16 = 8; | |
3646 goto LABEL_37; | |
3647 } | |
3648 v1 = a1 - 14; | |
3649 if ( !v1 ) | |
3650 { | |
3651 CreateButtonInColumn(0, 0x12u); | |
3652 CreateButtonInColumn(1, 0x30u); | |
3653 CreateButtonInColumn(2, 0x31u); | |
3654 CreateButtonInColumn(3, 0x32u); | |
3655 CreateButtonInColumn(4, 0x33u); | |
3656 v17 = 2; | |
3657 v11 = 0; | |
3658 v10 = 1; | |
3659 v9 = 5; | |
3660 goto LABEL_42; | |
3661 } | |
3662 v2 = v1 - 1; | |
3663 if ( v2 ) | |
3664 { | |
3665 v3 = v2 - 2; | |
3666 if ( v3 ) | |
3667 { | |
3668 if ( v3 != 4 ) | |
3669 goto LABEL_43; | |
3670 CreateButtonInColumn(0, 0xFu); | |
3671 CreateButtonInColumn(1, 0x10u); | |
3672 v4 = 3; | |
3673 CreateButtonInColumn(2, 0x60u); | |
3674 v5 = (signed int)window_SpeakInHouse->ptr_1C; | |
3675 if ( v5 < 108 || v5 > 120 ) | |
3676 goto LABEL_28; | |
3677 v4 = 4; | |
3678 v6 = 101; | |
3679 v7 = 3; | |
3680 } | |
3681 else | |
3682 { | |
3683 v4 = 1; | |
3684 CreateButtonInColumn(0, 0x63u); | |
3685 if ( !pParty->uFine ) | |
3686 { | |
3687 LABEL_28: | |
3688 v17 = 2; | |
3689 v11 = 0; | |
3690 v10 = 1; | |
3691 v9 = v4; | |
3692 LABEL_42: | |
3693 pDialogueWindow->_41D08F_set_keyboard_control_group(v9, v10, v11, v17); | |
3694 goto LABEL_43; | |
3695 } | |
3696 v4 = 2; | |
3697 v7 = 1; | |
3698 v6 = 100; | |
3699 } | |
3700 CreateButtonInColumn(v7, v6); | |
3701 goto LABEL_28; | |
3702 } | |
3703 CreateButtonInColumn(0, 0x12u); | |
3704 CreateButtonInColumn(1, 0x34u); | |
3705 CreateButtonInColumn(2, 0x35u); | |
3706 v12 = 54; | |
3707 } | |
3708 LABEL_39: | |
3709 CreateButtonInColumn(3, v12); | |
3710 v17 = 2; | |
3711 v11 = 0; | |
3712 v10 = 1; | |
3713 v9 = 4; | |
3714 goto LABEL_42; | |
3715 } | |
3716 if ( a1 == 13 ) | |
3717 { | |
3718 CreateButtonInColumn(0, 0x12u); | |
3719 v16 = 56; | |
3720 LABEL_37: | |
3721 CreateButtonInColumn(1, v16); | |
3722 v17 = 2; | |
3723 v11 = 0; | |
3724 v10 = 1; | |
3725 v9 = 2; | |
3726 goto LABEL_42; | |
3727 } | |
3728 switch ( a1 ) | |
3729 { | |
3730 case 1: | |
3731 case 2: | |
3732 case 3: | |
3733 case 4: | |
3734 CreateButtonInColumn(0, 2u); | |
3735 CreateButtonInColumn(1, 0x5Fu); | |
3736 CreateButtonInColumn(2, 0x5Eu); | |
3737 v12 = 96; | |
3738 goto LABEL_39; | |
3739 case 5: | |
3740 CreateButtonInColumn(0, 0x12u); | |
3741 v13 = 48; | |
3742 goto LABEL_9; | |
3743 case 6: | |
3744 CreateButtonInColumn(0, 0x12u); | |
3745 v13 = 49; | |
3746 goto LABEL_9; | |
3747 case 7: | |
3748 CreateButtonInColumn(0, 0x12u); | |
3749 v13 = 50; | |
3750 goto LABEL_9; | |
3751 case 8: | |
3752 CreateButtonInColumn(0, 0x12u); | |
3753 v13 = 51; | |
3754 LABEL_9: | |
3755 CreateButtonInColumn(1, v13); | |
3756 v14 = 72; | |
3757 goto LABEL_41; | |
3758 case 9: | |
3759 CreateButtonInColumn(0, 0x12u); | |
3760 v15 = 52; | |
3761 goto LABEL_13; | |
3762 case 10: | |
3763 CreateButtonInColumn(0, 0x12u); | |
3764 v15 = 53; | |
3765 goto LABEL_13; | |
3766 case 11: | |
3767 CreateButtonInColumn(0, 0x12u); | |
3768 v15 = 54; | |
3769 LABEL_13: | |
3770 CreateButtonInColumn(1, v15); | |
3771 v14 = 61; | |
3772 goto LABEL_41; | |
3773 case 12: | |
3774 CreateButtonInColumn(0, 0x12u); | |
3775 v16 = 55; | |
3776 goto LABEL_37; | |
3777 default: | |
3778 break; | |
3779 } | |
3780 LABEL_43: | |
3781 dword_F8B1E0 = pDialogueWindow->pNumPresenceButton; | |
3782 } | |
3783 // F8B1E0: using guessed type int dword_F8B1E0; | |
3784 | |
3785 //----- (004B3E1E) -------------------------------------------------------- | 3542 //----- (004B3E1E) -------------------------------------------------------- |
3786 void __cdecl sub_4B3E1E() | 3543 void __cdecl sub_4B3E1E() |
3787 { | 3544 { |
3788 NPCData *v0; // ST40_4@1 | 3545 NPCData *v0; // ST40_4@1 |
3789 signed int v1; // edi@1 | 3546 signed int v1; // edi@1 |
3809 //----- (004B3FE5) -------------------------------------------------------- | 3566 //----- (004B3FE5) -------------------------------------------------------- |
3810 void __fastcall sub_4B3FE5(int a4) | 3567 void __fastcall sub_4B3FE5(int a4) |
3811 { | 3568 { |
3812 int v1; // edi@1 | 3569 int v1; // edi@1 |
3813 char *v2; // edi@1 | 3570 char *v2; // edi@1 |
3814 | 3571 |
3572 __debugbreak(); | |
3815 v1 = a4; | 3573 v1 = a4; |
3816 uDialogueType = 78; | 3574 uDialogueType = 78; |
3817 current_npc_text = (char *)pNPCTopics[a4 + 168].pText; | 3575 current_npc_text = (char *)pNPCTopics[a4 + 168].pText; |
3818 _4B254D_SkillMasteryTeacher(a4); | 3576 _4B254D_SkillMasteryTeacher(a4); |
3819 pDialogueWindow->Release(); | 3577 pDialogueWindow->Release(); |
3831 // F8B19C: using guessed type int dword_F8B19C; | 3589 // F8B19C: using guessed type int dword_F8B19C; |
3832 // F8B1A8: using guessed type int dword_F8B1A8; | 3590 // F8B1A8: using guessed type int dword_F8B1A8; |
3833 | 3591 |
3834 //----- (004B46A5) -------------------------------------------------------- | 3592 //----- (004B46A5) -------------------------------------------------------- |
3835 void __fastcall DrawTextAtStatusBar( const char *Str, int a5 ) | 3593 void __fastcall DrawTextAtStatusBar( const char *Str, int a5 ) |
3836 { | 3594 { |
3837 int v4; // eax@1 | 3595 int v4; // eax@1 |
3838 pRenderer->DrawTextureRGB(0, 352, pTexture_StatusBar); | 3596 pRenderer->DrawTextureRGB(0, 352, pTexture_StatusBar); |
3839 v4 = pFontLucida->AlignText_Center(450, Str); | 3597 v4 = pFontLucida->AlignText_Center(450, Str); |
3840 pPrimaryWindow->DrawText(pFontLucida, v4 + 11, 357, a5, Str, 0, 0, 0); | 3598 pPrimaryWindow->DrawText(pFontLucida, v4 + 11, 357, a5, Str, 0, 0, 0); |
3841 } | 3599 } |
4091 if ( (p2DEvents[_2da_idx - 1].uType != 4 || (signed int)item->uItemID < 740 || (signed int)item->uItemID > 771) | 3849 if ( (p2DEvents[_2da_idx - 1].uType != 4 || (signed int)item->uItemID < 740 || (signed int)item->uItemID > 771) |
4092 && ((signed int)item->uItemID >= 600 || (signed int)item->uItemID >= 529 && (signed int)item->uItemID <= 599) || item->Stolen()) | 3850 && ((signed int)item->uItemID >= 600 || (signed int)item->uItemID >= 529 && (signed int)item->uItemID <= 599) || item->Stolen()) |
4093 return 0; | 3851 return 0; |
4094 switch( p2DEvents[_2da_idx - 1].uType ) | 3852 switch( p2DEvents[_2da_idx - 1].uType ) |
4095 { | 3853 { |
4096 case BildingType_WeaponShop: | 3854 case BuildingType_WeaponShop: |
4097 { | 3855 { |
4098 test = pItemsTable->pItems[item->uItemID].uEquipType <= 2; | 3856 test = pItemsTable->pItems[item->uItemID].uEquipType <= 2; |
4099 break; | 3857 break; |
4100 } | 3858 } |
4101 case BildingType_ArmorShop: | 3859 case BuildingType_ArmorShop: |
4102 { | 3860 { |
4103 test = pItemsTable->pItems[item->uItemID].uEquipType >= 3; | 3861 test = pItemsTable->pItems[item->uItemID].uEquipType >= 3; |
4104 break; | 3862 break; |
4105 } | 3863 } |
4106 case BildingType_MagicShop: | 3864 case BuildingType_MagicShop: |
4107 { | 3865 { |
4108 test = pItemsTable->pItems[item->uItemID].uSkillType == 38 || pItemsTable->pItems[item->uItemID].uEquipType == 16; | 3866 test = pItemsTable->pItems[item->uItemID].uSkillType == 38 || pItemsTable->pItems[item->uItemID].uEquipType == 16; |
4109 break; | 3867 break; |
4110 } | 3868 } |
4111 case BildingType_AlchemistShop: | 3869 case BuildingType_AlchemistShop: |
4112 { | 3870 { |
4113 test = pItemsTable->pItems[item->uItemID].uEquipType == 13 || pItemsTable->pItems[item->uItemID].uEquipType == 14 | 3871 test = pItemsTable->pItems[item->uItemID].uEquipType == 13 || pItemsTable->pItems[item->uItemID].uEquipType == 14 |
4114 || (pItemsTable->pItems[item->uItemID].uEquipType > 14 && !(pItemsTable->pItems[item->uItemID].uEquipType != 17 | 3872 || (pItemsTable->pItems[item->uItemID].uEquipType > 14 && !(pItemsTable->pItems[item->uItemID].uEquipType != 17 |
4115 || (signed int)item->uItemID < 740) && item->uItemID != 771); | 3873 || (signed int)item->uItemID < 740) && item->uItemID != 771); |
4116 break; | 3874 break; |