Mercurial > mm7
comparison mm7_2.cpp @ 548:0ca16f606be8
TavernDialog clean
author | zipi |
---|---|
date | Sun, 03 Mar 2013 20:11:22 +0000 |
parents | 4475d81889e6 |
children | b8339415fa98 9caf59edb1ee |
comparison
equal
deleted
inserted
replaced
547:4475d81889e6 | 548:0ca16f606be8 |
---|---|
568 if ( v7 <= 0 ) | 568 if ( v7 <= 0 ) |
569 { | 569 { |
570 v7 = 1; | 570 v7 = 1; |
571 v83 = 1; | 571 v83 = 1; |
572 } | 572 } |
573 if ( dword_F8B19C > 101 ) | 573 switch(dword_F8B19C) |
574 { | 574 { |
575 if ( dword_F8B19C == 102 ) | 575 case 102: |
576 { | 576 { |
577 v65 = pFontArrus; | 577 v65 = pFontArrus; |
578 pOutString = pFontArrus; | 578 pOutString = pFontArrus; |
579 strcpy(pTmpBuf, pNPCTopics[354].pText); | 579 strcpy(pTmpBuf, pNPCTopics[354].pText); |
580 v78.uFrameWidth = 460; | 580 v78.uFrameWidth = 460; |
581 v78.uFrameZ = 452; | 581 v78.uFrameZ = 452; |
582 v62 = v65->CalcTextHeight(pTmpBuf, &v78, 12, 0) + 7; | 582 v62 = v65->CalcTextHeight(pTmpBuf, &v78, 12, 0) + 7; |
583 if ( 352 - v62 < 8 ) | 583 if ( 352 - v62 < 8 ) |
584 { | 584 { |
585 pOutString = pFontCreate; | 585 pOutString = pFontCreate; |
586 v62 = pFontCreate->CalcTextHeight(pTmpBuf, &v78, 12, 0) + 7; | 586 v62 = pFontCreate->CalcTextHeight(pTmpBuf, &v78, 12, 0) + 7; |
587 } | 587 } |
588 | 588 |
589 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0); | 589 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0); |
590 pRenderer->_4A6A68( | 590 pRenderer->_4A6A68(8u, 352 - v62, pTex, (pTex ? pTex->uTextureHeight : 26) - v62); |
591 8u, | 591 |
592 352 - v62, | 592 pRenderer->DrawTextureIndexed(8u, 347 - v62, pTexture_591428); |
593 pTex, | 593 v73 = 0; |
594 (pTex ? pTex->uTextureHeight : 26) - v62); | 594 v70 = 0; |
595 | 595 v68 = 0; |
596 pRenderer->DrawTextureIndexed(8u, 347 - v62, pTexture_591428); | 596 v63 = FitTextInAWindow(pTmpBuf, pOutString, &v78, 0xCu, 0); |
597 v73 = 0; | 597 v64 = pOutString; |
598 v70 = 0; | 598 window_SpeakInHouse->DrawText(v64, 12, 354 - v62, 0, v63, v68, v70, v73); |
599 v68 = 0; | 599 break; |
600 v63 = FitTextInAWindow(pTmpBuf, pOutString, &v78, 0xCu, 0); | 600 } |
601 v64 = pOutString; | 601 case 103: |
602 } | 602 { |
603 else | 603 strcpy(pTmpBuf, pNPCTopics[(uint)window_SpeakInHouse->ptr_1C + 247].pText); |
604 { | 604 v78.uFrameWidth = 460; |
605 if ( dword_F8B19C != 103 ) | 605 v78.uFrameZ = 452; |
606 { | 606 v61 = pFontArrus->CalcTextHeight(pTmpBuf, &v78, 12, 0); |
607 if ( dword_F8B19C != 104 || pArcomageGame->bGameInProgress == 1 ) | 607 v62 = v61 + 7; |
608 | |
609 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : nullptr); | |
610 pRenderer->_4A6A68(8u, 352 - (v61 + 7), pTex, (pTex ? pTex->uTextureHeight : 26) - (v61 + 7)); | |
611 | |
612 pRenderer->DrawTextureIndexed(8u, 347 - v62, pTexture_591428); | |
613 v73 = 0; | |
614 v70 = 0; | |
615 v68 = 0; | |
616 v63 = FitTextInAWindow(pTmpBuf, pFontArrus, &v78, 0xCu, 0); | |
617 v64 = pFontArrus; | |
618 window_SpeakInHouse->DrawText(v64, 12, 354 - v62, 0, v63, v68, v70, v73); | |
619 break; | |
620 } | |
621 case 104: | |
622 { | |
623 if ( pArcomageGame->bGameInProgress == 1 ) | |
608 return; | 624 return; |
609 v26 = pTmpBuf; | 625 v26 = pTmpBuf; |
610 if ( pArcomageGame->uGameResult ) | 626 if ( pArcomageGame->uGameResult ) |
611 { | 627 { |
612 if ( pArcomageGame->uGameResult == 1 ) | 628 if ( pArcomageGame->uGameResult == 1 ) |
617 else | 633 else |
618 { | 634 { |
619 v72 = pGlobalTXT_LocalizationStrings[639];// A tie! | 635 v72 = pGlobalTXT_LocalizationStrings[639];// A tie! |
620 } | 636 } |
621 strcpy(pTmpBuf, v72); | 637 strcpy(pTmpBuf, v72); |
622 LABEL_97: | 638 //LABEL_97: |
623 v71 = 3; | 639 v71 = 3; |
624 v69 = v26; | 640 v69 = v26; |
625 v67 = v84[0]; | 641 v67 = v84[0]; |
626 v66 = (174 - pFontArrus->CalcTextHeight(v26, &v79, 0, 0)) / 2 + 138; | 642 v66 = (174 - pFontArrus->CalcTextHeight(v26, &v79, 0, 0)) / 2 + 138; |
627 goto LABEL_98; | 643 v79.DrawTitleText(pFontArrus, 0, v66, v67, v69, v71); |
628 } | 644 break; |
629 strcpy(pTmpBuf, pNPCTopics[(uint)window_SpeakInHouse->ptr_1C + 247].pText); | 645 } |
630 v78.uFrameWidth = 460; | 646 case 15: |
631 v78.uFrameZ = 452; | 647 { |
632 v61 = pFontArrus->CalcTextHeight(pTmpBuf, &v78, 12, 0); | |
633 v62 = v61 + 7; | |
634 | |
635 auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : nullptr); | |
636 pRenderer->_4A6A68( | |
637 8u, | |
638 352 - (v61 + 7), | |
639 pTex, | |
640 (pTex ? pTex->uTextureHeight : 26) - (v61 + 7)); | |
641 | |
642 pRenderer->DrawTextureIndexed(8u, 347 - v62, pTexture_591428); | |
643 v73 = 0; | |
644 v70 = 0; | |
645 v68 = 0; | |
646 v63 = FitTextInAWindow(pTmpBuf, pFontArrus, &v78, 0xCu, 0); | |
647 v64 = pFontArrus; | |
648 } | |
649 window_SpeakInHouse->DrawText(v64, 12, 354 - v62, 0, v63, v68, v70, v73); | |
650 return; | |
651 } | |
652 if ( dword_F8B19C != 101 ) | |
653 { | |
654 if ( dword_F8B19C != 1 ) | |
655 { | |
656 if ( dword_F8B19C == 15 ) | |
657 { | |
658 if ( pParty->uNumGold >= (unsigned int)pOutString ) | 648 if ( pParty->uNumGold >= (unsigned int)pOutString ) |
659 { | 649 { |
660 Party::TakeGold((unsigned int)pOutString); | 650 Party::TakeGold((unsigned int)pOutString); |
661 v27 = (int)window_SpeakInHouse->ptr_1C; | 651 v27 = (int)window_SpeakInHouse->ptr_1C; |
662 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); | 652 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); |
675 pMessageQueue_50CBD0->pMessages[0].field_8 = 1; | 665 pMessageQueue_50CBD0->pMessages[0].field_8 = 1; |
676 //LABEL_51: | 666 //LABEL_51: |
677 ++pMessageQueue_50CBD0->uNumMessages; | 667 ++pMessageQueue_50CBD0->uNumMessages; |
678 return; | 668 return; |
679 } | 669 } |
680 } | 670 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); |
681 else | 671 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 4); |
682 { | 672 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0); |
683 if ( dword_F8B19C != 16 ) | 673 break; |
684 { | 674 } |
685 if ( dword_F8B19C != 96 || !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 675 case 96: |
686 return; | 676 { |
687 v8 = pDialogueWindow; | 677 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
688 *(float *)&v89 = 0.0; | 678 return; |
689 | 679 v8 = pDialogueWindow; |
690 //v9 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0); | 680 *(float *)&v89 = 0.0; |
691 v9 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); | 681 |
692 | 682 //v9 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0); |
693 pOutString = (GUIFont *)(v9 * (100 - v85->GetMerchant()) / 100); | 683 v9 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); |
694 if ( (signed int)pOutString < v9 / 3 ) | 684 |
695 pOutString = (GUIFont *)(v9 / 3); | 685 pOutString = (GUIFont *)(v9 * (100 - v85->GetMerchant()) / 100); |
696 v10 = v8->pStartingPosActiveItem; | 686 if ( (signed int)pOutString < v9 / 3 ) |
697 v11 = v10 + v8->pNumPresenceButton; | 687 pOutString = (GUIFont *)(v9 / 3); |
698 v86 = 0; | 688 v10 = v8->pStartingPosActiveItem; |
699 if ( (signed int)v10 < v11 ) | 689 v11 = v10 + v8->pNumPresenceButton; |
700 { | 690 v86 = 0; |
701 do | 691 if ( (signed int)v10 < v11 ) |
702 { | 692 { |
703 v12 = v8->GetControl(v10)->uControlParam - 36; | 693 do |
704 if ( byte_4ED970_skill_learn_ability_by_class_table[v85->classType][v12] && !v85->pActiveSkills[v12] ) | 694 { |
705 { | 695 v12 = v8->GetControl(v10)->uControlParam - 36; |
706 v13 = pFontArrus->CalcTextHeight(pSkillNames[v12], &v79, 0, 0); | 696 if ( byte_4ED970_skill_learn_ability_by_class_table[v85->classType][v12] && !v85->pActiveSkills[v12] ) |
707 v89 += v13; | 697 { |
708 ++v86; | 698 v13 = pFontArrus->CalcTextHeight(pSkillNames[v12], &v79, 0, 0); |
709 } | 699 v89 += v13; |
710 ++v10; | 700 ++v86; |
711 } | 701 } |
712 while ( (signed int)v10 < v8->pStartingPosActiveItem + v8->pNumPresenceButton ); | 702 ++v10; |
713 if ( v86 ) | 703 } |
714 { | 704 while ( (signed int)v10 < v8->pStartingPosActiveItem + v8->pNumPresenceButton ); |
715 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], pOutString); | 705 if ( v86 ) |
716 v79.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); | 706 { |
717 pOutString = (GUIFont *)((149 - v89) / v86); | 707 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], pOutString); |
718 if ( (149 - v89) / v86 > 32 ) | 708 v79.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); |
719 pOutString = (GUIFont *)32; | 709 pOutString = (GUIFont *)((149 - v89) / v86); |
720 v14 = (149 - v86 * (signed int)pOutString - v89) / 2 - (signed int)pOutString / 2 + 162; | 710 if ( (149 - v89) / v86 > 32 ) |
721 v89 = v8->pStartingPosActiveItem; | 711 pOutString = (GUIFont *)32; |
722 v83 = v14; | 712 v14 = (149 - v86 * (signed int)pOutString - v89) / 2 - (signed int)pOutString / 2 + 162; |
723 if ( v89 < v89 + v8->pNumPresenceButton ) | 713 v89 = v8->pStartingPosActiveItem; |
724 { | 714 v83 = v14; |
725 v86 = 2; | 715 if ( v89 < v89 + v8->pNumPresenceButton ) |
726 do | 716 { |
727 { | 717 v86 = 2; |
728 v15 = v8->GetControl(v89); | 718 do |
729 v16 = v15; | 719 { |
730 v17 = v15->uControlParam - 36; | 720 v15 = v8->GetControl(v89); |
731 if ( !byte_4ED970_skill_learn_ability_by_class_table[v85->classType][v17] || v85->pActiveSkills[v17] ) | 721 v16 = v15; |
732 { | 722 v17 = v15->uControlParam - 36; |
733 v16->uW = 0; | 723 if ( !byte_4ED970_skill_learn_ability_by_class_table[v85->classType][v17] || v85->pActiveSkills[v17] ) |
734 v16->uHeight = 0; | 724 { |
735 v16->uY = 0; | 725 v16->uW = 0; |
736 } | 726 v16->uHeight = 0; |
737 else | 727 v16->uY = 0; |
738 { | 728 } |
739 v18 = pSkillNames[v17]; | 729 else |
740 v16->uY = (unsigned int)((char *)pOutString + v83); | 730 { |
741 Str[1] = v18; | 731 v18 = pSkillNames[v17]; |
742 v19 = pFontArrus->CalcTextHeight(v18, &v79, 0, 0); | 732 v16->uY = (unsigned int)((char *)pOutString + v83); |
743 v20 = v16->uY; | 733 Str[1] = v18; |
744 v21 = v86; | 734 v19 = pFontArrus->CalcTextHeight(v18, &v79, 0, 0); |
745 v16->uHeight = v19; | 735 v20 = v16->uY; |
746 v22 = v19 + v20 - 1; | 736 v21 = v86; |
747 v16->uW = v22; | 737 v16->uHeight = v19; |
748 v83 = v22; | 738 v22 = v19 + v20 - 1; |
749 v23 = v84[0]; | 739 v16->uW = v22; |
750 if ( pDialogueWindow->pCurrentPosActiveItem != v21 ) | 740 v83 = v22; |
751 v23 = v81; | 741 v23 = v84[0]; |
752 v79.DrawTitleText(pFontArrus, 0, v20, v23, Str[1], 3u); | 742 if ( pDialogueWindow->pCurrentPosActiveItem != v21 ) |
753 } | 743 v23 = v81; |
754 v24 = v8->pNumPresenceButton; | 744 v79.DrawTitleText(pFontArrus, 0, v20, v23, Str[1], 3u); |
755 ++v89; | 745 } |
756 v25 = v8->pStartingPosActiveItem + v24; | 746 v24 = v8->pNumPresenceButton; |
757 ++v86; | 747 ++v89; |
758 } | 748 v25 = v8->pStartingPosActiveItem + v24; |
759 while ( v89 < v25 ); | 749 ++v86; |
760 } | 750 } |
761 return; | 751 while ( v89 < v25 ); |
762 } | 752 } |
763 } | 753 return; |
764 v26 = pTmpBuf; | 754 } |
765 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v85->pName, pClassNames[v85->classType]); | 755 } |
766 strcat(pTmpBuf, "\n \n"); | 756 v26 = pTmpBuf; |
767 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); | 757 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v85->pName, pClassNames[v85->classType]); |
768 goto LABEL_97; | 758 strcat(pTmpBuf, "\n \n"); |
769 } | 759 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); |
760 v71 = 3; | |
761 v69 = v26; | |
762 v67 = v84[0]; | |
763 v66 = (174 - pFontArrus->CalcTextHeight(v26, &v79, 0, 0)) / 2 + 138; | |
764 v79.DrawTitleText(pFontArrus, 0, v66, v67, v69, v71); | |
765 return; | |
766 break; | |
767 } | |
768 case 16: | |
769 { | |
770 *(_QWORD *)Str = pParty->uNumFoodRations; | 770 *(_QWORD *)Str = pParty->uNumFoodRations; |
771 //if ( (double)pParty->uNumFoodRations >= p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C] ) | 771 //if ( (double)pParty->uNumFoodRations >= p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C] ) |
772 if ( (double)pParty->uNumFoodRations >= p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier ) | 772 if ( (double)pParty->uNumFoodRations >= p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier ) |
773 { | 773 { |
774 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2u); | 774 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2u); |
775 if ( uActiveCharacter ) | 775 if ( uActiveCharacter ) |
776 pPlayers[uActiveCharacter]->PlaySound(SPEECH_67, 0); | 776 pPlayers[uActiveCharacter]->PlaySound(SPEECH_67, 0); |
777 goto LABEL_43; | 777 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0); |
778 return; | |
778 } | 779 } |
779 if ( pParty->uNumGold >= v7 ) | 780 if ( pParty->uNumGold >= v7 ) |
780 { | 781 { |
781 Party::TakeGold(v7); | 782 Party::TakeGold(v7); |
782 //pParty->uNumFoodRations = (signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C]; | 783 //pParty->uNumFoodRations = (signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C]; |
783 pParty->uNumFoodRations = (signed __int64)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier; | 784 pParty->uNumFoodRations = (signed __int64)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier; |
784 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 3); | 785 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 3); |
785 v5 = 1; | 786 v5 = 1; |
786 LABEL_43: | 787 //LABEL_43: |
787 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0); | 788 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0); |
788 return; | 789 return; |
789 //goto LABEL_51; | 790 //goto LABEL_51; |
790 } | 791 } |
791 } | 792 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); |
792 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); | 793 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 4); |
793 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 4); | 794 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, v5, 0); |
794 goto LABEL_43; | 795 break; |
795 } | 796 } |
796 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 797 case 1: |
797 return; | 798 { |
798 v28 = *(int *)v84; | 799 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
799 if ( pDialogueWindow->pCurrentPosActiveItem != 2 ) | 800 return; |
800 v28 = v81; | 801 v28 = *(int *)v84; |
801 sprintf(Dest, format_4E2DC8, v28); | 802 if ( pDialogueWindow->pCurrentPosActiveItem != 2 ) |
802 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[178], pOutString); | 803 v28 = v81; |
803 strcat(Dest, pTmpBuf2); | 804 sprintf(Dest, format_4E2DC8, v28); |
804 v90 = pFontArrus->CalcTextHeight(Dest, &v79, 0, 0); | 805 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[178], pOutString); |
805 strcat(Dest, "\n \n"); | 806 strcat(Dest, pTmpBuf2); |
806 v29 = *(int *)v84; | 807 v90 = pFontArrus->CalcTextHeight(Dest, &v79, 0, 0); |
807 if ( pDialogueWindow->pCurrentPosActiveItem != 3 ) | 808 strcat(Dest, "\n \n"); |
808 v29 = v81; | 809 v29 = *(int *)v84; |
809 sprintf(a1, format_4E2DC8, v29); | 810 if ( pDialogueWindow->pCurrentPosActiveItem != 3 ) |
810 sprintf(pTmpBuf2, | 811 v29 = v81; |
811 pGlobalTXT_LocalizationStrings[86], | 812 sprintf(a1, format_4E2DC8, v29); |
812 //(signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C], | 813 sprintf(pTmpBuf2, |
813 (signed __int64)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier, | 814 pGlobalTXT_LocalizationStrings[86], |
814 v83); | 815 //(signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C], |
815 strcat(a1, pTmpBuf2); | 816 (signed __int64)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier, |
816 v88 = pFontArrus->CalcTextHeight(a1, &v79, 0, 0); | 817 v83); |
817 strcat(a1, "\n \n"); | 818 strcat(a1, pTmpBuf2); |
818 v30 = *(int *)v84; | 819 v88 = pFontArrus->CalcTextHeight(a1, &v79, 0, 0); |
819 if ( pDialogueWindow->pCurrentPosActiveItem != 4 ) | 820 strcat(a1, "\n \n"); |
820 v30 = v81; | 821 v30 = *(int *)v84; |
821 sprintf(v77, format_4E2DC8, v30); | 822 if ( pDialogueWindow->pCurrentPosActiveItem != 4 ) |
822 strcat(v77, pGlobalTXT_LocalizationStrings[160]); | 823 v30 = v81; |
823 v82 = pFontArrus->CalcTextHeight(v77, &v79, 0, 0); | 824 sprintf(v77, format_4E2DC8, v30); |
824 strcat(v77, "\n \n"); | 825 strcat(v77, pGlobalTXT_LocalizationStrings[160]); |
825 v75[0] = 0; | 826 v82 = pFontArrus->CalcTextHeight(v77, &v79, 0, 0); |
826 v87 = 0; | 827 strcat(v77, "\n \n"); |
827 v31 = (signed int)window_SpeakInHouse->ptr_1C; | 828 v75[0] = 0; |
828 if ( v31 >= 108 && v31 <= 120 ) | 829 v87 = 0; |
829 { | 830 v31 = (signed int)window_SpeakInHouse->ptr_1C; |
830 v32 = *(int *)v84; | 831 if ( v31 >= 108 && v31 <= 120 ) |
831 if ( pDialogueWindow->pCurrentPosActiveItem != 5 ) | 832 { |
832 v32 = v81; | 833 v32 = *(int *)v84; |
833 sprintf(v75, format_4E2DC8, v32); | 834 if ( pDialogueWindow->pCurrentPosActiveItem != 5 ) |
834 strcat(v75, pGlobalTXT_LocalizationStrings[611]); | 835 v32 = v81; |
835 v87 = pFontArrus->CalcTextHeight(v75, &v79, 0, 0); | 836 sprintf(v75, format_4E2DC8, v32); |
836 } | 837 strcat(v75, pGlobalTXT_LocalizationStrings[611]); |
837 v33 = pDialogueWindow; | 838 v87 = pFontArrus->CalcTextHeight(v75, &v79, 0, 0); |
838 Str[1] = (char *)pDialogueWindow; | 839 } |
839 v34 = pDialogueWindow->pStartingPosActiveItem; | 840 v33 = pDialogueWindow; |
840 v35 = v34 + pDialogueWindow->pNumPresenceButton; | 841 Str[1] = (char *)pDialogueWindow; |
841 v36 = LOBYTE(pFontArrus->uFontHeight) - 3; | 842 v34 = pDialogueWindow->pStartingPosActiveItem; |
842 v37 = -pDialogueWindow->pNumPresenceButton < 0; | 843 v35 = v34 + pDialogueWindow->pNumPresenceButton; |
843 pOutString = (GUIFont *)pDialogueWindow->pStartingPosActiveItem; | 844 v36 = LOBYTE(pFontArrus->uFontHeight) - 3; |
844 if ( !(v37 ^ __OFSUB__(v34, v35)) ) | 845 v37 = -pDialogueWindow->pNumPresenceButton < 0; |
845 { | 846 pOutString = (GUIFont *)pDialogueWindow->pStartingPosActiveItem; |
846 LABEL_75: | 847 if ( !(v37 ^ __OFSUB__(v34, v35)) ) |
847 sprintf(pTmpBuf, "%s%s%s%s", &Dest, &a1, &v77, &v75); | 848 { |
848 v71 = 3; | 849 //LABEL_75: |
849 v69 = pTmpBuf; | 850 sprintf(pTmpBuf, "%s%s%s%s", &Dest, &a1, &v77, &v75); |
850 v67 = 0; | 851 v71 = 3; |
851 v66 = 146; | 852 v69 = pTmpBuf; |
852 LABEL_98: | 853 v67 = 0; |
853 v79.DrawTitleText(pFontArrus, 0, v66, v67, v69, v71); | 854 v66 = 146; |
854 return; | 855 //LABEL_98: |
855 } | 856 v79.DrawTitleText(pFontArrus, 0, v66, v67, v69, v71); |
856 while ( 1 ) | 857 return; |
857 { | 858 } |
858 v38 = v33->GetControl((unsigned int)pOutString); | 859 while ( 1 ) |
859 if ( v38->uControlParam == 15 ) | 860 { |
860 { | 861 v38 = v33->GetControl((unsigned int)pOutString); |
861 v46 = v90; | 862 if ( v38->uControlParam == 15 ) |
862 v38->uHeight = v90; | 863 { |
863 v38->uY = 146; | 864 v46 = v90; |
864 v41 = v46 + 145; | 865 v38->uHeight = v90; |
865 goto LABEL_73; | 866 v38->uY = 146; |
866 } | 867 v41 = v46 + 145; |
867 if ( v38->uControlParam == 16 ) | 868 v38->uW = v41; |
868 { | 869 } |
869 v44 = v88; | 870 else if ( v38->uControlParam == 16 ) |
870 v45 = v90 + v36 + 146; | 871 { |
871 v38->uHeight = v88; | 872 v44 = v88; |
872 v38->uY = v45; | 873 v45 = v90 + v36 + 146; |
873 v41 = v45 + v44 - 1; | 874 v38->uHeight = v88; |
874 goto LABEL_73; | 875 v38->uY = v45; |
875 } | 876 v41 = v45 + v44 - 1; |
876 if ( v38->uControlParam == 96 ) | 877 v38->uW = v41; |
877 break; | 878 } |
878 if ( v38->uControlParam == 101 ) | 879 else if ( v38->uControlParam == 96 ) |
879 { | 880 { |
880 v39 = v90 + 3 * v36 + v87 + v88 + 146; | 881 v42 = v90 + v88 + 2 * v36 + 146; |
881 v33 = (GUIWindow *)Str[1]; | 882 v43 = v82; |
882 v40 = v87; | 883 v38->uY = v42; |
883 v38->uHeight = v87; | 884 v38->uHeight = v43; |
884 v38->uY = v39; | 885 v41 = v43 + v42 - 1; |
885 v41 = v39 + v40 - 1; | 886 v38->uW = v41; |
886 LABEL_73: | 887 } |
887 v38->uW = v41; | 888 else if ( v38->uControlParam == 101 ) |
888 } | 889 { |
889 v47 = v33->pStartingPosActiveItem; | 890 v39 = v90 + 3 * v36 + v87 + v88 + 146; |
890 pOutString = (GUIFont *)((char *)pOutString + 1); | 891 v33 = (GUIWindow *)Str[1]; |
891 if ( (signed int)pOutString >= v33->pNumPresenceButton + v47 ) | 892 v40 = v87; |
892 goto LABEL_75; | 893 v38->uHeight = v87; |
893 } | 894 v38->uY = v39; |
894 v42 = v90 + v88 + 2 * v36 + 146; | 895 v41 = v39 + v40 - 1; |
895 v43 = v82; | 896 //LABEL_73: |
896 v38->uY = v42; | 897 v38->uW = v41; |
897 v38->uHeight = v43; | 898 } |
898 v41 = v43 + v42 - 1; | 899 v47 = v33->pStartingPosActiveItem; |
899 goto LABEL_73; | 900 pOutString = (GUIFont *)((char *)pOutString + 1); |
900 } | 901 if ( (signed int)pOutString >= v33->pNumPresenceButton + v47 ) |
901 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 902 { |
902 { | 903 sprintf(pTmpBuf, "%s%s%s%s", &Dest, &a1, &v77, &v75); |
903 v48 = 2; | 904 v71 = 3; |
904 pShopOptions[0] = pGlobalTXT_LocalizationStrings[620]; | 905 v69 = pTmpBuf; |
905 pOutString = 0; | 906 v67 = 0; |
906 pShopOptions[1] = pGlobalTXT_LocalizationStrings[622]; | 907 v66 = 146; |
907 if ( pParty->HasItem(0x28Bu) ) | 908 v79.DrawTitleText(pFontArrus, 0, v66, v67, v69, v71); |
908 { | 909 return; |
909 pShopOptions[2] = pGlobalTXT_LocalizationStrings[621]; | 910 } |
910 v48 = 3; | 911 } |
911 } | 912 break; |
912 for ( i = 0; i < v48; ++i ) | 913 } |
913 { | 914 case 101: |
914 v50 = pFontArrus->CalcTextHeight(pShopOptions[i], &v79, 0, 0); | 915 { |
915 pOutString = (GUIFont *)((char *)pOutString + v50); | 916 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
916 } | 917 { |
917 v86 = (174 - (signed int)pOutString) / v48; | 918 v48 = 2; |
918 v51 = pDialogueWindow; | 919 pShopOptions[0] = pGlobalTXT_LocalizationStrings[620]; |
919 v52 = 174 - v48 * (174 - (signed int)pOutString) / v48 - (signed int)pOutString; | 920 pOutString = 0; |
920 v53 = v52 - HIDWORD(v52); | 921 pShopOptions[1] = pGlobalTXT_LocalizationStrings[622]; |
921 LODWORD(v52) = pDialogueWindow->pStartingPosActiveItem; | 922 if ( pParty->HasItem(0x28Bu) ) |
922 HIDWORD(v52) = v52 + pDialogueWindow->pNumPresenceButton; | 923 { |
923 v54 = (v53 >> 1) - v86 / 2 + 138; | 924 pShopOptions[2] = pGlobalTXT_LocalizationStrings[621]; |
924 v37 = -pDialogueWindow->pNumPresenceButton < 0; | 925 v48 = 3; |
925 v89 = pDialogueWindow->pStartingPosActiveItem; | 926 } |
926 if ( v37 ^ __OFSUB__((int)v52, HIDWORD(v52)) ) | 927 for ( i = 0; i < v48; ++i ) |
927 { | 928 { |
928 v85 = (Player *)2; | 929 v50 = pFontArrus->CalcTextHeight(pShopOptions[i], &v79, 0, 0); |
929 pOutString = (GUIFont *)pShopOptions; | 930 pOutString = (GUIFont *)((char *)pOutString + v50); |
930 do | 931 } |
931 { | 932 v86 = (174 - (signed int)pOutString) / v48; |
932 v55 = v51->GetControl(v89); | 933 v51 = pDialogueWindow; |
933 v56 = (const char **)pOutString; | 934 v52 = 174 - v48 * (174 - (signed int)pOutString) / v48 - (signed int)pOutString; |
934 v55->uY = v86 + v54; | 935 v53 = v52 - HIDWORD(v52); |
935 v57 = pFontArrus->CalcTextHeight(*v56, &v79, 0, 0); | 936 LODWORD(v52) = pDialogueWindow->pStartingPosActiveItem; |
936 v58 = v55->uY; | 937 HIDWORD(v52) = v52 + pDialogueWindow->pNumPresenceButton; |
937 v59 = v85; | 938 v54 = (v53 >> 1) - v86 / 2 + 138; |
938 v55->uHeight = v57; | 939 v37 = -pDialogueWindow->pNumPresenceButton < 0; |
939 v54 = v57 + v58 - 1; | 940 v89 = pDialogueWindow->pStartingPosActiveItem; |
940 v55->uW = v54; | 941 if ( v37 ^ __OFSUB__((int)v52, HIDWORD(v52)) ) |
941 v60 = v84[0]; | 942 { |
942 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v59 ) | 943 v85 = (Player *)2; |
943 v60 = v81; | 944 pOutString = (GUIFont *)pShopOptions; |
944 v79.DrawTitleText(pFontArrus, 0, v58, v60, *(const char **)&pOutString->cFirstChar, 3u); | 945 do |
945 v51 = pDialogueWindow; | 946 { |
946 v85 = (Player *)((char *)v85 + 1); | 947 v55 = v51->GetControl(v89); |
947 pOutString = (GUIFont *)((char *)pOutString + 4); | 948 v56 = (const char **)pOutString; |
948 ++v89; | 949 v55->uY = v86 + v54; |
949 } | 950 v57 = pFontArrus->CalcTextHeight(*v56, &v79, 0, 0); |
950 while ( v89 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); | 951 v58 = v55->uY; |
951 } | 952 v59 = v85; |
953 v55->uHeight = v57; | |
954 v54 = v57 + v58 - 1; | |
955 v55->uW = v54; | |
956 v60 = v84[0]; | |
957 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v59 ) | |
958 v60 = v81; | |
959 v79.DrawTitleText(pFontArrus, 0, v58, v60, *(const char **)&pOutString->cFirstChar, 3u); | |
960 v51 = pDialogueWindow; | |
961 v85 = (Player *)((char *)v85 + 1); | |
962 pOutString = (GUIFont *)((char *)pOutString + 4); | |
963 ++v89; | |
964 } | |
965 while ( v89 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); | |
966 } | |
967 } | |
968 break; | |
969 } | |
970 default: | |
971 { | |
972 break; | |
973 } | |
952 } | 974 } |
953 } | 975 } |
954 | 976 |
955 | 977 |
956 //----- (004B910F) -------------------------------------------------------- | 978 //----- (004B910F) -------------------------------------------------------- |