Mercurial > mm7
comparison UIHouses.cpp @ 651:2bf48d11d742
Training hall UI fixed
author | Nomad |
---|---|
date | Tue, 12 Mar 2013 03:10:35 +0200 |
parents | 35ce4761382c |
children | 2535151505da 3f504ad074a8 |
comparison
equal
deleted
inserted
replaced
650:14d13880daa9 | 651:2bf48d11d742 |
---|---|
3828 //----- (004B4710) -------------------------------------------------------- | 3828 //----- (004B4710) -------------------------------------------------------- |
3829 int __cdecl TrainingDialog() | 3829 int __cdecl TrainingDialog() |
3830 { | 3830 { |
3831 Player *v0; // ebx@1 | 3831 Player *v0; // ebx@1 |
3832 int color2; // eax@1 | 3832 int color2; // eax@1 |
3833 unsigned int v2; // ecx@1 | 3833 //unsigned int v2; // ecx@1 |
3834 int v3; // eax@1 | 3834 //int v3; // eax@1 |
3835 signed int v4; // edx@1 | 3835 //signed int v4; // edx@1 |
3836 int v5; // edi@3 | 3836 unsigned __int64 v5; // edi@3 |
3837 unsigned int v6; // esi@3 | 3837 //unsigned int v6; // esi@3 |
3838 void *v7; // ecx@3 | 3838 //void *v7; // ecx@3 |
3839 int v8; // edx@4 | 3839 int v8; // edx@4 |
3840 double v9; // st7@6 | 3840 double v9; // st7@6 |
3841 signed int v10; // esi@6 | 3841 signed int v10; // esi@6 |
3842 int v11; // ecx@6 | 3842 int v11; // ecx@6 |
3843 int result; // eax@9 | 3843 int result; // eax@9 |
3892 char *v61; // [sp-8h] [bp-8Ch]@63 | 3892 char *v61; // [sp-8h] [bp-8Ch]@63 |
3893 unsigned int v62; // [sp-4h] [bp-88h]@38 | 3893 unsigned int v62; // [sp-4h] [bp-88h]@38 |
3894 int v63; // [sp-4h] [bp-88h]@52 | 3894 int v63; // [sp-4h] [bp-88h]@52 |
3895 char *v64; // [sp-4h] [bp-88h]@63 | 3895 char *v64; // [sp-4h] [bp-88h]@63 |
3896 GUIWindow v65; // [sp+Ch] [bp-78h]@1 | 3896 GUIWindow v65; // [sp+Ch] [bp-78h]@1 |
3897 __int64 v66; // [sp+60h] [bp-24h]@3 | 3897 //__int64 v66; // [sp+60h] [bp-24h]@3 |
3898 unsigned int white; // [sp+68h] [bp-1Ch]@1 | 3898 unsigned int white; // [sp+68h] [bp-1Ch]@1 |
3899 int v68; // [sp+6Ch] [bp-18h]@3 | 3899 int v68; // [sp+6Ch] [bp-18h]@3 |
3900 int v69; // [sp+70h] [bp-14h]@6 | 3900 int v69; // [sp+70h] [bp-14h]@6 |
3901 unsigned int i; // [sp+74h] [bp-10h]@1 | 3901 //unsigned int i; // [sp+74h] [bp-10h]@1 |
3902 int v71; // [sp+78h] [bp-Ch]@1 | 3902 //int v71; // [sp+78h] [bp-Ch]@1 |
3903 int v72; // [sp+7Ch] [bp-8h]@16 | 3903 int v72; // [sp+7Ch] [bp-8h]@16 |
3904 int v73; // [sp+80h] [bp-4h]@14 | 3904 int v73; // [sp+80h] [bp-4h]@14 |
3905 | 3905 |
3906 v0 = pPlayers[uActiveCharacter]; | 3906 v0 = pPlayers[uActiveCharacter]; |
3907 memcpy(&v65, window_SpeakInHouse, sizeof(v65)); | 3907 memcpy(&v65, window_SpeakInHouse, sizeof(v65)); |
3908 v65.uFrameX = 483; | 3908 v65.uFrameX = 483; |
3909 v65.uFrameWidth = 148; | 3909 v65.uFrameWidth = 148; |
3910 v65.uFrameZ = 334; | 3910 v65.uFrameZ = 334; |
3911 white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 3911 white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); |
3912 color2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); | 3912 color2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); |
3913 v2 = v0->uLevel; | 3913 //v71 = color2; |
3914 v71 = color2; | 3914 //v2 = v0->uLevel; |
3915 v3 = 0; | 3915 //v3 = 0; |
3916 v4 = 0; | 3916 //v4 = 0; |
3917 for ( i = v2; v4 < (signed int)v2; ++v4 ) | 3917 //for ( i = v2; v4 < (signed int)v2; ++v4 ) |
3918 v3 += v4 + 1; | 3918 // v3 += v4 + 1; |
3919 v5 = 1000 * v3; | 3919 //v5 = 1000 * v3; |
3920 v6 = HIDWORD(v0->uExperience); | 3920 v5 = 1000ui64 * v0->uLevel * (v0->uLevel + 1) / 2; // E n = n(n + 1) / 2 |
3921 v7 = window_SpeakInHouse->ptr_1C; | 3921 //v6 = HIDWORD(v0->uExperience); |
3922 v68 = (unsigned __int16)word_4F0866[(signed int)v7]; | 3922 //v7 = window_SpeakInHouse->ptr_1C; |
3923 v66 = 1000 * v3; | 3923 v68 = pMaxLevelPerTrainingHallType[(unsigned int)window_SpeakInHouse->ptr_1C - 89]; |
3924 if ( (signed __int64)__PAIR__(v6, LODWORD(v0->uExperience)) >= v66 ) | 3924 //v66 = 1000 * v3; |
3925 if (v0->uExperience >= v5) | |
3925 { | 3926 { |
3926 v8 = v0->classType % 4 + 1; | 3927 v8 = v0->classType % 4 + 1; |
3927 if ( v8 == 4 ) | 3928 if ( v8 == 4 ) |
3928 v8 = 3; | 3929 v8 = 3; |
3929 v9 = (double)(signed int)i; | 3930 v9 = (double)v0->uLevel; |
3930 i = 0; | 3931 //i = 0; |
3931 v69 = v8; | 3932 v69 = v8; |
3932 //v10 = (signed __int64)(v9 * p2DEvents_minus1__20[13 * (signed int)v7] * (double)v8); | 3933 //v10 = (signed __int64)(v9 * p2DEvents_minus1__20[13 * (signed int)v7] * (double)v8); |
3933 v10 = (signed __int64)(v9 * p2DEvents[(signed int)v7 - 1].fPriceMultiplier * (double)v8); | 3934 v10 = (signed __int64)(v9 * p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier * (double)v8); |
3934 v11 = v10 * (100 - v0->GetMerchant()) / 100; | 3935 v11 = v10 * (100 - v0->GetMerchant()) / 100; |
3935 if ( v11 < v10 / 3 ) | 3936 if ( v11 < v10 / 3 ) |
3936 v11 = v10 / 3; | 3937 v11 = v10 / 3; |
3937 i = v11; | 3938 //i = v11; |
3938 } | 3939 } |
3939 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | 3940 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); |
3940 if ( result ) | 3941 if ( result ) |
3941 { | 3942 { |
3942 if ( dialog_menu_id != 1 ) | 3943 if ( dialog_menu_id != 1 ) |
3947 if ( dialog_menu_id == 96 ) | 3948 if ( dialog_menu_id == 96 ) |
3948 { | 3949 { |
3949 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | 3950 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); |
3950 if ( result ) | 3951 if ( result ) |
3951 { | 3952 { |
3952 i = 0; | 3953 //i = 0; |
3954 int _v0 = 0; | |
3953 v13 = pDialogueWindow; | 3955 v13 = pDialogueWindow; |
3954 //v14 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0); | 3956 //v14 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0); |
3955 v14 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); | 3957 v14 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); |
3956 v73 = v14 * (100 - v0->GetMerchant()) / 100; | 3958 v73 = v14 * (100 - v0->GetMerchant()) / 100; |
3957 if ( v73 < v14 / 3 ) | 3959 if ( v73 < v14 / 3 ) |
3965 { | 3967 { |
3966 v17 = v13->GetControl(v15)->uControlParam - 36; | 3968 v17 = v13->GetControl(v15)->uControlParam - 36; |
3967 if ( byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v17] && !v0->pActiveSkills[v17] ) | 3969 if ( byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v17] && !v0->pActiveSkills[v17] ) |
3968 { | 3970 { |
3969 v18 = pFontArrus->CalcTextHeight(pSkillNames[v17], &v65, 0, 0); | 3971 v18 = pFontArrus->CalcTextHeight(pSkillNames[v17], &v65, 0, 0); |
3970 i += v18; | 3972 _v0 += v18; |
3971 ++v72; | 3973 ++v72; |
3972 } | 3974 } |
3973 ++v15; | 3975 ++v15; |
3974 } | 3976 } |
3975 while ( (signed int)v15 < v13->pNumPresenceButton + v13->pStartingPosActiveItem ); | 3977 while ( (signed int)v15 < v13->pNumPresenceButton + v13->pStartingPosActiveItem ); |
3976 if ( v72 ) | 3978 if ( v72 ) |
3977 { | 3979 { |
3978 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v73);// "Skill Cost: %lu" | 3980 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v73);// "Skill Cost: %lu" |
3979 v65.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); | 3981 v65.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); |
3980 v73 = (signed int)(149 - i) / v72; | 3982 v73 = (signed int)(149 - _v0) / v72; |
3981 if ( v73 > 32 ) | 3983 if ( v73 > 32 ) |
3982 v73 = 32; | 3984 v73 = 32; |
3983 result = v13->pStartingPosActiveItem; | 3985 result = v13->pStartingPosActiveItem; |
3984 v19 = (signed int)(149 - v72 * v73 - i) / 2 - v73 / 2 + 162; | 3986 v19 = (signed int)(149 - v72 * v73 - _v0) / 2 - v73 / 2 + 162; |
3985 i = result; | 3987 int _v1 = result; |
3986 v68 = v19; | 3988 v68 = v19; |
3987 if ( result < result + v13->pNumPresenceButton ) | 3989 if ( result < result + v13->pNumPresenceButton ) |
3988 { | 3990 { |
3989 v72 = 2; | 3991 v72 = 2; |
3990 do | 3992 do |
3991 { | 3993 { |
3992 v20 = v13->GetControl(i); | 3994 v20 = v13->GetControl(_v1); |
3993 v21 = v20; | 3995 v21 = v20; |
3994 v22 = v20->uControlParam - 36; | 3996 v22 = v20->uControlParam - 36; |
3995 if ( !byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v22] || v0->pActiveSkills[v22] ) | 3997 if ( !byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v22] || v0->pActiveSkills[v22] ) |
3996 { | 3998 { |
3997 v21->uW = 0; | 3999 v21->uW = 0; |
4000 } | 4002 } |
4001 else | 4003 else |
4002 { | 4004 { |
4003 v23 = pSkillNames[v22]; | 4005 v23 = pSkillNames[v22]; |
4004 v21->uY = v73 + v68; | 4006 v21->uY = v73 + v68; |
4005 HIDWORD(v66) = (int)v23; | 4007 //HIDWORD(v66) = (int)v23; |
4006 v24 = pFontArrus->CalcTextHeight(v23, &v65, 0, 0); | 4008 v24 = pFontArrus->CalcTextHeight(v23, &v65, 0, 0); |
4007 v25 = v21->uY; | 4009 v25 = v21->uY; |
4008 v21->uHeight = v24; | 4010 v21->uHeight = v24; |
4009 v26 = v25 + v24 - 1; | 4011 v26 = v25 + v24 - 1; |
4010 v21->uW = v26; | 4012 v21->uW = v26; |
4011 v68 = v26; | 4013 v68 = v26; |
4012 v27 = v71; | 4014 v27 = color2; |
4013 if ( pDialogueWindow->pCurrentPosActiveItem != v72 ) | 4015 if ( pDialogueWindow->pCurrentPosActiveItem != v72 ) |
4014 v27 = white; | 4016 v27 = white; |
4015 v65.DrawTitleText(pFontArrus, 0, v25, v27, (char *)HIDWORD(v66), 3u); | 4017 v65.DrawTitleText(pFontArrus, 0, v25, v27, v23, 3u); |
4016 } | 4018 } |
4017 v28 = v13->pStartingPosActiveItem; | 4019 v28 = v13->pStartingPosActiveItem; |
4018 ++i; | 4020 ++_v1; |
4019 result = v13->pNumPresenceButton + v28; | 4021 result = v13->pNumPresenceButton + v28; |
4020 ++v72; | 4022 ++v72; |
4021 } | 4023 } |
4022 while ( (signed int)i < result ); | 4024 while ( (signed int)_v1 < result ); |
4023 } | 4025 } |
4024 } | 4026 } |
4025 else | 4027 else |
4026 { | 4028 { |
4027 LABEL_76: | 4029 LABEL_76: |
4028 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v0->pName, pClassNames[v0->classType]);// | 4030 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v0->pName, pClassNames[v0->classType]);// |
4029 // "Seek knowledge elsewhere %s the %s" | 4031 // "Seek knowledge elsewhere %s the %s" |
4030 strcat(pTmpBuf, "\n \n"); | 4032 strcat(pTmpBuf, "\n \n"); |
4031 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further." | 4033 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further." |
4032 v29 = v71; | 4034 v29 = color2; |
4033 v30 = pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0); | 4035 v30 = pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0); |
4034 result = (int)v65.DrawTitleText(pFontArrus, 0, (174 - v30) / 2 + 138, v29, pTmpBuf, 3u); | 4036 result = (int)v65.DrawTitleText(pFontArrus, 0, (174 - v30) / 2 + 138, v29, pTmpBuf, 3u); |
4035 } | 4037 } |
4036 } | 4038 } |
4037 } | 4039 } |
4038 return result; | 4040 return result; |
4039 } | 4041 } |
4040 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 4042 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
4041 { | 4043 { |
4042 v31 = pNPCTopics[122].pText; | 4044 v31 = pNPCTopics[122].pText; |
4043 v32 = v71; | 4045 v32 = color2; |
4044 v33 = pFontArrus->CalcTextHeight(pNPCTopics[122].pText, &v65, 0, 0); | 4046 v33 = pFontArrus->CalcTextHeight(pNPCTopics[122].pText, &v65, 0, 0); |
4045 v65.DrawTitleText(pFontArrus, 0, (212 - v33) / 2 + 101, v32, v31, 3u); | 4047 v65.DrawTitleText(pFontArrus, 0, (212 - v33) / 2 + 101, v32, v31, 3u); |
4046 result = (int)pDialogueWindow; | 4048 result = (int)pDialogueWindow; |
4047 pDialogueWindow->pNumPresenceButton = 0; | 4049 pDialogueWindow->pNumPresenceButton = 0; |
4048 return result; | 4050 return result; |
4049 } | 4051 } |
4050 v34 = v0->uLevel; | 4052 v34 = v0->uLevel; |
4051 if ( v34 < v68 ) | 4053 if ( v34 < v68 ) |
4052 { | 4054 { |
4053 if ( (signed __int64)v0->uExperience >= v66 ) | 4055 if ( (signed __int64)v0->uExperience >= v5 ) |
4054 { | 4056 { |
4055 if ( pParty->uNumGold >= i ) | 4057 if ( pParty->uNumGold >= v11) |
4056 { | 4058 { |
4057 Party::TakeGold(i); | 4059 Party::TakeGold(v11); |
4058 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); | 4060 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); |
4059 ++v0->uLevel; | 4061 ++v0->uLevel; |
4060 v0->uSkillPoints += v0->uLevel / 10 + 5; | 4062 v0->uSkillPoints += v0->uLevel / 10 + 5; |
4061 v0->sHealth = v0->GetMaxHealth(); | 4063 v0->sHealth = v0->GetMaxHealth(); |
4062 v0->sMana = v0->GetMaxMana(); | 4064 v0->sMana = v0->GetMaxMana(); |
4081 RestAndHeal((signed int)(v42 + 10080)); | 4083 RestAndHeal((signed int)(v42 + 10080)); |
4082 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) | 4084 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) |
4083 pOutdoor->SetFog(); | 4085 pOutdoor->SetFog(); |
4084 } | 4086 } |
4085 v0->PlaySound(SPEECH_87, 0); | 4087 v0->PlaySound(SPEECH_87, 0); |
4086 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[430], v0->pName, v0->uLevel, v0->uLevel / 10 + 5);// | 4088 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[430], v0->pName, v0->uLevel, v0->uLevel / 10 + 5);// |
4087 // "%s is now Level %lu and has earned %lu Skill Points!" | 4089 // "%s is now Level %lu and has earned %lu Skill Points!" |
4088 ShowStatusBarString(pTmpBuf, 2u); | 4090 ShowStatusBarString(pTmpBuf, 2u); |
4089 goto LABEL_56; | 4091 goto LABEL_56; |
4090 } | 4092 } |
4091 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);// "You don't have enough gold" | 4093 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);// "You don't have enough gold" |
4104 } | 4106 } |
4105 return result;*/ | 4107 return result;*/ |
4106 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | 4108 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); |
4107 return 1; // void function actually | 4109 return 1; // void function actually |
4108 } | 4110 } |
4109 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[538], v5 - LODWORD(v0->uExperience), v34 + 1);// | 4111 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[538], (unsigned int)(v5 - v0->uExperience), v34 + 1);// |
4110 // "You need %d more experience to train to level %d" | 4112 // "You need %d more experience to train to level %d" |
4111 v35 = 0; | 4113 v35 = 0; |
4112 v62 = 3; | 4114 v62 = 3; |
4113 v60 = pTmpBuf; | 4115 v60 = pTmpBuf; |
4114 v58 = v71; | 4116 v58 = color2; |
4115 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0)) / 2 + 88; | 4117 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0)) / 2 + 88; |
4116 } | 4118 } |
4117 else | 4119 else |
4118 { | 4120 { |
4119 sprintf(pTmpBuf, "%s\n \n%s", pGlobalTXT_LocalizationStrings[536], pGlobalTXT_LocalizationStrings[529]);// | 4121 sprintf(pTmpBuf, "%s\n \n%s", pGlobalTXT_LocalizationStrings[536], pGlobalTXT_LocalizationStrings[529]);// |
4120 // ""With your skills, you should be working here as a teacher."" | 4122 // ""With your skills, you should be working here as a teacher."" |
4121 // ""Sorry, but we are unable to train you."" | 4123 // ""Sorry, but we are unable to train you."" |
4122 v35 = 0; | 4124 v35 = 0; |
4123 v62 = 3; | 4125 v62 = 3; |
4124 v60 = pTmpBuf; | 4126 v60 = pTmpBuf; |
4125 v58 = v71; | 4127 v58 = color2; |
4126 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0)) / 2 + 101; | 4128 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0)) / 2 + 101; |
4127 } | 4129 } |
4128 v65.DrawTitleText(pFontArrus, v35, v36, v58, v60, v62); | 4130 v65.DrawTitleText(pFontArrus, v35, v36, v58, v60, v62); |
4129 v63 = 3; | 4131 v63 = 3; |
4130 goto LABEL_55; | 4132 goto LABEL_55; |
4146 if ( v43->GetControl(v73)->uControlParam == 17 ) | 4148 if ( v43->GetControl(v73)->uControlParam == 17 ) |
4147 { | 4149 { |
4148 v46 = v0->uLevel; | 4150 v46 = v0->uLevel; |
4149 if ( v46 < v68 ) | 4151 if ( v46 < v68 ) |
4150 { | 4152 { |
4151 if ( (signed __int64)v0->uExperience < v66 ) | 4153 if ( (signed __int64)v0->uExperience < v5 ) |
4152 { | 4154 { |
4153 v64 = (char *)(v46 + 1); | 4155 v64 = (char *)(v46 + 1); |
4154 v61 = (char *)(v5 - LODWORD(v0->uExperience)); | 4156 v61 = (char *)(v5 - LODWORD(v0->uExperience)); |
4155 v59 = pGlobalTXT_LocalizationStrings[538];// "You need %d more experience to train to level %d" | 4157 v59 = pGlobalTXT_LocalizationStrings[538];// "You need %d more experience to train to level %d" |
4156 } | 4158 } |
4157 else | 4159 else |
4158 { | 4160 { |
4159 v64 = (char *)i; | 4161 v64 = (char *)v11; |
4160 v61 = (char *)(v46 + 1); | 4162 v61 = (char *)(v46 + 1); |
4161 v59 = pGlobalTXT_LocalizationStrings[537];// "Train to level %d for %d gold" | 4163 v59 = pGlobalTXT_LocalizationStrings[537];// "Train to level %d for %d gold" |
4162 } | 4164 } |
4163 } | 4165 } |
4164 else | 4166 else |
4165 { | 4167 { |
4166 v64 = pGlobalTXT_LocalizationStrings[529];// ""Sorry, but we are unable to train you."" | 4168 v64 = pGlobalTXT_LocalizationStrings[529];// ""Sorry, but we are unable to train you."" |
4167 v61 = pGlobalTXT_LocalizationStrings[536];// ""With your skills, you should be working here as a teacher."" | 4169 v61 = pGlobalTXT_LocalizationStrings[536];// ""With your skills, you should be working here as a teacher."" |
4168 v59 = "%s\n \n%s"; | 4170 v59 = "%s\n \n%s"; |
4169 } | 4171 } |
4170 sprintf(*v45, v59, v61, v64); | 4172 sprintfex(*v45, v59, v61, v64); |
4171 } | 4173 } |
4172 v47 = pFontArrus->CalcTextHeight(*v45, &v65, 0, 0); | 4174 v47 = pFontArrus->CalcTextHeight(*v45, &v65, 0, 0); |
4173 v43 = pDialogueWindow; | 4175 v43 = pDialogueWindow; |
4174 v72 += v47; | 4176 v72 += v47; |
4175 ++v45; | 4177 ++v45; |
4176 ++v73; | 4178 ++v73; |
4177 } | 4179 } |
4178 while ( v73 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); | 4180 while ( v73 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); |
4179 } | 4181 } |
4180 HIDWORD(v66) = (174 - v72) / 2; | 4182 //HIDWORD(v66) = (174 - v72) / 2; |
4181 result = v43->pStartingPosActiveItem; | 4183 result = v43->pStartingPosActiveItem; |
4182 v48 = result + v43->pNumPresenceButton; | 4184 v48 = result + v43->pNumPresenceButton; |
4183 v49 = (2 * (87 - (174 - v72) / 2) - v72) / 2 - (174 - v72) / 2 / 2 + 138; | 4185 v49 = (2 * (87 - (174 - v72) / 2) - v72) / 2 - (174 - v72) / 2 / 2 + 138; |
4184 v50 = -v43->pNumPresenceButton < 0; | 4186 v50 = -v43->pNumPresenceButton < 0; |
4185 v73 = v43->pStartingPosActiveItem; | 4187 v73 = v43->pStartingPosActiveItem; |
4186 if ( v50 ^ __OFSUB__(result, v48) ) | 4188 if ( v50 ^ __OFSUB__(result, v48) ) |
4187 { | 4189 { |
4188 i = 2; | 4190 int _v3 = 2; |
4189 v51 = pShopOptions; | 4191 v51 = pShopOptions; |
4190 do | 4192 do |
4191 { | 4193 { |
4192 v52 = v43->GetControl(v73); | 4194 v52 = v43->GetControl(v73); |
4193 v53 = v52; | 4195 v53 = v52; |
4194 v52->uY = HIDWORD(v66) + v49; | 4196 v52->uY = (174 - v72) / 2 + v49; |
4195 v54 = pFontArrus->CalcTextHeight(*v51, &v65, 0, 0); | 4197 v54 = pFontArrus->CalcTextHeight(*v51, &v65, 0, 0); |
4196 v55 = v53->uY; | 4198 v55 = v53->uY; |
4197 v53->uHeight = v54; | 4199 v53->uHeight = v54; |
4198 v56 = v54 + v55 - 1; | 4200 v56 = v54 + v55 - 1; |
4199 v53->uW = v56; | 4201 v53->uW = v56; |
4200 v49 = v56; | 4202 v49 = v56; |
4201 v57 = v71; | 4203 v57 = color2; |
4202 if ( pDialogueWindow->pCurrentPosActiveItem != i ) | 4204 if ( pDialogueWindow->pCurrentPosActiveItem != _v3 ) |
4203 v57 = white; | 4205 v57 = white; |
4204 v65.DrawTitleText(pFontArrus, 0, v55, v57, *v51, 3u); | 4206 v65.DrawTitleText(pFontArrus, 0, v55, v57, *v51, 3u); |
4205 v43 = pDialogueWindow; | 4207 v43 = pDialogueWindow; |
4206 ++i; | 4208 ++_v3; |
4207 ++v51; | 4209 ++v51; |
4208 ++v73; | 4210 ++v73; |
4209 result = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; | 4211 result = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; |
4210 } | 4212 } |
4211 while ( v73 < result ); | 4213 while ( v73 < result ); |