Mercurial > mm7
comparison mm7_2.cpp @ 623:bd9f43d4fc3d
Height text in Armor shop dialog
author | Ritor1 |
---|---|
date | Sat, 09 Mar 2013 00:33:04 +0600 |
parents | 574cc56e05e9 |
children | 483b5ecb4005 |
comparison
equal
deleted
inserted
replaced
622:d92de5102da8 | 623:bd9f43d4fc3d |
---|---|
974 } | 974 } |
975 } | 975 } |
976 | 976 |
977 | 977 |
978 //----- (004B910F) -------------------------------------------------------- | 978 //----- (004B910F) -------------------------------------------------------- |
979 char *__cdecl WeaponShopDialog() | 979 void __cdecl WeaponShopDialog() |
980 { | 980 { |
981 Player *v0; // ebx@1 | 981 //Player *v0; // ebx@1 |
982 char *result; // eax@6 | 982 char *result; // eax@6 |
983 signed int v2; // esi@8 | 983 signed int v2; // esi@8 |
984 unsigned int v3; // ebx@10 | 984 unsigned int v3; // ebx@10 |
985 ItemGen *v4; // eax@11 | 985 ItemGen *v4; // eax@11 |
986 char *v5; // ecx@12 | 986 char *v5; // ecx@12 |
1041 LONG v60; // ecx@90 | 1041 LONG v60; // ecx@90 |
1042 int v61; // eax@90 | 1042 int v61; // eax@90 |
1043 int v62; // ecx@90 | 1043 int v62; // ecx@90 |
1044 ItemGen *v63; // esi@90 | 1044 ItemGen *v63; // esi@90 |
1045 int v64; // eax@95 | 1045 int v64; // eax@95 |
1046 int v65; // esi@96 | 1046 int all_text_height; // esi@96 |
1047 char **v66; // edi@96 | 1047 char **v66; // edi@96 |
1048 int v67; // eax@97 | 1048 int v67; // eax@97 |
1049 GUIWindow *v68; // ecx@98 | 1049 GUIWindow *v68; // ecx@98 |
1050 int v69; // edx@98 | 1050 int v69; // edx@98 |
1051 int v70; // edi@98 | 1051 int v70; // edi@98 |
1077 POINT v96; // [sp+54h] [bp-A4h]@18 | 1077 POINT v96; // [sp+54h] [bp-A4h]@18 |
1078 POINT v97; // [sp+5Ch] [bp-9Ch]@32 | 1078 POINT v97; // [sp+5Ch] [bp-9Ch]@32 |
1079 POINT a2; // [sp+64h] [bp-94h]@8 | 1079 POINT a2; // [sp+64h] [bp-94h]@8 |
1080 POINT v99; // [sp+6Ch] [bp-8Ch]@32 | 1080 POINT v99; // [sp+6Ch] [bp-8Ch]@32 |
1081 POINT v100; // [sp+74h] [bp-84h]@8 | 1081 POINT v100; // [sp+74h] [bp-84h]@8 |
1082 GUIWindow v101; // [sp+7Ch] [bp-7Ch]@1 | 1082 GUIWindow dialog_window; // [sp+7Ch] [bp-7Ch]@1 |
1083 char *Str; // [sp+D0h] [bp-28h]@55 | 1083 char *Str; // [sp+D0h] [bp-28h]@55 |
1084 __int32 v103; // [sp+D4h] [bp-24h]@25 | 1084 __int32 v103; // [sp+D4h] [bp-24h]@25 |
1085 int v104; // [sp+D8h] [bp-20h]@1 | 1085 int pColor2; // [sp+D8h] [bp-20h]@1 |
1086 int v105; // [sp+DCh] [bp-1Ch]@1 | 1086 int pColorWhite; // [sp+DCh] [bp-1Ch]@1 |
1087 POINT v106; // [sp+E0h] [bp-18h]@8 | 1087 POINT v106; // [sp+E0h] [bp-18h]@8 |
1088 Player *_this; // [sp+E8h] [bp-10h]@1 | 1088 Player *pPlayer; // [sp+E8h] [bp-10h]@1 |
1089 int v108; // [sp+ECh] [bp-Ch]@26 | 1089 int v108; // [sp+ECh] [bp-Ch]@26 |
1090 const char **v109; // [sp+F0h] [bp-8h]@26 | 1090 const char **v109; // [sp+F0h] [bp-8h]@26 |
1091 unsigned __int8 v110; // [sp+F7h] [bp-1h]@16 | 1091 unsigned __int8 v110; // [sp+F7h] [bp-1h]@16 |
1092 | 1092 |
1093 v0 = pPlayers[uActiveCharacter]; | 1093 //v0 = pPlayers[uActiveCharacter]; |
1094 _this = pPlayers[uActiveCharacter]; | 1094 pPlayer = pPlayers[uActiveCharacter]; |
1095 memcpy(&v101, window_SpeakInHouse, sizeof(v101)); | 1095 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window)); |
1096 v101.uFrameX = 483; | 1096 dialog_window.uFrameX = 483; |
1097 v101.uFrameWidth = 148; | 1097 dialog_window.uFrameWidth = 148; |
1098 v101.uFrameZ = 334; | 1098 dialog_window.uFrameZ = 334; |
1099 v105 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 1099 pColorWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); |
1100 v104 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); | 1100 pColor2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); |
1101 switch(dialog_menu_id) | 1101 switch(dialog_menu_id) |
1102 { | 1102 { |
1103 case 94: | 1103 case DIALOG_SHOP_DISPLAY_EQUIPMENT: |
1104 { | 1104 { |
1105 draw_leather(); | 1105 draw_leather(); |
1106 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | 1106 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); |
1107 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200]; | 1107 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];//sell |
1108 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113]; | 1108 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];//identify |
1109 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179]; | 1109 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];//repair |
1110 v65 = 0; | 1110 all_text_height = 0; |
1111 v66 = pShopOptions; | 1111 for(int i = 0; i < 3; ++i) |
1112 do | 1112 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
1113 { | |
1114 v67 = pFontArrus->CalcTextHeight(*v66, &v101, 0, 0); | |
1115 ++v66; | |
1116 v65 += v67; | |
1117 } | |
1118 while ( (signed int)v66 < (signed int)&pShopOptions[3] ); | |
1119 v68 = pDialogueWindow; | 1113 v68 = pDialogueWindow; |
1120 v109 = (const char **)((174 - v65) / 3); | 1114 v109 = (const char **)((174 - all_text_height) / 3); |
1121 result = (char *)pDialogueWindow->pStartingPosActiveItem; | 1115 result = (char *)pDialogueWindow->pStartingPosActiveItem; |
1122 v69 = (int)&result[pDialogueWindow->pNumPresenceButton]; | 1116 v69 = (int)&result[pDialogueWindow->pNumPresenceButton]; |
1123 v70 = (3 * (58 - (signed int)v109) - v65) / 2 - (174 - v65) / 3 / 2 + 138; | 1117 v70 = (3 * (58 - (signed int)v109) - all_text_height) / 2 - ((174 - all_text_height) / 3) / 2 + 138; |
1124 v20 = -pDialogueWindow->pNumPresenceButton < 0; | 1118 v20 = -pDialogueWindow->pNumPresenceButton < 0; |
1125 v106.y = pDialogueWindow->pStartingPosActiveItem; | 1119 v106.y = pDialogueWindow->pStartingPosActiveItem; |
1126 if ( v20 ^ __OFSUB__((int)result, (int)v69) ) | 1120 if ( v20 ^ __OFSUB__((int)result, (int)v69) ) |
1127 { | 1121 { |
1128 _this = (Player *)2; | 1122 pPlayer = (Player *)2; |
1129 v108 = (int)pShopOptions; | 1123 v108 = (int)pShopOptions; |
1130 do | 1124 do |
1131 { | 1125 { |
1132 v71 = v68->GetControl(v106.y); | 1126 v71 = v68->GetControl(v106.y); |
1133 v72 = (const char **)v108; | 1127 v72 = (const char **)v108; |
1134 v71->uY = (unsigned int)((char *)v109 + v70); | 1128 v71->uY = (unsigned int)((char *)v109 + v70); |
1135 v73 = pFontArrus->CalcTextHeight(*v72, &v101, 0, 0); | 1129 v73 = pFontArrus->CalcTextHeight(*v72, &dialog_window, 0, 0); |
1136 v74 = v71->uY; | 1130 v74 = v71->uY; |
1137 v75 = _this; | 1131 v75 = pPlayer; |
1138 v71->uHeight = v73; | 1132 v71->uHeight = v73; |
1139 v70 = v73 + v74 - 1; | 1133 v70 = v73 + v74 - 1; |
1140 v71->uW = v70; | 1134 v71->uW = v70; |
1141 v76 = v104; | 1135 v76 = pColor2; |
1142 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v75 ) | 1136 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v75 ) |
1143 v76 = v105; | 1137 v76 = pColorWhite; |
1144 v101.DrawTitleText(pFontArrus, 0, v74, v76, *(const char **)v108, 3u); | 1138 dialog_window.DrawTitleText(pFontArrus, 0, v74, v76, *(const char **)v108, 3u); |
1145 v68 = pDialogueWindow; | 1139 v68 = pDialogueWindow; |
1146 _this = (Player *)((char *)_this + 1); | 1140 pPlayer = (Player *)((char *)pPlayer + 1); |
1147 v108 += 4; | 1141 v108 += 4; |
1148 ++v106.y; | 1142 ++v106.y; |
1149 result = (char *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem); | 1143 result = (char *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem); |
1150 } | 1144 } |
1151 while ( v106.y < (signed int)result ); | 1145 while ( v106.y < (signed int)result ); |
1152 } | 1146 } |
1153 break; | 1147 break; |
1154 } | 1148 } |
1155 case 96: | 1149 case DIALOG_SHOP_SKILLS: |
1156 { | 1150 { |
1157 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | 1151 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); |
1158 if ( result ) | 1152 if ( result ) |
1159 { | 1153 { |
1160 v30 = pDialogueWindow; | 1154 v30 = pDialogueWindow; |
1161 v3 = 0; | 1155 v3 = 0; |
1162 v31 = window_SpeakInHouse->ptr_1C; | 1156 v31 = window_SpeakInHouse->ptr_1C; |
1163 v106.y = 0; | 1157 v106.y = 0; |
1164 //v32 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v31] * 500.0); | 1158 //v32 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v31] * 500.0); |
1165 v32 = (signed __int64)(p2DEvents[(signed int)v31 - 1].flt_24 * 500.0); | 1159 v32 = (signed __int64)(p2DEvents[(signed int)v31 - 1].flt_24 * 500.0); |
1166 v108 = v32 * (100 - _this->GetMerchant()) / 100; | 1160 v108 = v32 * (100 - pPlayer->GetMerchant()) / 100; |
1167 if ( v108 < v32 / 3 ) | 1161 if ( v108 < v32 / 3 ) |
1168 v108 = v32 / 3; | 1162 v108 = v32 / 3; |
1169 v33 = v30->pStartingPosActiveItem; | 1163 v33 = v30->pStartingPosActiveItem; |
1170 v34 = v33 + v30->pNumPresenceButton; | 1164 v34 = v33 + v30->pNumPresenceButton; |
1171 v109 = 0; | 1165 v109 = 0; |
1172 if ( (signed int)v33 >= v34 ) | 1166 if ( (signed int)v33 >= v34 ) |
1173 { | 1167 { |
1174 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->classType]); | 1168 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]); |
1175 strcat(pTmpBuf, "\n \n"); | 1169 strcat(pTmpBuf, "\n \n"); |
1176 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); | 1170 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); |
1177 v7 = pTmpBuf; | 1171 v7 = pTmpBuf; |
1178 v86 = 3; | 1172 v86 = 3; |
1179 v84 = pTmpBuf; | 1173 v84 = pTmpBuf; |
1180 v82 = v104; | 1174 v82 = pColor2; |
1181 v80 = 0; | 1175 v80 = 0; |
1182 v78 = 0; | 1176 v78 = 0; |
1183 v77 = &v101; | 1177 v77 = &dialog_window; |
1184 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); | 1178 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); |
1185 return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); | 1179 dialog_window.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); |
1186 } | 1180 } |
1187 do | 1181 do |
1188 { | 1182 { |
1189 v35 = v30->GetControl(v33)->uControlParam - 36; | 1183 v35 = v30->GetControl(v33)->uControlParam - 36; |
1190 if ( byte_4ED970_skill_learn_ability_by_class_table[_this->classType][v35] && !_this->pActiveSkills[v35] ) | 1184 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v35] && !pPlayer->pActiveSkills[v35] ) |
1191 { | 1185 { |
1192 v36 = pFontArrus->CalcTextHeight(pSkillNames[v35], &v101, 0, 0); | 1186 v36 = pFontArrus->CalcTextHeight(pSkillNames[v35], &dialog_window, 0, 0); |
1193 v106.y += v36; | 1187 v106.y += v36; |
1194 v109 = (const char **)((char *)v109 + 1); | 1188 v109 = (const char **)((char *)v109 + 1); |
1195 } | 1189 } |
1196 ++v33; | 1190 ++v33; |
1197 } | 1191 } |
1198 while ( (signed int)v33 < v30->pNumPresenceButton + v30->pStartingPosActiveItem ); | 1192 while ( (signed int)v33 < v30->pNumPresenceButton + v30->pStartingPosActiveItem ); |
1199 if ( !v109 ) | 1193 if ( !v109 ) |
1200 { | 1194 { |
1201 //LABEL_105: | 1195 //LABEL_105: |
1202 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->classType]); | 1196 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]); |
1203 strcat(pTmpBuf, "\n \n"); | 1197 strcat(pTmpBuf, "\n \n"); |
1204 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); | 1198 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); |
1205 v7 = pTmpBuf; | 1199 v7 = pTmpBuf; |
1206 v86 = 3; | 1200 v86 = 3; |
1207 v84 = pTmpBuf; | 1201 v84 = pTmpBuf; |
1208 v82 = v104; | 1202 v82 = pColor2; |
1209 v80 = 0; | 1203 v80 = 0; |
1210 v78 = 0; | 1204 v78 = 0; |
1211 v77 = &v101; | 1205 v77 = &dialog_window; |
1212 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); | 1206 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); |
1213 return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); | 1207 dialog_window.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); |
1214 } | 1208 } |
1215 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v108); | 1209 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v108); |
1216 v101.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); | 1210 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); |
1217 v108 = (149 - v106.y) / (signed int)v109; | 1211 v108 = (149 - v106.y) / (signed int)v109; |
1218 if ( (149 - v106.y) / (signed int)v109 > 32 ) | 1212 if ( (149 - v106.y) / (signed int)v109 > 32 ) |
1219 v108 = 32; | 1213 v108 = 32; |
1220 result = (char *)v30->pStartingPosActiveItem; | 1214 result = (char *)v30->pStartingPosActiveItem; |
1221 v37 = (149 - (signed int)v109 * v108 - v106.y) / 2 - v108 / 2 + 162; | 1215 v37 = (149 - (signed int)v109 * v108 - v106.y) / 2 - v108 / 2 + 162; |
1227 do | 1221 do |
1228 { | 1222 { |
1229 v38 = v30->GetControl(v106.y); | 1223 v38 = v30->GetControl(v106.y); |
1230 v39 = v38; | 1224 v39 = v38; |
1231 v40 = v38->uControlParam - 36; | 1225 v40 = v38->uControlParam - 36; |
1232 if ( !byte_4ED970_skill_learn_ability_by_class_table[_this->classType][v40] || _this->pActiveSkills[v40] ) | 1226 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v40] || pPlayer->pActiveSkills[v40] ) |
1233 { | 1227 { |
1234 v39->uW = 0; | 1228 v39->uW = 0; |
1235 v39->uHeight = 0; | 1229 v39->uHeight = 0; |
1236 v39->uY = 0; | 1230 v39->uY = 0; |
1237 } | 1231 } |
1238 else | 1232 else |
1239 { | 1233 { |
1240 v41 = pSkillNames[v40]; | 1234 v41 = pSkillNames[v40]; |
1241 v39->uY = v108 + v103; | 1235 v39->uY = v108 + v103; |
1242 Str = v41; | 1236 Str = v41; |
1243 v42 = pFontArrus->CalcTextHeight(v41, &v101, 0, 0); | 1237 v42 = pFontArrus->CalcTextHeight(v41, &dialog_window, 0, 0); |
1244 v43 = v39->uY; | 1238 v43 = v39->uY; |
1245 v44 = v109; | 1239 v44 = v109; |
1246 v39->uHeight = v42; | 1240 v39->uHeight = v42; |
1247 v45 = v43 + v42 - 1; | 1241 v45 = v43 + v42 - 1; |
1248 v39->uW = v45; | 1242 v39->uW = v45; |
1249 v103 = v45; | 1243 v103 = v45; |
1250 v46 = v104; | 1244 v46 = pColor2; |
1251 if ( (const char **)pDialogueWindow->pCurrentPosActiveItem != v44 ) | 1245 if ( (const char **)pDialogueWindow->pCurrentPosActiveItem != v44 ) |
1252 v46 = v105; | 1246 v46 = pColorWhite; |
1253 v101.DrawTitleText(pFontArrus, 0, v43, v46, Str, 3u); | 1247 dialog_window.DrawTitleText(pFontArrus, 0, v43, v46, Str, 3u); |
1254 } | 1248 } |
1255 v47 = v30->pStartingPosActiveItem; | 1249 v47 = v30->pStartingPosActiveItem; |
1256 ++v106.y; | 1250 ++v106.y; |
1257 result = (char *)(v30->pNumPresenceButton + v47); | 1251 result = (char *)(v30->pNumPresenceButton + v47); |
1258 v109 = (const char **)((char *)v109 + 1); | 1252 v109 = (const char **)((char *)v109 + 1); |
1260 while ( v106.y < (signed int)result ); | 1254 while ( v106.y < (signed int)result ); |
1261 } | 1255 } |
1262 } | 1256 } |
1263 break; | 1257 break; |
1264 } | 1258 } |
1265 case 95: | 1259 case DIALOG_SHOP_BUY_SPECIAL: |
1266 { | 1260 { |
1267 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); | 1261 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); |
1268 v3 = 0; | 1262 v3 = 0; |
1269 v109 = 0; | 1263 v109 = 0; |
1270 v108 = 0; | 1264 v108 = 0; |
1298 ++v106.x; | 1292 ++v106.x; |
1299 ++v55; | 1293 ++v55; |
1300 } | 1294 } |
1301 while ( v55 < 6 ); | 1295 while ( v55 < 6 ); |
1302 v56 = GetAsyncKeyState(17); | 1296 v56 = GetAsyncKeyState(17); |
1303 v57 = _this->CanSteal(); | 1297 v57 = pPlayer->CanSteal(); |
1304 Str = (char *)v57; | 1298 Str = (char *)v57; |
1305 if ( v56 && v57 ) | 1299 if ( v56 && v57 ) |
1306 { | 1300 { |
1307 v58 = pGlobalTXT_LocalizationStrings[185]; | 1301 v58 = pGlobalTXT_LocalizationStrings[185]; |
1308 } | 1302 } |
1331 v85 = 0; | 1325 v85 = 0; |
1332 v83 = 2; | 1326 v83 = 2; |
1333 v81 = window_SpeakInHouse->ptr_1C; | 1327 v81 = window_SpeakInHouse->ptr_1C; |
1334 v79 = v63; | 1328 v79 = v63; |
1335 v110 = uActiveCharacter - 1; | 1329 v110 = uActiveCharacter - 1; |
1336 v64 = _this->_490EEE(v63, 1, v61, 2); | 1330 v64 = pPlayer->_490EEE(v63, 1, v61, 2); |
1337 v6 = v110; | 1331 v6 = v110; |
1338 v5 = (char *)pMerchantsBuyPhrases[v64]; | 1332 v5 = (char *)pMerchantsBuyPhrases[v64]; |
1339 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); | 1333 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); |
1340 v86 = 3; | 1334 v86 = 3; |
1341 v84 = v7; | 1335 v84 = v7; |
1342 v82 = v105; | 1336 v82 = pColorWhite; |
1343 v80 = v3; | 1337 v80 = v3; |
1344 v78 = v3; | 1338 v78 = v3; |
1345 v77 = &v101; | 1339 v77 = &dialog_window; |
1346 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); | 1340 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); |
1347 return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); | 1341 dialog_window.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); |
1348 } | 1342 } |
1349 v5 = pGlobalTXT_LocalizationStrings[181]; | 1343 v5 = pGlobalTXT_LocalizationStrings[181]; |
1350 v85 = 0; | 1344 v85 = 0; |
1351 v83 = 2; | 1345 v83 = 2; |
1352 v81 = window_SpeakInHouse->ptr_1C; | 1346 v81 = window_SpeakInHouse->ptr_1C; |
1353 v79 = v63; | 1347 v79 = v63; |
1354 v6 = uActiveCharacter - 1; | 1348 v6 = uActiveCharacter - 1; |
1355 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); | 1349 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); |
1356 v86 = 3; | 1350 v86 = 3; |
1357 v84 = v7; | 1351 v84 = v7; |
1358 v82 = v105; | 1352 v82 = pColorWhite; |
1359 v80 = v3; | 1353 v80 = v3; |
1360 v78 = v3; | 1354 v78 = v3; |
1361 v77 = &v101; | 1355 v77 = &dialog_window; |
1362 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); | 1356 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); |
1363 return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); | 1357 dialog_window.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); |
1364 } | 1358 } |
1365 } | 1359 } |
1366 else | 1360 else |
1367 { | 1361 { |
1368 v101.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); | 1362 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); |
1369 result =0; //added | 1363 result =0; //added |
1370 } | 1364 } |
1371 } | 1365 } |
1372 break; | 1366 break; |
1373 } | 1367 } |
1374 case 2: | 1368 case DIALOG_SHOP_BUY_STANDART: |
1375 { | 1369 { |
1376 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); | 1370 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); |
1377 v3 = 0; | 1371 v3 = 0; |
1378 v48 = 0; | 1372 v48 = 0; |
1379 v108 = 0; | 1373 v108 = 0; |
1411 ++v106.x; | 1405 ++v106.x; |
1412 ++v55; | 1406 ++v55; |
1413 } | 1407 } |
1414 while ( v55 < 6 ); | 1408 while ( v55 < 6 ); |
1415 v56 = GetAsyncKeyState(17); | 1409 v56 = GetAsyncKeyState(17); |
1416 v57 = _this->CanSteal(); | 1410 v57 = pPlayer->CanSteal(); |
1417 Str = (char *)v57; | 1411 Str = (char *)v57; |
1418 if ( v56 && v57 ) | 1412 if ( v56 && v57 ) |
1419 { | 1413 { |
1420 v58 = pGlobalTXT_LocalizationStrings[185]; | 1414 v58 = pGlobalTXT_LocalizationStrings[185]; |
1421 } | 1415 } |
1444 v85 = 0; | 1438 v85 = 0; |
1445 v83 = 2; | 1439 v83 = 2; |
1446 v81 = window_SpeakInHouse->ptr_1C; | 1440 v81 = window_SpeakInHouse->ptr_1C; |
1447 v79 = v63; | 1441 v79 = v63; |
1448 v110 = uActiveCharacter - 1; | 1442 v110 = uActiveCharacter - 1; |
1449 v64 = _this->_490EEE(v63, 1, v61, 2); | 1443 v64 = pPlayer->_490EEE(v63, 1, v61, 2); |
1450 v6 = v110; | 1444 v6 = v110; |
1451 v5 = (char *)pMerchantsBuyPhrases[v64]; | 1445 v5 = (char *)pMerchantsBuyPhrases[v64]; |
1452 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); | 1446 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); |
1453 v86 = 3; | 1447 v86 = 3; |
1454 v84 = v7; | 1448 v84 = v7; |
1455 v82 = v105; | 1449 v82 = pColorWhite; |
1456 v80 = v3; | 1450 v80 = v3; |
1457 v78 = v3; | 1451 v78 = v3; |
1458 v77 = &v101; | 1452 v77 = &dialog_window; |
1459 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); | 1453 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); |
1460 return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); | 1454 dialog_window.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); |
1461 } | 1455 } |
1462 v5 = pGlobalTXT_LocalizationStrings[181]; | 1456 v5 = pGlobalTXT_LocalizationStrings[181]; |
1463 v85 = 0; | 1457 v85 = 0; |
1464 v83 = 2; | 1458 v83 = 2; |
1465 v81 = window_SpeakInHouse->ptr_1C; | 1459 v81 = window_SpeakInHouse->ptr_1C; |
1466 v79 = v63; | 1460 v79 = v63; |
1467 v6 = uActiveCharacter - 1; | 1461 v6 = uActiveCharacter - 1; |
1468 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); | 1462 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); |
1469 v86 = 3; | 1463 v86 = 3; |
1470 v84 = v7; | 1464 v84 = v7; |
1471 v82 = v105; | 1465 v82 = pColorWhite; |
1472 v80 = v3; | 1466 v80 = v3; |
1473 v78 = v3; | 1467 v78 = v3; |
1474 v77 = &v101; | 1468 v77 = &dialog_window; |
1475 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); | 1469 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); |
1476 return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); | 1470 dialog_window.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); |
1477 } | 1471 } |
1478 } | 1472 } |
1479 else | 1473 else |
1480 { | 1474 { |
1481 v101.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); | 1475 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); |
1482 result =0; //added | 1476 result =0; //added |
1483 } | 1477 } |
1484 } | 1478 } |
1485 break; | 1479 break; |
1486 } | 1480 } |
1487 case 3: | 1481 case DIALOG_SHOP_SELL: |
1488 { | 1482 { |
1489 draw_leather(); | 1483 draw_leather(); |
1490 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | 1484 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); |
1491 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0); | 1485 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0); |
1492 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | 1486 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); |
1498 if ( *(int *)result > 13 ) | 1492 if ( *(int *)result > 13 ) |
1499 { | 1493 { |
1500 result = (char *)pMouse->GetCursorPos(&v90); | 1494 result = (char *)pMouse->GetCursorPos(&v90); |
1501 if ( *(int *)result < 462 ) | 1495 if ( *(int *)result < 462 ) |
1502 { | 1496 { |
1503 result = (char *)v0->GetItemIDAtInventoryIndex((int *)&v106.x); | 1497 result = (char *)pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x); |
1504 v3 = 0; | 1498 v3 = 0; |
1505 if ( result ) | 1499 if ( result ) |
1506 { | 1500 { |
1507 v85 = 0; | 1501 v85 = 0; |
1508 v83 = 3; | 1502 v83 = 3; |
1509 v81 = window_SpeakInHouse->ptr_1C; | 1503 v81 = window_SpeakInHouse->ptr_1C; |
1510 v79 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5]; | 1504 v79 = (ItemGen *)&pPlayer->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5]; |
1511 v12 = (int)window_SpeakInHouse->ptr_1C; | 1505 v12 = (int)window_SpeakInHouse->ptr_1C; |
1512 v110 = uActiveCharacter - 1; | 1506 v110 = uActiveCharacter - 1; |
1513 v13 = _this->_490EEE(v79, 1, v12, 3); | 1507 v13 = pPlayer->_490EEE(v79, 1, v12, 3); |
1514 v6 = v110; | 1508 v6 = v110; |
1515 v5 = (char *)pMerchantsSellPhrases[v13]; | 1509 v5 = (char *)pMerchantsSellPhrases[v13]; |
1516 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); | 1510 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); |
1517 v86 = 3; | 1511 v86 = 3; |
1518 v84 = v7; | 1512 v84 = v7; |
1519 v82 = v105; | 1513 v82 = pColorWhite; |
1520 v80 = v3; | 1514 v80 = v3; |
1521 v78 = v3; | 1515 v78 = v3; |
1522 v77 = &v101; | 1516 v77 = &dialog_window; |
1523 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); | 1517 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); |
1524 return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); | 1518 dialog_window.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); |
1525 } | 1519 } |
1526 } | 1520 } |
1527 } | 1521 } |
1528 } | 1522 } |
1529 break; | 1523 break; |
1530 } | 1524 } |
1531 case 4: | 1525 case DIALOG_SHOP_IDENTIFY: |
1532 { | 1526 { |
1533 draw_leather(); | 1527 draw_leather(); |
1534 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | 1528 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); |
1535 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); | 1529 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); |
1536 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | 1530 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); |
1542 if ( *(int *)result > 13 ) | 1536 if ( *(int *)result > 13 ) |
1543 { | 1537 { |
1544 result = (char *)pMouse->GetCursorPos(&v92); | 1538 result = (char *)pMouse->GetCursorPos(&v92); |
1545 if ( *(int *)result < 462 ) | 1539 if ( *(int *)result < 462 ) |
1546 { | 1540 { |
1547 result = (char *)v0->GetItemIDAtInventoryIndex((int *)&v106.x); | 1541 result = (char *)pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x); |
1548 v3 = 0; | 1542 v3 = 0; |
1549 if ( result ) | 1543 if ( result ) |
1550 { | 1544 { |
1551 v85 = 0; | 1545 v85 = 0; |
1552 v83 = 4; | 1546 v83 = 4; |
1553 v4 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5]; | 1547 v4 = (ItemGen *)&pPlayer->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5]; |
1554 if (!v4->Identified()) | 1548 if (!v4->Identified()) |
1555 { | 1549 { |
1556 v81 = window_SpeakInHouse->ptr_1C; | 1550 v81 = window_SpeakInHouse->ptr_1C; |
1557 v79 = v4; | 1551 v79 = v4; |
1558 v9 = (int)window_SpeakInHouse->ptr_1C; | 1552 v9 = (int)window_SpeakInHouse->ptr_1C; |
1559 v110 = uActiveCharacter - 1; | 1553 v110 = uActiveCharacter - 1; |
1560 v10 = _this->_490EEE(v4, 1, v9, 4); | 1554 v10 = pPlayer->_490EEE(v4, 1, v9, 4); |
1561 v6 = v110; | 1555 v6 = v110; |
1562 v5 = (char *)pMerchantsIdentifyPhrases[v10]; | 1556 v5 = (char *)pMerchantsIdentifyPhrases[v10]; |
1563 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); | 1557 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); |
1564 v86 = 3; | 1558 v86 = 3; |
1565 v84 = v7; | 1559 v84 = v7; |
1566 v82 = v105; | 1560 v82 = pColorWhite; |
1567 v80 = v3; | 1561 v80 = v3; |
1568 v78 = v3; | 1562 v78 = v3; |
1569 v77 = &v101; | 1563 v77 = &dialog_window; |
1570 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); | 1564 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); |
1571 return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); | 1565 dialog_window.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); |
1572 } | 1566 } |
1573 v81 = window_SpeakInHouse->ptr_1C; | 1567 v81 = window_SpeakInHouse->ptr_1C; |
1574 v5 = "%24"; | 1568 v5 = "%24"; |
1575 v79 = v4; | 1569 v79 = v4; |
1576 //LABEL_13: | 1570 //LABEL_13: |
1577 v6 = uActiveCharacter - 1; | 1571 v6 = uActiveCharacter - 1; |
1578 //LABEL_14: | 1572 //LABEL_14: |
1579 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); | 1573 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); |
1580 v86 = 3; | 1574 v86 = 3; |
1581 v84 = v7; | 1575 v84 = v7; |
1582 v82 = v105; | 1576 v82 = pColorWhite; |
1583 v80 = v3; | 1577 v80 = v3; |
1584 v78 = v3; | 1578 v78 = v3; |
1585 v77 = &v101; | 1579 v77 = &dialog_window; |
1586 //LABEL_15: | 1580 //LABEL_15: |
1587 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); | 1581 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); |
1588 return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); | 1582 dialog_window.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); |
1589 } | 1583 } |
1590 } | 1584 } |
1591 } | 1585 } |
1592 } | 1586 } |
1593 break; | 1587 break; |
1594 } | 1588 } |
1595 case 1: | 1589 case DIALOG_SHOP_MAIN: |
1596 { | 1590 { |
1597 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | 1591 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); |
1598 if ( result ) | 1592 if ( result ) |
1599 { | 1593 { |
1600 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; | 1594 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; |
1601 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; | 1595 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; |
1602 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; | 1596 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; |
1603 v14 = 0; | 1597 //v14 = 0; |
1604 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; | 1598 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; |
1605 v15 = pShopOptions; | 1599 all_text_height = 0; |
1600 /*v15 = pShopOptions; | |
1606 do | 1601 do |
1607 { | 1602 { |
1608 v16 = pFontArrus->CalcTextHeight(*v15, &v101, 0, 0); | 1603 v16 = pFontArrus->CalcTextHeight(*v15, &dialog_window, 0, 0); |
1609 ++v15; | 1604 ++v15; |
1610 v14 += v16; | 1605 v14 += v16; |
1611 } | 1606 } |
1612 while ( (signed int)v15 < (signed int)&unk_F8B1C8 ); | 1607 while ( (signed int)v15 < (signed int)&unk_F8B1C8 );*/ |
1608 for(int i =0; i < 4; ++i) | |
1609 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | |
1613 v17 = pDialogueWindow; | 1610 v17 = pDialogueWindow; |
1614 v103 = (174 - v14) / 4; | 1611 v103 = (174 - all_text_height) / 4; |
1615 result = (char *)pDialogueWindow->pStartingPosActiveItem; | 1612 result = (char *)pDialogueWindow->pStartingPosActiveItem; |
1616 v18 = (int)&result[pDialogueWindow->pNumPresenceButton]; | 1613 v18 = (int)&result[pDialogueWindow->pNumPresenceButton]; |
1617 v19 = (174 - 4 * (174 - v14) / 4 - v14) / 2 - (174 - v14) / 4 / 2 + 138; | 1614 v19 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138; |
1618 v20 = -pDialogueWindow->pNumPresenceButton < 0; | 1615 v20 = -pDialogueWindow->pNumPresenceButton < 0; |
1619 _this = (Player *)pDialogueWindow->pStartingPosActiveItem; | 1616 pPlayer = (Player *)pDialogueWindow->pStartingPosActiveItem; |
1620 if ( v20 ^ __OFSUB__((int)result, v18) ) | 1617 if ( v20 ^ __OFSUB__((int)result, v18) ) |
1621 { | 1618 { |
1622 v108 = 2; | 1619 v108 = 2; |
1623 v109 = (const char **)pShopOptions; | 1620 v109 = (const char **)pShopOptions; |
1624 do | 1621 do |
1625 { | 1622 { |
1626 v21 = v17->GetControl((unsigned int)_this); | 1623 v21 = v17->GetControl((unsigned int)pPlayer); |
1627 v22 = v109; | 1624 v22 = v109; |
1628 v21->uY = v103 + v19; | 1625 v21->uY = v103 + v19; |
1629 v23 = pFontArrus->CalcTextHeight(*v22, &v101, 0, 0); | 1626 v23 = pFontArrus->CalcTextHeight(*v22, &dialog_window, 0, 0); |
1630 v24 = v21->uY; | 1627 v24 = v21->uY; |
1631 v25 = v108; | 1628 v25 = v108; |
1632 v21->uHeight = v23; | 1629 v21->uHeight = v23; |
1633 v19 = v24 + v23 - 1; | 1630 v19 = v24 + v23 - 1; |
1634 v21->uW = v19; | 1631 v21->uW = v19; |
1635 v26 = v104; | 1632 v26 = pColor2; |
1636 if ( pDialogueWindow->pCurrentPosActiveItem != v25 ) | 1633 if ( pDialogueWindow->pCurrentPosActiveItem != v25 ) |
1637 v26 = v105; | 1634 v26 = pColorWhite; |
1638 v101.DrawTitleText(pFontArrus, 0, v24, v26, *v109, 3u); | 1635 dialog_window.DrawTitleText(pFontArrus, 0, v24, v26, *v109, 3u); |
1639 v17 = pDialogueWindow; | 1636 v17 = pDialogueWindow; |
1640 ++v108; | 1637 ++v108; |
1641 ++v109; | 1638 ++v109; |
1642 _this = (Player *)((char *)_this + 1); | 1639 pPlayer = (Player *)((char *)pPlayer + 1); |
1643 result = (char *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem); | 1640 result = (char *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem); |
1644 } | 1641 } |
1645 while ( (signed int)_this < (signed int)result ); | 1642 while ( (signed int)pPlayer < (signed int)result ); |
1646 } | 1643 } |
1647 } | 1644 } |
1648 break; | 1645 break; |
1649 } | 1646 } |
1650 default: | 1647 default: |
1654 else | 1651 else |
1655 result = (char *)(dialog_menu_id - 4); | 1652 result = (char *)(dialog_menu_id - 4); |
1656 break; | 1653 break; |
1657 } | 1654 } |
1658 } | 1655 } |
1659 return result; | |
1660 } | 1656 } |
1661 | 1657 |
1662 | 1658 |
1663 //----- (004B9CC6) -------------------------------------------------------- | 1659 //----- (004B9CC6) -------------------------------------------------------- |
1664 POINT *__cdecl AlchemistDialog() | 1660 POINT *__cdecl AlchemistDialog() |
2526 dialog_window.uFrameWidth = 148; | 2522 dialog_window.uFrameWidth = 148; |
2527 dialog_window.uFrameZ = 334; | 2523 dialog_window.uFrameZ = 334; |
2528 m_text_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 2524 m_text_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); |
2529 hilight_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); | 2525 hilight_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); |
2530 switch (dialog_menu_id) | 2526 switch (dialog_menu_id) |
2531 { | 2527 { |
2532 case 1: //main shop text | 2528 case DIALOG_SHOP_MAIN: |
2533 { | 2529 { |
2534 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 2530 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
2535 return; | 2531 return; |
2536 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard" | 2532 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard" |
2537 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special" | 2533 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special" |
2564 ++j; | 2560 ++j; |
2565 } | 2561 } |
2566 } | 2562 } |
2567 } | 2563 } |
2568 break; | 2564 break; |
2569 case 2: //buy standart | 2565 case DIALOG_SHOP_BUY_STANDART: |
2570 { | 2566 { |
2571 pRenderer->DrawTextureIndexed(8, 8, ShopTexture); | 2567 pRenderer->DrawTextureIndexed(8, 8, ShopTexture); |
2572 textureW = 0; | 2568 textureW = 0; |
2573 v153 = 0; | 2569 v153 = 0; |
2574 for(int i=0; i<8; ++i) | 2570 for(int i=0; i<8; ++i) |
2644 } | 2640 } |
2645 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[window_SpeakInHouse->par1C]- pParty->uTimePlayed); | 2641 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[window_SpeakInHouse->par1C]- pParty->uTimePlayed); |
2646 return; | 2642 return; |
2647 } | 2643 } |
2648 break; | 2644 break; |
2649 case 3: //sell | 2645 case DIALOG_SHOP_SELL: |
2650 { | 2646 { |
2651 draw_leather(); | 2647 draw_leather(); |
2652 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | 2648 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); |
2653 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);//"Select the Item to Sell" | 2649 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);//"Select the Item to Sell" |
2654 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) | 2650 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) |
2671 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138; | 2667 v115 = (174 - pFontArrus->CalcTextHeight(v36, &dialog_window, 0, 0)) / 2 + 138; |
2672 dialog_window.DrawTitleText(pFontArrus, 0, v115, m_text_color, v36, 3); | 2668 dialog_window.DrawTitleText(pFontArrus, 0, v115, m_text_color, v36, 3); |
2673 return; | 2669 return; |
2674 } | 2670 } |
2675 break; | 2671 break; |
2676 case 4: //identify | 2672 case DIALOG_SHOP_IDENTIFY: |
2677 { | 2673 { |
2678 draw_leather(); | 2674 draw_leather(); |
2679 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | 2675 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); |
2680 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); //"Select the Item to Identify" | 2676 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); //"Select the Item to Identify" |
2681 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 2677 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
2715 } | 2711 } |
2716 } | 2712 } |
2717 } | 2713 } |
2718 } | 2714 } |
2719 break; | 2715 break; |
2720 case 5: //repair | 2716 case DIALOG_SHOP_REPAIR: |
2721 { | 2717 { |
2722 draw_leather(); | 2718 draw_leather(); |
2723 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | 2719 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); |
2724 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0); | 2720 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0); |
2725 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) | 2721 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) |
2811 } | 2807 } |
2812 dialog_window.DrawCurrentTime(pParty->field_3C.field_50[window_SpeakInHouse->par1C]- pParty->uTimePlayed); | 2808 dialog_window.DrawCurrentTime(pParty->field_3C.field_50[window_SpeakInHouse->par1C]- pParty->uTimePlayed); |
2813 return; | 2809 return; |
2814 } | 2810 } |
2815 break; | 2811 break; |
2816 case 94: //character inventory | 2812 case DIALOG_SHOP_DISPLAY_EQUIPMENT: |
2817 { | 2813 { |
2818 draw_leather(); | 2814 draw_leather(); |
2819 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | 2815 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); |
2820 v79 = pShopOptions; | 2816 v79 = pShopOptions; |
2821 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200]; //"Sell" | 2817 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200]; //"Sell" |
2858 while ( (signed int)_this < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); | 2854 while ( (signed int)_this < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); |
2859 } | 2855 } |
2860 return; | 2856 return; |
2861 } | 2857 } |
2862 break; | 2858 break; |
2863 case 95: //buy spesial | 2859 case DIALOG_SHOP_BUY_SPECIAL: |
2864 { | 2860 { |
2865 | |
2866 pRenderer->DrawTextureIndexed(8, 8, ShopTexture); | 2861 pRenderer->DrawTextureIndexed(8, 8, ShopTexture); |
2867 | |
2868 v11 = 0; | 2862 v11 = 0; |
2869 v61 = 0; | 2863 v61 = 0; |
2870 v153 = 0; | 2864 v153 = 0; |
2871 do | 2865 do |
2872 { | 2866 { |
2949 return; | 2943 return; |
2950 } | 2944 } |
2951 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[window_SpeakInHouse->par1C]- pParty->uTimePlayed); | 2945 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[window_SpeakInHouse->par1C]- pParty->uTimePlayed); |
2952 return; | 2946 return; |
2953 } | 2947 } |
2954 | |
2955 break; | 2948 break; |
2956 case 96: //skills | 2949 case DIALOG_SHOP_SKILLS: |
2957 { | 2950 { |
2958 | |
2959 if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 2951 if (!sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
2960 return; | 2952 return; |
2961 v152 = 0; | 2953 v152 = 0; |
2962 v37 = pDialogueWindow; | 2954 v37 = pDialogueWindow; |
2963 //v38 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0); | 2955 //v38 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0); |
3039 v115 = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138; | 3031 v115 = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138; |
3040 dialog_window.DrawTitleText(pFontArrus, 0, v115, hilight_color, pTmpBuf, 3); | 3032 dialog_window.DrawTitleText(pFontArrus, 0, v115, hilight_color, pTmpBuf, 3); |
3041 return; | 3033 return; |
3042 } | 3034 } |
3043 break; | 3035 break; |
3044 | 3036 } |
3045 } | |
3046 | |
3047 } | 3037 } |
3048 | 3038 |
3049 //----- (004BB756) -------------------------------------------------------- | 3039 //----- (004BB756) -------------------------------------------------------- |
3050 signed int __fastcall sub_4BB756(signed int a1) | 3040 signed int __fastcall sub_4BB756(signed int a1) |
3051 { | 3041 { |