Mercurial > mm7
comparison UI/UIShops.cpp @ 1843:2e6d3cd052e0
some char* cast removal + adding const_casts where appropriate
author | Grumpy7 |
---|---|
date | Sun, 13 Oct 2013 07:18:03 +0200 |
parents | 211dfe2d8db1 |
children | c1c74df0a33e |
comparison
equal
deleted
inserted
replaced
1842:175bf8da83d9 | 1843:2e6d3cd052e0 |
---|---|
42 { | 42 { |
43 case HOUSE_DIALOGUE_MAIN: | 43 case HOUSE_DIALOGUE_MAIN: |
44 { | 44 { |
45 if ( HouseUI_CheckIfPlayerCanInteract() ) | 45 if ( HouseUI_CheckIfPlayerCanInteract() ) |
46 { | 46 { |
47 pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[134]; | 47 pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[134]); |
48 pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[152]; | 48 pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[152]); |
49 pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[159]; | 49 pShopOptions[2] = const_cast<char *>(pGlobalTXT_LocalizationStrings[159]); |
50 pShopOptions[3] = (char *)pGlobalTXT_LocalizationStrings[160]; | 50 pShopOptions[3] = const_cast<char *>(pGlobalTXT_LocalizationStrings[160]); |
51 all_text_height = 0; | 51 all_text_height = 0; |
52 for ( int i = 0; i < 4; ++i ) | 52 for ( int i = 0; i < 4; ++i ) |
53 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | 53 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
54 v103 = (174 - all_text_height) / 4; | 54 v103 = (174 - all_text_height) / 4; |
55 v19 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138; | 55 v19 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138; |
102 if ( pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF ) | 102 if ( pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF ) |
103 { | 103 { |
104 item = &pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; | 104 item = &pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; |
105 if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal() ) | 105 if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal() ) |
106 { | 106 { |
107 pText = BuildDialogueString((char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 2)], | 107 pText = BuildDialogueString(pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 2)], |
108 uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); | 108 uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); |
109 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); | 109 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); |
110 } | 110 } |
111 else | 111 else |
112 { | 112 { |
153 if ( pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF ) | 153 if ( pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF ) |
154 { | 154 { |
155 item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; | 155 item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; |
156 if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal() ) | 156 if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal() ) |
157 { | 157 { |
158 pText = BuildDialogueString((char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 2)], | 158 pText = BuildDialogueString(pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 2)], |
159 uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); | 159 uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); |
160 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); | 160 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); |
161 } | 161 } |
162 else | 162 else |
163 { | 163 { |
186 pItemID = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v109); | 186 pItemID = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v109); |
187 if ( !pItemID ) | 187 if ( !pItemID ) |
188 return; | 188 return; |
189 item = &pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1]; | 189 item = &pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1]; |
190 phrases_id = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 3); | 190 phrases_id = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 3); |
191 pText = BuildDialogueString((char *)pMerchantsSellPhrases[phrases_id], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 3, 0); | 191 pText = BuildDialogueString(pMerchantsSellPhrases[phrases_id], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 3, 0); |
192 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); | 192 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); |
193 break; | 193 break; |
194 } | 194 } |
195 case HOUSE_DIALOGUE_SHOP_IDENTIFY: | 195 case HOUSE_DIALOGUE_SHOP_IDENTIFY: |
196 { | 196 { |
208 return; | 208 return; |
209 item = &pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1]; | 209 item = &pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1]; |
210 if (!item->IsIdentified()) | 210 if (!item->IsIdentified()) |
211 { | 211 { |
212 phrases_id = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 4); | 212 phrases_id = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 4); |
213 pText = BuildDialogueString((char *)pMerchantsIdentifyPhrases[phrases_id], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); | 213 pText = BuildDialogueString(pMerchantsIdentifyPhrases[phrases_id], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); |
214 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); | 214 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); |
215 } | 215 } |
216 else | 216 else |
217 { | 217 { |
218 pText = BuildDialogueString("%24", uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); | 218 pText = BuildDialogueString("%24", uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); |
235 pItemID = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v109); | 235 pItemID = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v109); |
236 if ( !pItemID || (!(pPlayers[uActiveCharacter]->pOwnItems[pItemID - 1].uAttributes & 2)) ) | 236 if ( !pItemID || (!(pPlayers[uActiveCharacter]->pOwnItems[pItemID - 1].uAttributes & 2)) ) |
237 return; | 237 return; |
238 item = &pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1]; | 238 item = &pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1]; |
239 phrases_id = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 5); | 239 phrases_id = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 5); |
240 pText = BuildDialogueString((char *)pMerchantsRepairPhrases[phrases_id], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0); | 240 pText = BuildDialogueString(pMerchantsRepairPhrases[phrases_id], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0); |
241 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); | 241 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); |
242 return; | 242 return; |
243 } | 243 } |
244 break; | 244 break; |
245 | 245 |
246 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT: | 246 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT: |
247 { | 247 { |
248 draw_leather(); | 248 draw_leather(); |
249 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 249 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
250 pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[200];//sell | 250 pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[200]);//sell |
251 pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[113];//identify | 251 pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[113]);//identify |
252 pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[179];//repair | 252 pShopOptions[2] = const_cast<char *>(pGlobalTXT_LocalizationStrings[179]);//repair |
253 all_text_height = 0; | 253 all_text_height = 0; |
254 for ( int i = 0; i < 3; ++i ) | 254 for ( int i = 0; i < 3; ++i ) |
255 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | 255 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
256 v103 = (174 - all_text_height) / 3; | 256 v103 = (174 - all_text_height) / 3; |
257 v19 = (3 * (58 - (signed int)v103) - all_text_height) / 2 - ((174 - all_text_height) / 3) / 2 + 138; | 257 v19 = (3 * (58 - (signed int)v103) - all_text_height) / 2 - ((174 - all_text_height) / 3) / 2 + 138; |
367 { | 367 { |
368 case HOUSE_DIALOGUE_MAIN: | 368 case HOUSE_DIALOGUE_MAIN: |
369 { | 369 { |
370 if ( !HouseUI_CheckIfPlayerCanInteract() ) | 370 if ( !HouseUI_CheckIfPlayerCanInteract() ) |
371 return; | 371 return; |
372 pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[134]; //"Buy Standard" | 372 pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[134]); //"Buy Standard" |
373 pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[152]; //"Buy Special" | 373 pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[152]); //"Buy Special" |
374 pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[159]; //"Display Inventory" | 374 pShopOptions[2] = const_cast<char *>(pGlobalTXT_LocalizationStrings[159]); //"Display Inventory" |
375 pShopOptions[3] = (char *)pGlobalTXT_LocalizationStrings[160]; | 375 pShopOptions[3] = const_cast<char *>(pGlobalTXT_LocalizationStrings[160]); |
376 all_text_height = 0; | 376 all_text_height = 0; |
377 for( int i = 0; i < 4; ++i ) | 377 for( int i = 0; i < 4; ++i ) |
378 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | 378 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
379 v146 = ( 174 - all_text_height ) / 4; | 379 v146 = ( 174 - all_text_height ) / 4; |
380 v23 = ( 174 - 4 * ( 174 - all_text_height ) / 4 - all_text_height ) / 2 - ( 174 - all_text_height ) / 4 / 2 + 138; | 380 v23 = ( 174 - 4 * ( 174 - all_text_height ) / 4 - all_text_height ) / 2 - ( 174 - all_text_height ) / 4 / 2 + 138; |
437 if ( !(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) ) | 437 if ( !(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) ) |
438 return; | 438 return; |
439 selected_item = &pParty->StandartItemsInShops[window_SpeakInHouse->par1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; | 439 selected_item = &pParty->StandartItemsInShops[window_SpeakInHouse->par1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; |
440 if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal()) | 440 if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal()) |
441 { | 441 { |
442 pText = BuildDialogueString((char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 2)], | 442 pText = BuildDialogueString(pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 2)], |
443 uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); | 443 uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); |
444 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); | 444 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); |
445 } | 445 } |
446 else | 446 else |
447 { | 447 { |
500 selected_item = &pParty->StandartItemsInShops[window_SpeakInHouse->par1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; | 500 selected_item = &pParty->StandartItemsInShops[window_SpeakInHouse->par1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; |
501 else | 501 else |
502 selected_item = &pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; | 502 selected_item = &pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; |
503 if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal() ) | 503 if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal() ) |
504 { | 504 { |
505 pText = BuildDialogueString((char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 2)], | 505 pText = BuildDialogueString(pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 2)], |
506 uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); | 506 uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); |
507 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); | 507 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); |
508 } | 508 } |
509 else | 509 else |
510 { | 510 { |
520 | 520 |
521 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT: | 521 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT: |
522 { | 522 { |
523 draw_leather(); | 523 draw_leather(); |
524 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 524 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
525 pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[200]; //"Sell" | 525 pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[200]); //"Sell" |
526 pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[113]; //"Identify" | 526 pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[113]); //"Identify" |
527 pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[179]; //"Repair" | 527 pShopOptions[2] = const_cast<char *>(pGlobalTXT_LocalizationStrings[179]); //"Repair" |
528 all_text_height = 0; | 528 all_text_height = 0; |
529 for ( int i = 0; i < 3; ++i ) | 529 for ( int i = 0; i < 3; ++i ) |
530 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | 530 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
531 v146 = (174 - all_text_height) / 3; | 531 v146 = (174 - all_text_height) / 3; |
532 v23 = (3 * (58 - v146) - all_text_height) / 2 - v146 / 2 + 138; | 532 v23 = (3 * (58 - v146) - all_text_height) / 2 - v146 / 2 + 138; |
561 if ( mouse.x <= 13 || mouse.x >= 462 ) | 561 if ( mouse.x <= 13 || mouse.x >= 462 ) |
562 return; | 562 return; |
563 if ( !pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v153) ) | 563 if ( !pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v153) ) |
564 return; | 564 return; |
565 selected_item = &pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v153) - 1]; | 565 selected_item = &pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v153) - 1]; |
566 pText = BuildDialogueString((char *)pMerchantsSellPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 3)], | 566 pText = BuildDialogueString(pMerchantsSellPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 3)], |
567 uActiveCharacter - 1, selected_item, (char *) window_SpeakInHouse->par1C, 3, 0); | 567 uActiveCharacter - 1, selected_item, (char *) window_SpeakInHouse->par1C, 3, 0); |
568 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); | 568 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); |
569 return; | 569 return; |
570 } | 570 } |
571 break; | 571 break; |
584 { | 584 { |
585 selected_item = &pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v153)-1]; | 585 selected_item = &pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v153)-1]; |
586 if (selected_item->IsIdentified()) | 586 if (selected_item->IsIdentified()) |
587 pText = BuildDialogueString("%24", uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); | 587 pText = BuildDialogueString("%24", uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); |
588 else | 588 else |
589 pText = BuildDialogueString((char *)pMerchantsIdentifyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, | 589 pText = BuildDialogueString(pMerchantsIdentifyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, |
590 (int)window_SpeakInHouse->ptr_1C, 4)], uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); | 590 (int)window_SpeakInHouse->ptr_1C, 4)], uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); |
591 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); | 591 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); |
592 return; | 592 return; |
593 } | 593 } |
594 } | 594 } |
610 || (!(pPlayers[uActiveCharacter]->pOwnItems[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v153) - 1].uAttributes& 2)) ) | 610 || (!(pPlayers[uActiveCharacter]->pOwnItems[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v153) - 1].uAttributes& 2)) ) |
611 return; | 611 return; |
612 selected_item = &pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v153) - 1]; | 612 selected_item = &pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v153) - 1]; |
613 phrases_id = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v153) - 1], | 613 phrases_id = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v153) - 1], |
614 BuildingType_ArmorShop, window_SpeakInHouse->par1C, 5); | 614 BuildingType_ArmorShop, window_SpeakInHouse->par1C, 5); |
615 pText = BuildDialogueString((char *)pMerchantsRepairPhrases[phrases_id], uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 5, 0); | 615 pText = BuildDialogueString(pMerchantsRepairPhrases[phrases_id], uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 5, 0); |
616 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); | 616 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); |
617 return; | 617 return; |
618 } | 618 } |
619 break; | 619 break; |
620 | 620 |
713 { | 713 { |
714 case HOUSE_DIALOGUE_MAIN: | 714 case HOUSE_DIALOGUE_MAIN: |
715 { | 715 { |
716 if ( HouseUI_CheckIfPlayerCanInteract() ) | 716 if ( HouseUI_CheckIfPlayerCanInteract() ) |
717 { | 717 { |
718 pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[134]; | 718 pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[134]); |
719 pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[152]; | 719 pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[152]); |
720 pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[159]; | 720 pShopOptions[2] = const_cast<char *>(pGlobalTXT_LocalizationStrings[159]); |
721 pShopOptions[3] = (char *)pGlobalTXT_LocalizationStrings[160]; | 721 pShopOptions[3] = const_cast<char *>(pGlobalTXT_LocalizationStrings[160]); |
722 all_text_height = 0; | 722 all_text_height = 0; |
723 for ( int i = 0; i < 4; ++i ) | 723 for ( int i = 0; i < 4; ++i ) |
724 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | 724 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
725 v18 = (174 - all_text_height) / 4; | 725 v18 = (174 - all_text_height) / 4; |
726 v105 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138; | 726 v105 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138; |
815 { | 815 { |
816 item = &pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; | 816 item = &pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; |
817 if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal() ) | 817 if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal() ) |
818 { | 818 { |
819 v71 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 2); | 819 v71 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 2); |
820 pText = BuildDialogueString((char *)pMerchantsBuyPhrases[v71], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); | 820 pText = BuildDialogueString(pMerchantsBuyPhrases[v71], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); |
821 } | 821 } |
822 else | 822 else |
823 pText = BuildDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); | 823 pText = BuildDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); |
824 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); | 824 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); |
825 return ; | 825 return ; |
903 { | 903 { |
904 item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; | 904 item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; |
905 if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal() ) | 905 if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal() ) |
906 { | 906 { |
907 v71 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 2); | 907 v71 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 2); |
908 pText = BuildDialogueString((char *)pMerchantsBuyPhrases[v71], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); | 908 pText = BuildDialogueString(pMerchantsBuyPhrases[v71], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); |
909 } | 909 } |
910 else | 910 else |
911 pText = BuildDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); | 911 pText = BuildDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); |
912 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); | 912 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); |
913 return; | 913 return; |
929 return; | 929 return; |
930 if ( !pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&index) ) | 930 if ( !pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&index) ) |
931 return; | 931 return; |
932 v71 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&index) - 1], | 932 v71 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&index) - 1], |
933 BuildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 3); | 933 BuildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 3); |
934 pText = BuildDialogueString((char *)pMerchantsSellPhrases[v71], uActiveCharacter - 1, &pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&index) - 1], | 934 pText = BuildDialogueString(pMerchantsSellPhrases[v71], uActiveCharacter - 1, &pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&index) - 1], |
935 (char *)window_SpeakInHouse->ptr_1C, 3, 0); | 935 (char *)window_SpeakInHouse->ptr_1C, 3, 0); |
936 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); | 936 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); |
937 return; | 937 return; |
938 } | 938 } |
939 | 939 |
964 | 964 |
965 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT: | 965 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT: |
966 { | 966 { |
967 draw_leather(); | 967 draw_leather(); |
968 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 968 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
969 pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[200]; | 969 pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[200]); |
970 pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[113]; | 970 pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[113]); |
971 all_text_height = 0; | 971 all_text_height = 0; |
972 for ( int i = 0; i < 2; ++i ) | 972 for ( int i = 0; i < 2; ++i ) |
973 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | 973 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
974 v18 = (174 - all_text_height) / 2; | 974 v18 = (174 - all_text_height) / 2; |
975 v105 = (2 * (87 - (174 - all_text_height) / 2) - all_text_height) / 2 - (174 - all_text_height) / 2 / 2 + 138; | 975 v105 = (2 * (87 - (174 - all_text_height) / 2) - all_text_height) / 2 - (174 - all_text_height) / 2 / 2 + 138; |
1088 dialog_window.uFrameZ = 334; | 1088 dialog_window.uFrameZ = 334; |
1089 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN) | 1089 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN) |
1090 { | 1090 { |
1091 if ( !HouseUI_CheckIfPlayerCanInteract() ) | 1091 if ( !HouseUI_CheckIfPlayerCanInteract() ) |
1092 return; | 1092 return; |
1093 pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[134]; //"Buy Standard" | 1093 pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[134]); //"Buy Standard" |
1094 pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[152]; //"Buy Special" | 1094 pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[152]); //"Buy Special" |
1095 pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[159]; //"Display Inventory" | 1095 pShopOptions[2] = const_cast<char *>(pGlobalTXT_LocalizationStrings[159]); //"Display Inventory" |
1096 pShopOptions[3] = (char *)pGlobalTXT_LocalizationStrings[160]; | 1096 pShopOptions[3] = const_cast<char *>(pGlobalTXT_LocalizationStrings[160]); |
1097 all_text_height = 0; | 1097 all_text_height = 0; |
1098 for ( int i = 0; i < 4; ++i ) | 1098 for ( int i = 0; i < 4; ++i ) |
1099 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | 1099 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
1100 one_string = (174 - all_text_height) / 4; | 1100 one_string = (174 - all_text_height) / 4; |
1101 v23 = (174 - 4 * one_string - all_text_height) / 2 - one_string / 2 + 138; | 1101 v23 = (174 - 4 * one_string - all_text_height) / 2 - one_string / 2 + 138; |
1192 if ( GetAsyncKeyState(VK_CONTROL) && pPlayers[uActiveCharacter]->CanSteal() ) | 1192 if ( GetAsyncKeyState(VK_CONTROL) && pPlayers[uActiveCharacter]->CanSteal() ) |
1193 v30 = BuildDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);// "Steal %24" | 1193 v30 = BuildDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);// "Steal %24" |
1194 else | 1194 else |
1195 { | 1195 { |
1196 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2); | 1196 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2); |
1197 v30 = BuildDialogueString((char *)pMerchantsBuyPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); | 1197 v30 = BuildDialogueString(pMerchantsBuyPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); |
1198 } | 1198 } |
1199 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138, TargetColor(255, 255, 255), v30, 3); | 1199 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138, TargetColor(255, 255, 255), v30, 3); |
1200 return; | 1200 return; |
1201 } | 1201 } |
1202 } | 1202 } |
1280 if ( GetAsyncKeyState(VK_CONTROL) && pPlayers[uActiveCharacter]->CanSteal() ) | 1280 if ( GetAsyncKeyState(VK_CONTROL) && pPlayers[uActiveCharacter]->CanSteal() ) |
1281 v30 = BuildDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);// "Steal %24" | 1281 v30 = BuildDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0);// "Steal %24" |
1282 else | 1282 else |
1283 { | 1283 { |
1284 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2); | 1284 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2); |
1285 v30 = BuildDialogueString((char *)pMerchantsBuyPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); | 1285 v30 = BuildDialogueString(pMerchantsBuyPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); |
1286 } | 1286 } |
1287 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138, TargetColor(255, 255, 255), v30, 3); | 1287 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138, TargetColor(255, 255, 255), v30, 3); |
1288 return; | 1288 return; |
1289 } | 1289 } |
1290 } | 1290 } |
1293 | 1293 |
1294 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT ) | 1294 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT ) |
1295 { | 1295 { |
1296 draw_leather(); | 1296 draw_leather(); |
1297 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 1297 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
1298 pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[200];// "Sell" | 1298 pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[200]);// "Sell" |
1299 pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[113];// "Identify" | 1299 pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[113]);// "Identify" |
1300 pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[179];// "Repair" | 1300 pShopOptions[2] = const_cast<char *>(pGlobalTXT_LocalizationStrings[179]);// "Repair" |
1301 all_text_height = 0; | 1301 all_text_height = 0; |
1302 for ( uint i = 0; i < 3; ++i ) | 1302 for ( uint i = 0; i < 3; ++i ) |
1303 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | 1303 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
1304 one_string = ((174 - all_text_height) / 3); | 1304 one_string = ((174 - all_text_height) / 3); |
1305 v23 = (3 * (58 - (signed int)one_string) - all_text_height) / 2 - (174 - all_text_height) / 3 / 2 + 138; | 1305 v23 = (3 * (58 - (signed int)one_string) - all_text_height) / 2 - (174 - all_text_height) / 3 / 2 + 138; |
1334 return; | 1334 return; |
1335 if ( !pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117) ) | 1335 if ( !pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117) ) |
1336 return; | 1336 return; |
1337 item = &pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117) - 1]; | 1337 item = &pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117) - 1]; |
1338 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 3); | 1338 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 3); |
1339 v30 = BuildDialogueString((char *)pMerchantsSellPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 3, 0); | 1339 v30 = BuildDialogueString(pMerchantsSellPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 3, 0); |
1340 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138, TargetColor(255, 255, 255), v30, 3); | 1340 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138, TargetColor(255, 255, 255), v30, 3); |
1341 return; | 1341 return; |
1342 } | 1342 } |
1343 | 1343 |
1344 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_IDENTIFY) | 1344 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_IDENTIFY) |
1360 dialog_window.DrawTitleText(pFontArrus, 0, (212 - pFontArrus->CalcTextHeight(BuildDialogueString("%24", uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0), &dialog_window, 0, 0)) / 2 + 101, | 1360 dialog_window.DrawTitleText(pFontArrus, 0, (212 - pFontArrus->CalcTextHeight(BuildDialogueString("%24", uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0), &dialog_window, 0, 0)) / 2 + 101, |
1361 TargetColor(255, 255, 255), BuildDialogueString("%24", uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0), 3); | 1361 TargetColor(255, 255, 255), BuildDialogueString("%24", uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0), 3); |
1362 return; | 1362 return; |
1363 } | 1363 } |
1364 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 4); | 1364 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 4); |
1365 v30 = BuildDialogueString((char *)pMerchantsIdentifyPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); | 1365 v30 = BuildDialogueString(pMerchantsIdentifyPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); |
1366 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138, TargetColor(255, 255, 255), v30, 3); | 1366 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138, TargetColor(255, 255, 255), v30, 3); |
1367 return; | 1367 return; |
1368 } | 1368 } |
1369 } | 1369 } |
1370 } | 1370 } |
1386 || !(pPlayers[uActiveCharacter]->pOwnItems[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117)-1].uAttributes& 2) ) | 1386 || !(pPlayers[uActiveCharacter]->pOwnItems[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117)-1].uAttributes& 2) ) |
1387 return; | 1387 return; |
1388 item = &pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117) - 1]; | 1388 item = &pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117) - 1]; |
1389 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117) - 1], | 1389 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117) - 1], |
1390 BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 5); | 1390 BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 5); |
1391 v30 = BuildDialogueString((char *)pMerchantsRepairPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0); | 1391 v30 = BuildDialogueString(pMerchantsRepairPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0); |
1392 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138, TargetColor(255, 255, 255), v30, 3); | 1392 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138, TargetColor(255, 255, 255), v30, 3); |
1393 return; | 1393 return; |
1394 } | 1394 } |
1395 | 1395 |
1396 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS ) | 1396 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS ) |