comparison mm7_2.cpp @ 555:a09757c2c5e1

Merge
author Nomad
date Mon, 04 Mar 2013 22:45:22 +0200
parents 9caf59edb1ee b8339415fa98
children f451efdb7c8b
comparison
equal deleted inserted replaced
554:9caf59edb1ee 555:a09757c2c5e1
1096 v101.uFrameX = 483; 1096 v101.uFrameX = 483;
1097 v101.uFrameWidth = 148; 1097 v101.uFrameWidth = 148;
1098 v101.uFrameZ = 334; 1098 v101.uFrameZ = 334;
1099 v105 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 1099 v105 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
1100 v104 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); 1100 v104 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
1101 if ( dword_F8B19C > 5 ) 1101 switch(dword_F8B19C)
1102 { 1102 {
1103 if ( dword_F8B19C == 94 ) 1103 case 94:
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];
1108 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113]; 1108 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];
1109 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179]; 1109 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];
1110 v65 = 0; 1110 v65 = 0;
1111 v66 = pShopOptions; 1111 v66 = pShopOptions;
1112 do 1112 do
1113 { 1113 {
1114 v67 = pFontArrus->CalcTextHeight(*v66, &v101, 0, 0); 1114 v67 = pFontArrus->CalcTextHeight(*v66, &v101, 0, 0);
1115 ++v66; 1115 ++v66;
1116 v65 += v67; 1116 v65 += v67;
1117 } 1117 }
1118 while ( (signed int)v66 < (signed int)&pShopOptions[3] ); 1118 while ( (signed int)v66 < (signed int)&pShopOptions[3] );
1119 v68 = pDialogueWindow; 1119 v68 = pDialogueWindow;
1120 v109 = (const char **)((174 - v65) / 3); 1120 v109 = (const char **)((174 - v65) / 3);
1121 result = (char *)pDialogueWindow->pStartingPosActiveItem; 1121 result = (char *)pDialogueWindow->pStartingPosActiveItem;
1122 v69 = (int)&result[pDialogueWindow->pNumPresenceButton]; 1122 v69 = (int)&result[pDialogueWindow->pNumPresenceButton];
1123 v70 = (3 * (58 - (signed int)v109) - v65) / 2 - (174 - v65) / 3 / 2 + 138; 1123 v70 = (3 * (58 - (signed int)v109) - v65) / 2 - (174 - v65) / 3 / 2 + 138;
1124 v20 = -pDialogueWindow->pNumPresenceButton < 0; 1124 v20 = -pDialogueWindow->pNumPresenceButton < 0;
1125 v106.y = pDialogueWindow->pStartingPosActiveItem; 1125 v106.y = pDialogueWindow->pStartingPosActiveItem;
1126 if ( v20 ^ __OFSUB__((int)result, (int)v69) ) 1126 if ( v20 ^ __OFSUB__((int)result, (int)v69) )
1127 { 1127 {
1128 _this = (Player *)2; 1128 _this = (Player *)2;
1129 v108 = (int)pShopOptions; 1129 v108 = (int)pShopOptions;
1130 do 1130 do
1131 { 1131 {
1132 v71 = v68->GetControl(v106.y); 1132 v71 = v68->GetControl(v106.y);
1133 v72 = (const char **)v108; 1133 v72 = (const char **)v108;
1134 v71->uY = (unsigned int)((char *)v109 + v70); 1134 v71->uY = (unsigned int)((char *)v109 + v70);
1135 v73 = pFontArrus->CalcTextHeight(*v72, &v101, 0, 0); 1135 v73 = pFontArrus->CalcTextHeight(*v72, &v101, 0, 0);
1136 v74 = v71->uY; 1136 v74 = v71->uY;
1137 v75 = _this; 1137 v75 = _this;
1138 v71->uHeight = v73; 1138 v71->uHeight = v73;
1139 v70 = v73 + v74 - 1; 1139 v70 = v73 + v74 - 1;
1140 v71->uW = v70; 1140 v71->uW = v70;
1141 v76 = v104; 1141 v76 = v104;
1142 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v75 ) 1142 if ( (Player *)pDialogueWindow->pCurrentPosActiveItem != v75 )
1143 v76 = v105; 1143 v76 = v105;
1144 v101.DrawTitleText(pFontArrus, 0, v74, v76, *(const char **)v108, 3u); 1144 v101.DrawTitleText(pFontArrus, 0, v74, v76, *(const char **)v108, 3u);
1145 v68 = pDialogueWindow; 1145 v68 = pDialogueWindow;
1146 _this = (Player *)((char *)_this + 1); 1146 _this = (Player *)((char *)_this + 1);
1147 v108 += 4; 1147 v108 += 4;
1148 ++v106.y; 1148 ++v106.y;
1149 result = (char *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem); 1149 result = (char *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem);
1150 } 1150 }
1151 while ( v106.y < (signed int)result ); 1151 while ( v106.y < (signed int)result );
1152 } 1152 }
1153 return result; 1153 break;
1154 } 1154 }
1155 if ( dword_F8B19C != 95 ) 1155 case 96:
1156 { 1156 {
1157 result = (char *)(dword_F8B19C - 96);
1158 if ( dword_F8B19C == 96 )
1159 {
1160 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 1157 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
1161 if ( result ) 1158 if ( result )
1162 { 1159 {
1163 v30 = pDialogueWindow; 1160 v30 = pDialogueWindow;
1164 v3 = 0; 1161 v3 = 0;
1171 v108 = v32 / 3; 1168 v108 = v32 / 3;
1172 v33 = v30->pStartingPosActiveItem; 1169 v33 = v30->pStartingPosActiveItem;
1173 v34 = v33 + v30->pNumPresenceButton; 1170 v34 = v33 + v30->pNumPresenceButton;
1174 v109 = 0; 1171 v109 = 0;
1175 if ( (signed int)v33 >= v34 ) 1172 if ( (signed int)v33 >= v34 )
1176 goto LABEL_105; 1173 {
1174 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->classType]);
1175 strcat(pTmpBuf, "\n \n");
1176 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
1177 v7 = pTmpBuf;
1178 v86 = 3;
1179 v84 = pTmpBuf;
1180 v82 = v104;
1181 v80 = 0;
1182 v78 = 0;
1183 v77 = &v101;
1184 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80);
1185 return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86);
1186 }
1177 do 1187 do
1178 { 1188 {
1179 v35 = v30->GetControl(v33)->uControlParam - 36; 1189 v35 = v30->GetControl(v33)->uControlParam - 36;
1180 if ( byte_4ED970_skill_learn_ability_by_class_table[_this->classType][v35] && !_this->pActiveSkills[v35] ) 1190 if ( byte_4ED970_skill_learn_ability_by_class_table[_this->classType][v35] && !_this->pActiveSkills[v35] )
1181 { 1191 {
1186 ++v33; 1196 ++v33;
1187 } 1197 }
1188 while ( (signed int)v33 < v30->pNumPresenceButton + v30->pStartingPosActiveItem ); 1198 while ( (signed int)v33 < v30->pNumPresenceButton + v30->pStartingPosActiveItem );
1189 if ( !v109 ) 1199 if ( !v109 )
1190 { 1200 {
1191 LABEL_105: 1201 //LABEL_105:
1192 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->classType]); 1202 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->classType]);
1193 strcat(pTmpBuf, "\n \n"); 1203 strcat(pTmpBuf, "\n \n");
1194 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); 1204 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
1195 v7 = pTmpBuf; 1205 v7 = pTmpBuf;
1196 v86 = 3; 1206 v86 = 3;
1197 v84 = pTmpBuf; 1207 v84 = pTmpBuf;
1198 v82 = v104; 1208 v82 = v104;
1199 v80 = 0; 1209 v80 = 0;
1200 v78 = 0; 1210 v78 = 0;
1201 v77 = &v101; 1211 v77 = &v101;
1202 goto LABEL_15; 1212 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80);
1213 return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86);
1203 } 1214 }
1204 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v108); 1215 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v108);
1205 v101.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); 1216 v101.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
1206 v108 = (149 - v106.y) / (signed int)v109; 1217 v108 = (149 - v106.y) / (signed int)v109;
1207 if ( (149 - v106.y) / (signed int)v109 > 32 ) 1218 if ( (149 - v106.y) / (signed int)v109 > 32 )
1247 v109 = (const char **)((char *)v109 + 1); 1258 v109 = (const char **)((char *)v109 + 1);
1248 } 1259 }
1249 while ( v106.y < (signed int)result ); 1260 while ( v106.y < (signed int)result );
1250 } 1261 }
1251 } 1262 }
1252 } 1263 break;
1253 return result; 1264 }
1254 } 1265 case 95:
1255 } 1266 {
1256 else 1267 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture);
1257 { 1268 v3 = 0;
1258 if ( dword_F8B19C == 5 ) 1269 v109 = 0;
1259 { 1270 v108 = 0;
1260 draw_leather(); 1271 do
1261 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 1272 {
1262 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0); 1273 // if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)window_SpeakInHouse->ptr_1C] + 724] )
1263 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 1274 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v109].uItemID)
1264 if ( result ) 1275 {
1265 { 1276 v52 = word_F8B158[(signed int)v109] + 30;
1266 v27 = pMouse->GetCursorPos(&v99)->x - 14; 1277 v53 = ItemsInShopTexture[(signed int)v109];
1267 v106.x = (v27 >> 5) + 14 * ((pMouse->GetCursorPos(&v97)->y - 17) >> 5); 1278 v54 = 60 - ((signed int)v53->uTextureWidth >> 1);
1268 result = (char *)pMouse->GetCursorPos(&v95); 1279 pRenderer->DrawTextureTransparent(v54 + v108, word_F8B158[(signed int)v109] + 30, v53);
1269 if ( *(int *)result > 13 ) 1280 sub_40F92A(
1270 { 1281 &pRenderer->pActiveZBuffer[v54 + v108 + 640 * v52],
1271 result = (char *)pMouse->GetCursorPos(&v93); 1282 ItemsInShopTexture[(signed int)v109],
1272 if ( *(int *)result < 462 ) 1283 (int)((char *)v109 + 1));
1273 { 1284 }
1274 result = (char *)v0->GetItemIDAtInventoryIndex((int *)&v106.x); 1285 v109 = (const char **)((char *)v109 + 1);
1275 v3 = 0; 1286 v108 += 70;
1276 if ( result ) 1287 }
1277 { 1288 while ( (signed int)v109 < 6 );
1278 result = (char *)(9 * (int)result); 1289 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
1279 if ( _this->field_1F5[4 * (int)result + 15] & 2 ) 1290 if ( result )
1280 { 1291 {
1281 v85 = 0; 1292 v55 = 0;
1282 v83 = 5; 1293 v106.x = 0;
1283 v81 = window_SpeakInHouse->ptr_1C; 1294 do
1284 v79 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * (int)result + 5]; 1295 {
1285 v28 = (int)window_SpeakInHouse->ptr_1C; 1296 // if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
1286 v110 = uActiveCharacter - 1; 1297 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID)
1287 v29 = _this->_490EEE( 1298 ++v106.x;
1288 (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * (int)result + 5], 1299 ++v55;
1289 1, 1300 }
1290 v28, 1301 while ( v55 < 6 );
1291 5); 1302 v56 = GetAsyncKeyState(17);
1292 v6 = v110; 1303 v57 = _this->CanSteal();
1293 v5 = (char *)pMerchantsRepairPhrases[v29]; 1304 Str = (char *)v57;
1294 goto LABEL_14; 1305 if ( v56 && v57 )
1295 } 1306 {
1296 } 1307 v58 = pGlobalTXT_LocalizationStrings[185];
1297 } 1308 }
1298 } 1309 else
1299 } 1310 {
1300 return result; 1311 v58 = pGlobalTXT_LocalizationStrings[195];
1301 } 1312 if ( dword_F8B19C != 2 )
1302 if ( dword_F8B19C == 1 ) 1313 v58 = pGlobalTXT_LocalizationStrings[196];
1303 { 1314 }
1304 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 1315 DrawTextAtStatusBar(v58, 0);
1305 if ( result ) 1316 if ( v106.x )
1306 { 1317 {
1307 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; 1318 v59 = pMouse->GetCursorPos(&v91);
1308 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; 1319 result = (char *)(v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y]);
1309 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; 1320 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF )
1310 v14 = 0; 1321 {
1311 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; 1322 v60 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1;
1312 v15 = pShopOptions; 1323 v106.x = v60;
1313 do 1324 v61 = (int)window_SpeakInHouse->ptr_1C;
1314 { 1325 // v62 = 9 * (v60 + 12 * v61);
1315 v16 = pFontArrus->CalcTextHeight(*v15, &v101, 0, 0); 1326 v63 = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
1316 ++v15; 1327 if ( dword_F8B19C != 2 )
1317 v14 += v16; 1328 v63 = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
1318 } 1329 if ( !v56 || !Str )
1319 while ( (signed int)v15 < (signed int)&unk_F8B1C8 ); 1330 {
1320 v17 = pDialogueWindow; 1331 v85 = 0;
1321 v103 = (174 - v14) / 4; 1332 v83 = 2;
1322 result = (char *)pDialogueWindow->pStartingPosActiveItem; 1333 v81 = window_SpeakInHouse->ptr_1C;
1323 v18 = (int)&result[pDialogueWindow->pNumPresenceButton]; 1334 v79 = v63;
1324 v19 = (174 - 4 * (174 - v14) / 4 - v14) / 2 - (174 - v14) / 4 / 2 + 138; 1335 v110 = uActiveCharacter - 1;
1325 v20 = -pDialogueWindow->pNumPresenceButton < 0; 1336 v64 = _this->_490EEE(v63, 1, v61, 2);
1326 _this = (Player *)pDialogueWindow->pStartingPosActiveItem; 1337 v6 = v110;
1327 if ( v20 ^ __OFSUB__((int)result, v18) ) 1338 v5 = (char *)pMerchantsBuyPhrases[v64];
1328 { 1339 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85);
1329 v108 = 2; 1340 v86 = 3;
1330 v109 = (const char **)pShopOptions; 1341 v84 = v7;
1331 do 1342 v82 = v105;
1332 { 1343 v80 = v3;
1333 v21 = v17->GetControl((unsigned int)_this); 1344 v78 = v3;
1334 v22 = v109; 1345 v77 = &v101;
1335 v21->uY = v103 + v19; 1346 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80);
1336 v23 = pFontArrus->CalcTextHeight(*v22, &v101, 0, 0); 1347 return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86);
1337 v24 = v21->uY; 1348 }
1338 v25 = v108; 1349 v5 = pGlobalTXT_LocalizationStrings[181];
1339 v21->uHeight = v23; 1350 v85 = 0;
1340 v19 = v24 + v23 - 1; 1351 v83 = 2;
1341 v21->uW = v19; 1352 v81 = window_SpeakInHouse->ptr_1C;
1342 v26 = v104; 1353 v79 = v63;
1343 if ( pDialogueWindow->pCurrentPosActiveItem != v25 ) 1354 v6 = uActiveCharacter - 1;
1344 v26 = v105; 1355 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85);
1345 v101.DrawTitleText(pFontArrus, 0, v24, v26, *v109, 3u); 1356 v86 = 3;
1346 v17 = pDialogueWindow; 1357 v84 = v7;
1347 ++v108; 1358 v82 = v105;
1348 ++v109; 1359 v80 = v3;
1349 _this = (Player *)((char *)_this + 1); 1360 v78 = v3;
1350 result = (char *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem); 1361 v77 = &v101;
1351 } 1362 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80);
1352 while ( (signed int)_this < (signed int)result ); 1363 return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86);
1353 } 1364 }
1354 } 1365 }
1355 return result; 1366 else
1356 } 1367 {
1357 if ( dword_F8B19C != 2 ) 1368 v101.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
1358 { 1369 result =0; //added
1359 if ( dword_F8B19C == 3 ) 1370 }
1360 { 1371 }
1372 break;
1373 }
1374 case 2:
1375 {
1376 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture);
1377 v3 = 0;
1378 v48 = 0;
1379 v108 = 0;
1380 v109 = 0;
1381 do
1382 {
1383 // if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)window_SpeakInHouse->ptr_1C]] )
1384 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(int)v48].uItemID);
1385 {
1386 v49 = word_F8B158[(signed int)v48];
1387 v50 = ItemsInShopTexture[(signed int)v48];
1388 v49 += 30;
1389 v51 = 60 - ((signed int)v50->uTextureWidth >> 1);
1390 pRenderer->DrawTextureTransparent(v51 + v108, v49, v50);
1391 sub_40F92A(
1392 &pRenderer->pActiveZBuffer[v51 + v108 + 640 * v49],
1393 ItemsInShopTexture[(signed int)v109],
1394 (int)((char *)v109 + 1));
1395 v48 = v109;
1396 }
1397 v108 += 70;
1398 v48 = (const char **)((char *)v48 + 1);
1399 v109 = v48;
1400 }
1401 while ( (signed int)v48 < 6 );
1402 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
1403 if ( result )
1404 {
1405 v55 = 0;
1406 v106.x = 0;
1407 v106.x = 0;
1408 do
1409 {
1410 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID);//9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
1411 ++v106.x;
1412 ++v55;
1413 }
1414 while ( v55 < 6 );
1415 v56 = GetAsyncKeyState(17);
1416 v57 = _this->CanSteal();
1417 Str = (char *)v57;
1418 if ( v56 && v57 )
1419 {
1420 v58 = pGlobalTXT_LocalizationStrings[185];
1421 }
1422 else
1423 {
1424 v58 = pGlobalTXT_LocalizationStrings[195];
1425 if ( dword_F8B19C != 2 )
1426 v58 = pGlobalTXT_LocalizationStrings[196];
1427 }
1428 DrawTextAtStatusBar(v58, 0);
1429 if ( v106.x )
1430 {
1431 v59 = pMouse->GetCursorPos(&v91);
1432 result = (char *)(v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y]);
1433 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF )
1434 {
1435 v60 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1;
1436 v106.x = v60;
1437 v61 = (int)window_SpeakInHouse->ptr_1C;
1438 // v62 = 9 * (v60 + 12 * v61);
1439 v63 = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
1440 if ( dword_F8B19C != 2 )
1441 v63 = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
1442 if ( !v56 || !Str )
1443 {
1444 v85 = 0;
1445 v83 = 2;
1446 v81 = window_SpeakInHouse->ptr_1C;
1447 v79 = v63;
1448 v110 = uActiveCharacter - 1;
1449 v64 = _this->_490EEE(v63, 1, v61, 2);
1450 v6 = v110;
1451 v5 = (char *)pMerchantsBuyPhrases[v64];
1452 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85);
1453 v86 = 3;
1454 v84 = v7;
1455 v82 = v105;
1456 v80 = v3;
1457 v78 = v3;
1458 v77 = &v101;
1459 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80);
1460 return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86);
1461 }
1462 v5 = pGlobalTXT_LocalizationStrings[181];
1463 v85 = 0;
1464 v83 = 2;
1465 v81 = window_SpeakInHouse->ptr_1C;
1466 v79 = v63;
1467 v6 = uActiveCharacter - 1;
1468 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85);
1469 v86 = 3;
1470 v84 = v7;
1471 v82 = v105;
1472 v80 = v3;
1473 v78 = v3;
1474 v77 = &v101;
1475 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80);
1476 return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86);
1477 }
1478 }
1479 else
1480 {
1481 v101.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
1482 result =0; //added
1483 }
1484 }
1485 break;
1486 }
1487 case 3:
1488 {
1361 draw_leather(); 1489 draw_leather();
1362 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 1490 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
1363 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0); 1491 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);
1364 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 1492 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
1365 if ( result ) 1493 if ( result )
1383 v12 = (int)window_SpeakInHouse->ptr_1C; 1511 v12 = (int)window_SpeakInHouse->ptr_1C;
1384 v110 = uActiveCharacter - 1; 1512 v110 = uActiveCharacter - 1;
1385 v13 = _this->_490EEE(v79, 1, v12, 3); 1513 v13 = _this->_490EEE(v79, 1, v12, 3);
1386 v6 = v110; 1514 v6 = v110;
1387 v5 = (char *)pMerchantsSellPhrases[v13]; 1515 v5 = (char *)pMerchantsSellPhrases[v13];
1388 goto LABEL_14; 1516 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85);
1517 v86 = 3;
1518 v84 = v7;
1519 v82 = v105;
1520 v80 = v3;
1521 v78 = v3;
1522 v77 = &v101;
1523 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80);
1524 return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86);
1389 } 1525 }
1390 } 1526 }
1391 } 1527 }
1392 } 1528 }
1393 } 1529 break;
1394 else 1530 }
1395 { 1531 case 4:
1396 result = (char *)(dword_F8B19C - 4); 1532 {
1397 if ( dword_F8B19C == 4 ) 1533 draw_leather();
1398 { 1534 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
1399 draw_leather(); 1535 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);
1400 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 1536 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
1401 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); 1537 if ( result )
1402 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 1538 {
1403 if ( result ) 1539 v2 = pMouse->GetCursorPos(&a2)->x - 14;
1404 { 1540 v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5);
1405 v2 = pMouse->GetCursorPos(&a2)->x - 14; 1541 result = (char *)pMouse->GetCursorPos(&v100);
1406 v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5); 1542 if ( *(int *)result > 13 )
1407 result = (char *)pMouse->GetCursorPos(&v100); 1543 {
1408 if ( *(int *)result > 13 ) 1544 result = (char *)pMouse->GetCursorPos(&v92);
1409 { 1545 if ( *(int *)result < 462 )
1410 result = (char *)pMouse->GetCursorPos(&v92); 1546 {
1411 if ( *(int *)result < 462 ) 1547 result = (char *)v0->GetItemIDAtInventoryIndex((int *)&v106.x);
1412 { 1548 v3 = 0;
1413 result = (char *)v0->GetItemIDAtInventoryIndex((int *)&v106.x); 1549 if ( result )
1414 v3 = 0; 1550 {
1415 if ( result ) 1551 v85 = 0;
1416 { 1552 v83 = 4;
1417 v85 = 0; 1553 v4 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5];
1418 v83 = 4; 1554 if (!v4->Identified())
1419 v4 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5]; 1555 {
1420 if (!v4->Identified()) 1556 v81 = window_SpeakInHouse->ptr_1C;
1421 { 1557 v79 = v4;
1422 v81 = window_SpeakInHouse->ptr_1C; 1558 v9 = (int)window_SpeakInHouse->ptr_1C;
1423 v79 = v4; 1559 v110 = uActiveCharacter - 1;
1424 v9 = (int)window_SpeakInHouse->ptr_1C; 1560 v10 = _this->_490EEE(v4, 1, v9, 4);
1425 v110 = uActiveCharacter - 1; 1561 v6 = v110;
1426 v10 = _this->_490EEE(v4, 1, v9, 4); 1562 v5 = (char *)pMerchantsIdentifyPhrases[v10];
1427 v6 = v110; 1563 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85);
1428 v5 = (char *)pMerchantsIdentifyPhrases[v10]; 1564 v86 = 3;
1429 goto LABEL_14; 1565 v84 = v7;
1430 } 1566 v82 = v105;
1431 v81 = window_SpeakInHouse->ptr_1C; 1567 v80 = v3;
1432 v5 = "%24"; 1568 v78 = v3;
1433 v79 = v4; 1569 v77 = &v101;
1434 LABEL_13: 1570 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80);
1435 v6 = uActiveCharacter - 1; 1571 return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86);
1436 LABEL_14: 1572 }
1437 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85); 1573 v81 = window_SpeakInHouse->ptr_1C;
1438 v86 = 3; 1574 v5 = "%24";
1439 v84 = v7; 1575 v79 = v4;
1440 v82 = v105; 1576 //LABEL_13:
1441 v80 = v3; 1577 v6 = uActiveCharacter - 1;
1442 v78 = v3; 1578 //LABEL_14:
1443 v77 = &v101; 1579 v7 = BuilDialogueString(v5, v6, v79, (char *)v81, v83, v85);
1444 LABEL_15: 1580 v86 = 3;
1445 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80); 1581 v84 = v7;
1446 return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86); 1582 v82 = v105;
1447 } 1583 v80 = v3;
1448 } 1584 v78 = v3;
1449 } 1585 v77 = &v101;
1450 } 1586 //LABEL_15:
1451 } 1587 v8 = pFontArrus->CalcTextHeight(v7, v77, v78, v80);
1452 } 1588 return v101.DrawTitleText(pFontArrus, v3, (174 - v8) / 2 + 138, v82, v84, v86);
1453 return result; 1589 }
1454 } 1590 }
1455 } 1591 }
1456 pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); 1592 }
1457 v3 = 0; 1593 break;
1458 if ( dword_F8B19C == 2 ) 1594 }
1459 { 1595 case 1:
1460 v48 = 0; 1596 {
1461 v108 = 0; 1597 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
1462 v109 = 0; 1598 if ( result )
1463 do 1599 {
1464 { 1600 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];
1465 // if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)window_SpeakInHouse->ptr_1C]] ) 1601 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];
1466 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(int)v48].uItemID); 1602 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];
1467 { 1603 v14 = 0;
1468 v49 = word_F8B158[(signed int)v48]; 1604 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];
1469 v50 = ItemsInShopTexture[(signed int)v48]; 1605 v15 = pShopOptions;
1470 v49 += 30; 1606 do
1471 v51 = 60 - ((signed int)v50->uTextureWidth >> 1); 1607 {
1472 pRenderer->DrawTextureTransparent(v51 + v108, v49, v50); 1608 v16 = pFontArrus->CalcTextHeight(*v15, &v101, 0, 0);
1473 sub_40F92A( 1609 ++v15;
1474 &pRenderer->pActiveZBuffer[v51 + v108 + 640 * v49], 1610 v14 += v16;
1475 ItemsInShopTexture[(signed int)v109], 1611 }
1476 (int)((char *)v109 + 1)); 1612 while ( (signed int)v15 < (signed int)&unk_F8B1C8 );
1477 v48 = v109; 1613 v17 = pDialogueWindow;
1478 } 1614 v103 = (174 - v14) / 4;
1479 v108 += 70; 1615 result = (char *)pDialogueWindow->pStartingPosActiveItem;
1480 v48 = (const char **)((char *)v48 + 1); 1616 v18 = (int)&result[pDialogueWindow->pNumPresenceButton];
1481 v109 = v48; 1617 v19 = (174 - 4 * (174 - v14) / 4 - v14) / 2 - (174 - v14) / 4 / 2 + 138;
1482 } 1618 v20 = -pDialogueWindow->pNumPresenceButton < 0;
1483 while ( (signed int)v48 < 6 ); 1619 _this = (Player *)pDialogueWindow->pStartingPosActiveItem;
1484 } 1620 if ( v20 ^ __OFSUB__((int)result, v18) )
1485 else 1621 {
1486 { 1622 v108 = 2;
1487 v109 = 0; 1623 v109 = (const char **)pShopOptions;
1488 v108 = 0; 1624 do
1489 do 1625 {
1490 { 1626 v21 = v17->GetControl((unsigned int)_this);
1491 // if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)window_SpeakInHouse->ptr_1C] + 724] ) 1627 v22 = v109;
1492 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v109].uItemID) 1628 v21->uY = v103 + v19;
1493 { 1629 v23 = pFontArrus->CalcTextHeight(*v22, &v101, 0, 0);
1494 v52 = word_F8B158[(signed int)v109] + 30; 1630 v24 = v21->uY;
1495 v53 = ItemsInShopTexture[(signed int)v109]; 1631 v25 = v108;
1496 v54 = 60 - ((signed int)v53->uTextureWidth >> 1); 1632 v21->uHeight = v23;
1497 pRenderer->DrawTextureTransparent(v54 + v108, word_F8B158[(signed int)v109] + 30, v53); 1633 v19 = v24 + v23 - 1;
1498 sub_40F92A( 1634 v21->uW = v19;
1499 &pRenderer->pActiveZBuffer[v54 + v108 + 640 * v52], 1635 v26 = v104;
1500 ItemsInShopTexture[(signed int)v109], 1636 if ( pDialogueWindow->pCurrentPosActiveItem != v25 )
1501 (int)((char *)v109 + 1)); 1637 v26 = v105;
1502 } 1638 v101.DrawTitleText(pFontArrus, 0, v24, v26, *v109, 3u);
1503 v109 = (const char **)((char *)v109 + 1); 1639 v17 = pDialogueWindow;
1504 v108 += 70; 1640 ++v108;
1505 } 1641 ++v109;
1506 while ( (signed int)v109 < 6 ); 1642 _this = (Player *)((char *)_this + 1);
1507 } 1643 result = (char *)(pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem);
1508 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 1644 }
1509 if ( result ) 1645 while ( (signed int)_this < (signed int)result );
1510 { 1646 }
1511 v55 = 0; 1647 }
1512 v106.x = 0; 1648 break;
1513 if ( dword_F8B19C == 2 ) 1649 }
1514 { 1650 default:
1515 v106.x = 0; 1651 {
1516 do 1652 if( dword_F8B19C > 5 )
1517 { 1653 result = (char *)(dword_F8B19C - 96);
1518 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID);//9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) 1654 else
1519 ++v106.x; 1655 result = (char *)(dword_F8B19C - 4);
1520 ++v55; 1656 break;
1521 } 1657 }
1522 while ( v55 < 6 );
1523 }
1524 else
1525 {
1526 do
1527 {
1528 // if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
1529 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID)
1530 ++v106.x;
1531 ++v55;
1532 }
1533 while ( v55 < 6 );
1534 }
1535 v56 = GetAsyncKeyState(17);
1536 v57 = _this->CanSteal();
1537 Str = (char *)v57;
1538 if ( v56 && v57 )
1539 {
1540 v58 = pGlobalTXT_LocalizationStrings[185];
1541 }
1542 else
1543 {
1544 v58 = pGlobalTXT_LocalizationStrings[195];
1545 if ( dword_F8B19C != 2 )
1546 v58 = pGlobalTXT_LocalizationStrings[196];
1547 }
1548 DrawTextAtStatusBar(v58, 0);
1549 if ( v106.x )
1550 {
1551 v59 = pMouse->GetCursorPos(&v91);
1552 result = (char *)(v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y]);
1553 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF )
1554 {
1555 v60 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1;
1556 v106.x = v60;
1557 v61 = (int)window_SpeakInHouse->ptr_1C;
1558 // v62 = 9 * (v60 + 12 * v61);
1559 v63 = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60];
1560 if ( dword_F8B19C != 2 )
1561 v63 = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724];
1562 if ( !v56 || !Str )
1563 {
1564 v85 = 0;
1565 v83 = 2;
1566 v81 = window_SpeakInHouse->ptr_1C;
1567 v79 = v63;
1568 v110 = uActiveCharacter - 1;
1569 v64 = _this->_490EEE(v63, 1, v61, 2);
1570 v6 = v110;
1571 v5 = (char *)pMerchantsBuyPhrases[v64];
1572 goto LABEL_14;
1573 }
1574 v5 = pGlobalTXT_LocalizationStrings[181];
1575 v85 = 0;
1576 v83 = 2;
1577 v81 = window_SpeakInHouse->ptr_1C;
1578 v79 = v63;
1579 goto LABEL_13;
1580 }
1581 }
1582 else
1583 {
1584 v101.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);
1585 result =0; //added
1586 }
1587 } 1658 }
1588 return result; 1659 return result;
1589 } 1660 }
1590 1661
1591 1662