Mercurial > mm7
comparison UIHouses.cpp @ 954:27bfe64b13b5
Слияние
author | Ritor1 |
---|---|
date | Mon, 29 Apr 2013 09:18:19 +0600 |
parents | aa7bd15e2655 34ed2d5e7cfb |
children | e9292c58644a |
comparison
equal
deleted
inserted
replaced
953:aa7bd15e2655 | 954:27bfe64b13b5 |
---|---|
5497 int v12; // ST08_4@19 | 5497 int v12; // ST08_4@19 |
5498 int v13; // eax@19 | 5498 int v13; // eax@19 |
5499 int all_text_height; // edi@21 | 5499 int all_text_height; // edi@21 |
5500 char **v15; // esi@21 | 5500 char **v15; // esi@21 |
5501 int v16; // eax@22 | 5501 int v16; // eax@22 |
5502 GUIWindow *v17; // ecx@23 | |
5503 int v18; // edx@23 | 5502 int v18; // edx@23 |
5504 int v19; // edi@23 | 5503 int v19; // edi@23 |
5505 unsigned __int8 v20; // sf@23 | 5504 unsigned __int8 v20; // sf@23 |
5506 GUIButton *control_button; // esi@25 | 5505 GUIButton *control_button; // esi@25 |
5507 const char **v22; // eax@25 | 5506 const char **v22; // eax@25 |
5511 unsigned __int16 text_color; // ax@25 | 5510 unsigned __int16 text_color; // ax@25 |
5512 signed int pTextHeight; // esi@30 | 5511 signed int pTextHeight; // esi@30 |
5513 int v28; // ST08_4@34 | 5512 int v28; // ST08_4@34 |
5514 int v29; // eax@34 | 5513 int v29; // eax@34 |
5515 char *v30; // edx@35 | 5514 char *v30; // edx@35 |
5516 //GUIWindow *v31; // edi@40 | |
5517 void *v32; // eax@40 | 5515 void *v32; // eax@40 |
5518 signed int v33; // esi@40 | 5516 signed int v33; // esi@40 |
5519 unsigned int v34; // esi@42 | 5517 unsigned int v34; // esi@42 |
5520 int v35; // eax@42 | 5518 int v35; // eax@42 |
5521 unsigned int v36; // eax@43 | 5519 unsigned int v36; // eax@43 |
5522 int v37; // eax@45 | 5520 int v37; // eax@45 |
5523 int v38; // ecx@50 | 5521 int v38; // ecx@50 |
5524 //GUIButton *v39; // eax@52 | |
5525 //GUIButton *v40; // esi@52 | |
5526 int v41; // eax@52 | 5522 int v41; // eax@52 |
5527 char *v42; // eax@54 | 5523 char *v42; // eax@54 |
5528 int v43; // eax@54 | 5524 int v43; // eax@54 |
5529 unsigned int v44; // ecx@54 | 5525 unsigned int v44; // ecx@54 |
5530 int v45; // edx@54 | 5526 int v45; // edx@54 |
5538 int v53; // edx@70 | 5534 int v53; // edx@70 |
5539 Texture *v54; // ecx@76 | 5535 Texture *v54; // ecx@76 |
5540 unsigned int v55; // edi@76 | 5536 unsigned int v55; // edi@76 |
5541 unsigned int v56; // esi@76 | 5537 unsigned int v56; // esi@76 |
5542 int v57; // edx@80 | 5538 int v57; // edx@80 |
5543 Texture *v58; // ecx@86 | |
5544 unsigned int v59; // edi@86 | 5539 unsigned int v59; // edi@86 |
5545 unsigned int v60; // esi@88 | 5540 unsigned int v60; // esi@88 |
5546 int v61; // edx@92 | 5541 int v61; // edx@92 |
5547 Texture *v62; // ecx@98 | |
5548 unsigned int v63; // edi@98 | 5542 unsigned int v63; // edi@98 |
5549 unsigned int v64; // esi@100 | 5543 unsigned int v64; // esi@100 |
5550 int v65; // edx@104 | 5544 int v65; // edx@104 |
5551 signed int v66; // ecx@109 | 5545 signed int v66; // ecx@109 |
5552 SHORT v67; // di@117 | 5546 SHORT v67; // di@117 |
5553 bool v68; // eax@117 | 5547 bool v68; // eax@117 |
5554 const char *v69; // ecx@119 | 5548 const char *v69; // ecx@119 |
5555 POINT *v70; // esi@124 | 5549 POINT *v70; // esi@124 |
5556 int v71; // ecx@125 | 5550 int v71; // ecx@125 |
5557 int v72; // eax@125 | |
5558 int v73; // ecx@125 | 5551 int v73; // ecx@125 |
5559 ItemGen *v74; // esi@125 | |
5560 int v75; // eax@130 | 5552 int v75; // eax@130 |
5561 //int v76; // esi@131 | |
5562 //char **v77; // edi@131 | |
5563 int v78; // eax@132 | 5553 int v78; // eax@132 |
5564 //GUIWindow *v79; // ecx@133 | |
5565 int v80; // edx@133 | 5554 int v80; // edx@133 |
5566 int v81; // edi@133 | 5555 int v81; // edi@133 |
5567 //GUIButton *v82; // esi@135 | |
5568 const char **v83; // eax@135 | 5556 const char **v83; // eax@135 |
5569 int v84; // eax@135 | 5557 int v84; // eax@135 |
5570 unsigned int v85; // ecx@135 | 5558 unsigned int v85; // ecx@135 |
5571 int v86; // edx@135 | 5559 int v86; // edx@135 |
5572 GUIWindow *v88; // [sp-18h] [bp-110h]@35 | |
5573 int v89; // [sp-14h] [bp-10Ch]@35 | 5560 int v89; // [sp-14h] [bp-10Ch]@35 |
5574 ItemGen *v90; // [sp-10h] [bp-108h]@14 | |
5575 int v91; // [sp-10h] [bp-108h]@35 | 5561 int v91; // [sp-10h] [bp-108h]@35 |
5576 unsigned __int16 v92; // [sp-Ch] [bp-104h]@12 | 5562 unsigned __int16 v92; // [sp-Ch] [bp-104h]@12 |
5577 void *v93; // [sp-Ch] [bp-104h]@14 | 5563 void *v93; // [sp-Ch] [bp-104h]@14 |
5578 int v94; // [sp-8h] [bp-100h]@11 | 5564 int v94; // [sp-8h] [bp-100h]@11 |
5579 char *v95; // [sp-8h] [bp-100h]@12 | 5565 char *v95; // [sp-8h] [bp-100h]@12 |
5649 ++j; | 5635 ++j; |
5650 } | 5636 } |
5651 } | 5637 } |
5652 return; | 5638 return; |
5653 } | 5639 } |
5654 | |
5655 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT ) | |
5656 { | |
5657 draw_leather(); | |
5658 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | |
5659 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];// "Sell" | |
5660 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];// "Identify" | |
5661 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];// "Repair" | |
5662 all_text_height = 0; | |
5663 for ( uint i = 0; i < 3; ++i ) | |
5664 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | |
5665 _this = ((174 - all_text_height) / 3); | |
5666 v81 = (3 * (58 - (signed int)_this) - all_text_height) / 2 - (174 - all_text_height) / 3 / 2 + 138; | |
5667 v20 = -pDialogueWindow->pNumPresenceButton < 0; | |
5668 v118 = pDialogueWindow->pStartingPosActiveItem; | |
5669 if ( v20 ^ pDialogueWindow->pStartingPosActiveItem > pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton ) | |
5670 { | |
5671 v122 = 2; | |
5672 pSrtingNum = 0; | |
5673 do | |
5674 { | |
5675 control_button = pDialogueWindow->GetControl(v118); | |
5676 control_button->uY = (unsigned int)((char *)_this + v81); | |
5677 pTextHeight = pFontArrus->CalcTextHeight(pShopOptions[pSrtingNum], &dialog_window, 0, 0); | |
5678 v85 = control_button->uY; | |
5679 control_button->uHeight = pTextHeight; | |
5680 v81 = pTextHeight + v85 - 1; | |
5681 control_button->uW = v81; | |
5682 text_color = pYellowColor; | |
5683 if ( pDialogueWindow->pCurrentPosActiveItem != v122 ) | |
5684 text_color = pWhiteColor; | |
5685 dialog_window.DrawTitleText(pFontArrus, 0, v85, text_color, pShopOptions[pSrtingNum], 3); | |
5686 ++v122; | |
5687 ++pSrtingNum; | |
5688 ++v118; | |
5689 } | |
5690 while ( v118 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); | |
5691 } | |
5692 return; | |
5693 } | |
5694 | |
5695 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_REPAIR) | |
5696 { | |
5697 draw_leather(); | |
5698 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | |
5699 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);// "Select the Item to Repair" | |
5700 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() | |
5701 || (pTextHeight = pMouse->GetCursorPos(&v110)->x - 14, | |
5702 v117 = (pTextHeight >> 5) + 14 * ((pMouse->GetCursorPos(&v108)->y - 17) >> 5), | |
5703 result = (int)pMouse->GetCursorPos(&v106), | |
5704 *(int *)result <= 13) | |
5705 || (result = (int)pMouse->GetCursorPos(&v104), *(int *)result >= 462) | |
5706 || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) | |
5707 || (result *= 9, !(pPlayers[uActiveCharacter]->field_1F5[4 * result + 15] & 2)) ) | |
5708 return; | |
5709 item = &pPlayers[uActiveCharacter]->pInventoryItems[result - 1]; | |
5710 v29 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItems[result - 1], BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 5); | |
5711 v30 = BuilDialogueString((char *)pMerchantsRepairPhrases[v29], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0); | |
5712 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; | |
5713 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); | |
5714 return; | |
5715 } | |
5716 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS ) | |
5717 { | |
5718 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | |
5719 { | |
5720 v3 = 0; | |
5721 all_text_height = 0; | |
5722 v33 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); | |
5723 v119 = (const char **)(v33 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100); | |
5724 if ( (signed int)v119 < v33 / 3 ) | |
5725 v119 = (const char **)(v33 / 3); | |
5726 pActiveItemNum = pDialogueWindow->pStartingPosActiveItem; | |
5727 v122 = 0; | |
5728 if ( (signed int)pDialogueWindow->pStartingPosActiveItem >= pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton ) | |
5729 { | |
5730 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);// | |
5731 // "Seek knowledge elsewhere %s the %s" | |
5732 strcat(pTmpBuf, "\n \n"); | |
5733 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further." | |
5734 v6 = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138; | |
5735 dialog_window.DrawTitleText(pFontArrus, v3, v6, pYellowColor, pTmpBuf, 3); | |
5736 return; | |
5737 } | |
5738 do | |
5739 { | |
5740 v36 = pDialogueWindow->GetControl(pActiveItemNum)->msg_param - 36; | |
5741 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v36] && !pPlayers[uActiveCharacter]->pActiveSkills[v36] ) | |
5742 { | |
5743 all_text_height += pFontArrus->CalcTextHeight(pSkillNames[v36], &dialog_window, 0, 0); | |
5744 ++v122; | |
5745 } | |
5746 ++pActiveItemNum; | |
5747 } | |
5748 while ( pActiveItemNum < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); | |
5749 if ( !v122 ) | |
5750 { | |
5751 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);// | |
5752 // "Seek knowledge elsewhere %s the %s" | |
5753 strcat(pTmpBuf, "\n \n"); | |
5754 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further." | |
5755 v6 = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138; | |
5756 dialog_window.DrawTitleText(pFontArrus, v3, v6, pYellowColor, pTmpBuf, 3); | |
5757 return; | |
5758 } | |
5759 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v119);// "Skill Cost: %lu" | |
5760 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); | |
5761 v119 = (const char **)((149 - all_text_height) / v122); | |
5762 if ( (149 - all_text_height) / v122 > 32 ) | |
5763 v119 = (const char **)32; | |
5764 v38 = (149 - v122 * (signed int)v119 - all_text_height) / 2 - (signed int)v119 / 2 + 162; | |
5765 v118 = 2; | |
5766 if ( pDialogueWindow->pStartingPosActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton ) | |
5767 { | |
5768 v122 = 2; | |
5769 do | |
5770 { | |
5771 control_button = pDialogueWindow->GetControl(v122); | |
5772 v41 = control_button->msg_param - 36; | |
5773 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v41] || pPlayers[uActiveCharacter]->pActiveSkills[v41] ) | |
5774 { | |
5775 control_button->uW = 0; | |
5776 control_button->uHeight = 0; | |
5777 control_button->uY = 0; | |
5778 } | |
5779 else | |
5780 { | |
5781 control_button->uY = (unsigned int)((char *)v119 + v38); | |
5782 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v41], &dialog_window, 0, 0); | |
5783 v44 = control_button->uY; | |
5784 control_button->uHeight = pTextHeight; | |
5785 v38 = v44 + pTextHeight - 1; | |
5786 control_button->uW = v38; | |
5787 text_color = pYellowColor; | |
5788 if ( pDialogueWindow->pCurrentPosActiveItem != v122 ) | |
5789 text_color = pWhiteColor; | |
5790 dialog_window.DrawTitleText(pFontArrus, 0, v44, text_color, pSkillNames[v41], 3); | |
5791 } | |
5792 ++v122; | |
5793 } | |
5794 while ( v122 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); | |
5795 } | |
5796 } | |
5797 return; | |
5798 } | |
5799 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_IDENTIFY) | |
5800 { | |
5801 draw_leather(); | |
5802 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | |
5803 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);// "Select the Item to Identify" | |
5804 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | |
5805 { | |
5806 v2 = pMouse->GetCursorPos(&a2)->x - 14; | |
5807 v117 = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v98)->y - 17) >> 5); | |
5808 result = (int)pMouse->GetCursorPos(&v111); | |
5809 if ( *(int *)result > 13 ) | |
5810 { | |
5811 result = (int)pMouse->GetCursorPos(&v103); | |
5812 if ( *(int *)result < 462 ) | |
5813 { | |
5814 result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117); | |
5815 if ( result ) | |
5816 { | |
5817 item = &pPlayers[uActiveCharacter]->pInventoryItems[result-1]; | |
5818 if ( item->uAttributes & 1 ) | |
5819 { | |
5820 v5 = BuilDialogueString("%24", uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); | |
5821 v6 = (212 - pFontArrus->CalcTextHeight(v5, &dialog_window, 0, 0)) / 2 + 101; | |
5822 dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v5, 3); | |
5823 return; | |
5824 } | |
5825 v8 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 4); | |
5826 v30 = BuilDialogueString((char *)pMerchantsIdentifyPhrases[v8], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); | |
5827 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138; | |
5828 dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v30, 3); | |
5829 return; | |
5830 } | |
5831 } | |
5832 } | |
5833 } | |
5834 return; | |
5835 } | |
5836 if ( dialog_menu_id > HOUSE_DIALOGUE_SHOP_REPAIR ) | |
5837 { | |
5838 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_SPECIAL ) | |
5839 { | |
5840 result = dialog_menu_id - HOUSE_DIALOGUE_LEARN_SKILLS; | |
5841 | |
5842 } | |
5843 } | |
5844 else | |
5845 { | |
5846 | |
5847 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) | |
5848 { | |
5849 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_SELL) | |
5850 { | |
5851 result = dialog_menu_id - HOUSE_DIALOGUE_SHOP_IDENTIFY; | |
5852 return; | |
5853 } | |
5854 draw_leather(); | |
5855 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | |
5856 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);// "Select the Item to Sell" | |
5857 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | |
5858 if ( !result | |
5859 || (v11 = pMouse->GetCursorPos(&v107)->x - 14, | |
5860 v117 = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v99)->y - 17) >> 5), | |
5861 result = (int)pMouse->GetCursorPos(&v105), | |
5862 *(int *)result <= 13) | |
5863 || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462) | |
5864 || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) ) | |
5865 return; | |
5866 v96 = 0; | |
5867 v94 = 3; | |
5868 v93 = window_SpeakInHouse->ptr_1C; | |
5869 v90 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[result - 1]; | |
5870 v12 = (int)window_SpeakInHouse->ptr_1C; | |
5871 uPlayerID = uActiveCharacter - 1; | |
5872 v13 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v90, BildingType_MagicShop, v12, 3); | |
5873 v9 = uPlayerID; | |
5874 v10 = (char *)pMerchantsSellPhrases[v13]; | |
5875 v30 = BuilDialogueString(v10, v9, v90, (char *)v93, v94, v96); | |
5876 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; | |
5877 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); | |
5878 return; | |
5879 } | |
5880 } | |
5881 pRenderer->DrawTextureIndexed(8, 8, ShopTexture); | |
5882 v3 = 0; | |
5883 v49 = 0; | |
5884 v122 = 0; | |
5885 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD) | 5640 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD) |
5886 { | 5641 { |
5642 pRenderer->DrawTextureIndexed(8, 8, ShopTexture); | |
5643 v3 = 0; | |
5644 v49 = 0; | |
5645 v122 = 0; | |
5887 do | 5646 do |
5888 { | 5647 { |
5889 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID) | 5648 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID) |
5890 { | 5649 { |
5891 v50 = ItemsInShopTexture[v49]; | 5650 v50 = ItemsInShopTexture[v49]; |
5941 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v122 + 6], v122 + 7); | 5700 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], ItemsInShopTexture[v122 + 6], v122 + 7); |
5942 } | 5701 } |
5943 ++v122; | 5702 ++v122; |
5944 } | 5703 } |
5945 while ( v122 < 6 ); | 5704 while ( v122 < 6 ); |
5705 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | |
5706 { | |
5707 v66 = 0; | |
5708 v117 = 0; | |
5709 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD) | |
5710 { | |
5711 do | |
5712 { | |
5713 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID) //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) | |
5714 ++v117; | |
5715 ++v66; | |
5716 } | |
5717 while ( v66 < 12 ); | |
5718 } | |
5719 else | |
5720 { | |
5721 do | |
5722 { | |
5723 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID) | |
5724 ++v117; | |
5725 ++v66; | |
5726 } | |
5727 while ( v66 < 12 ); | |
5728 } | |
5729 v67 = GetAsyncKeyState(VK_CONTROL); | |
5730 v68 = pPlayers[uActiveCharacter]->CanSteal(); | |
5731 Str = (char *)v68; | |
5732 if ( v67 && v68 ) | |
5733 { | |
5734 v69 = pGlobalTXT_LocalizationStrings[185];// "Steal item" | |
5735 } | |
5736 else | |
5737 { | |
5738 v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy" | |
5739 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) | |
5740 v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy" | |
5741 } | |
5742 DrawTextAtStatusBar(v69, 0); | |
5743 if ( !v117 ) | |
5744 { | |
5745 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); | |
5746 return; | |
5747 } | |
5748 v70 = pMouse->GetCursorPos(&v102); | |
5749 result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y]; | |
5750 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF ) | |
5751 { | |
5752 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1; | |
5753 item = &pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71]; | |
5754 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) | |
5755 item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71]; | |
5756 if ( v67 && Str ) | |
5757 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24" | |
5758 else | |
5759 { | |
5760 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2); | |
5761 v10 = (char *)pMerchantsBuyPhrases[v75]; | |
5762 } | |
5763 v30 = BuilDialogueString(v10, uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); | |
5764 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; | |
5765 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); | |
5766 return; | |
5767 } | |
5768 } | |
5769 return; | |
5946 } | 5770 } |
5947 else | 5771 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL) |
5948 { | 5772 { |
5773 pRenderer->DrawTextureIndexed(8, 8, ShopTexture); | |
5774 v3 = 0; | |
5775 v49 = 0; | |
5776 v122 = 0; | |
5949 do | 5777 do |
5950 { | 5778 { |
5951 // if ( pParty->field_C59C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) | 5779 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID) |
5952 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID) | 5780 { |
5953 { | 5781 v59 = 152 - ItemsInShopTexture[v49]->uTextureHeight; |
5954 v58 = ItemsInShopTexture[v49]; | |
5955 v59 = 152 - v58->uTextureHeight; | |
5956 if ( (signed int)v59 < 1 ) | 5782 if ( (signed int)v59 < 1 ) |
5957 v59 = 0; | 5783 v59 = 0; |
5958 v60 = 75 * v49 - v58->uTextureWidth / 2 + 40; | 5784 v60 = 75 * v49 - ItemsInShopTexture[v49]->uTextureWidth / 2 + 40; |
5959 if ( v122 ) | 5785 if ( v122 ) |
5960 { | 5786 { |
5961 if ( v122 == 5 ) | 5787 if ( v122 == 5 ) |
5962 { | 5788 { |
5963 v61 = ItemsInShopTexture[5]->uTextureWidth; | 5789 v61 = ItemsInShopTexture[5]->uTextureWidth; |
5968 else | 5794 else |
5969 { | 5795 { |
5970 if ( (signed int)v60 < 18 ) | 5796 if ( (signed int)v60 < 18 ) |
5971 v60 = 18; | 5797 v60 = 18; |
5972 } | 5798 } |
5973 pRenderer->DrawTextureTransparent(v60, v59, v58); | 5799 pRenderer->DrawTextureTransparent(v60, v59, ItemsInShopTexture[v49]); |
5974 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v122], v122 + 1); | 5800 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v122], v122 + 1); |
5975 v49 = v122; | 5801 v49 = v122; |
5976 } | 5802 } |
5977 ++v49; | 5803 ++v49; |
5978 v122 = v49; | 5804 v122 = v49; |
5979 } | 5805 } |
5980 while ( v49 < 6 ); | 5806 while ( v49 < 6 ); |
5981 v122 = 0; | 5807 v122 = 0; |
5982 do | 5808 do |
5983 { | 5809 { |
5984 //if ( pParty->Spell_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v49] + 778] ) //weak | |
5985 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v122 + 6].uItemID) | 5810 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v122 + 6].uItemID) |
5986 { | 5811 { |
5987 v62 = ItemsInShopTexture[v122 + 6]; | 5812 v63 = 306 - ItemsInShopTexture[v122 + 6]->uTextureHeight; |
5988 v63 = 306 - v62->uTextureHeight; | |
5989 if ( (signed int)v63 < 1 ) | 5813 if ( (signed int)v63 < 1 ) |
5990 v63 = 0; | 5814 v63 = 0; |
5991 v64 = 75 * v122 - v62->uTextureWidth / 2 + 40; | 5815 v64 = 75 * v122 - ItemsInShopTexture[v122 + 6]->uTextureWidth / 2 + 40; |
5992 if ( v122 ) | 5816 if ( v122 ) |
5993 { | 5817 { |
5994 if ( v122 == 5 ) | 5818 if ( v122 == 5 ) |
5995 { | 5819 { |
5996 v65 = ItemsInShopTexture[11]->uTextureWidth; | 5820 v65 = ItemsInShopTexture[11]->uTextureWidth; |
6001 else | 5825 else |
6002 { | 5826 { |
6003 if ( (signed int)v64 < 18 ) | 5827 if ( (signed int)v64 < 18 ) |
6004 v64 = 18; | 5828 v64 = 18; |
6005 } | 5829 } |
6006 pRenderer->DrawTextureTransparent(v64, v63, v62); | 5830 pRenderer->DrawTextureTransparent(v64, v63, ItemsInShopTexture[v122 + 6]); |
6007 sub_40F92A(&pRenderer->pActiveZBuffer[v64 + 640 * v63], ItemsInShopTexture[v122 + 6], v122 + 7); | 5831 sub_40F92A(&pRenderer->pActiveZBuffer[v64 + 640 * v63], ItemsInShopTexture[v122 + 6], v122 + 7); |
6008 } | 5832 } |
6009 ++v122; | 5833 ++v122; |
6010 } | 5834 } |
6011 while ( v122 < 6 ); | 5835 while ( v122 < 6 ); |
5836 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | |
5837 { | |
5838 v66 = 0; | |
5839 v117 = 0; | |
5840 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD) | |
5841 { | |
5842 do | |
5843 { | |
5844 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID) //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) | |
5845 ++v117; | |
5846 ++v66; | |
5847 } | |
5848 while ( v66 < 12 ); | |
5849 } | |
5850 else | |
5851 { | |
5852 do | |
5853 { | |
5854 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID) | |
5855 ++v117; | |
5856 ++v66; | |
5857 } | |
5858 while ( v66 < 12 ); | |
5859 } | |
5860 v67 = GetAsyncKeyState(VK_CONTROL); | |
5861 v68 = pPlayers[uActiveCharacter]->CanSteal(); | |
5862 Str = (char *)v68; | |
5863 if ( v67 && v68 ) | |
5864 { | |
5865 v69 = pGlobalTXT_LocalizationStrings[185];// "Steal item" | |
5866 } | |
5867 else | |
5868 { | |
5869 v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy" | |
5870 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) | |
5871 v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy" | |
5872 } | |
5873 DrawTextAtStatusBar(v69, 0); | |
5874 if ( !v117 ) | |
5875 { | |
5876 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); | |
5877 return; | |
5878 } | |
5879 v70 = pMouse->GetCursorPos(&v102); | |
5880 result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y]; | |
5881 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF ) | |
5882 { | |
5883 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1; | |
5884 item = &pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71]; | |
5885 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) | |
5886 item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71]; | |
5887 if ( v67 && Str ) | |
5888 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24" | |
5889 else | |
5890 { | |
5891 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2); | |
5892 v10 = (char *)pMerchantsBuyPhrases[v75]; | |
5893 } | |
5894 v30 = BuilDialogueString(v10, uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); | |
5895 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; | |
5896 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); | |
5897 return; | |
5898 } | |
5899 } | |
5900 return; | |
6012 } | 5901 } |
6013 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | 5902 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT ) |
6014 if ( result ) | |
6015 { | 5903 { |
6016 v66 = 0; | 5904 draw_leather(); |
6017 v117 = 0; | 5905 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); |
6018 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD) | 5906 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];// "Sell" |
6019 { | 5907 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];// "Identify" |
5908 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];// "Repair" | |
5909 all_text_height = 0; | |
5910 for ( uint i = 0; i < 3; ++i ) | |
5911 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | |
5912 _this = ((174 - all_text_height) / 3); | |
5913 v81 = (3 * (58 - (signed int)_this) - all_text_height) / 2 - (174 - all_text_height) / 3 / 2 + 138; | |
5914 v20 = -pDialogueWindow->pNumPresenceButton < 0; | |
5915 v118 = pDialogueWindow->pStartingPosActiveItem; | |
5916 if ( v20 ^ pDialogueWindow->pStartingPosActiveItem > pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton ) | |
5917 { | |
5918 v122 = 2; | |
5919 pSrtingNum = 0; | |
6020 do | 5920 do |
6021 { | 5921 { |
6022 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID) //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) | 5922 control_button = pDialogueWindow->GetControl(v118); |
6023 ++v117; | 5923 control_button->uY = (unsigned int)((char *)_this + v81); |
6024 ++v66; | 5924 pTextHeight = pFontArrus->CalcTextHeight(pShopOptions[pSrtingNum], &dialog_window, 0, 0); |
6025 } | 5925 v85 = control_button->uY; |
6026 while ( v66 < 12 ); | 5926 control_button->uHeight = pTextHeight; |
6027 } | 5927 v81 = pTextHeight + v85 - 1; |
6028 else | 5928 control_button->uW = v81; |
6029 { | 5929 text_color = pYellowColor; |
5930 if ( pDialogueWindow->pCurrentPosActiveItem != v122 ) | |
5931 text_color = pWhiteColor; | |
5932 dialog_window.DrawTitleText(pFontArrus, 0, v85, text_color, pShopOptions[pSrtingNum], 3); | |
5933 ++v122; | |
5934 ++pSrtingNum; | |
5935 ++v118; | |
5936 } | |
5937 while ( v118 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); | |
5938 } | |
5939 return; | |
5940 } | |
5941 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_SELL) | |
5942 { | |
5943 draw_leather(); | |
5944 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | |
5945 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);// "Select the Item to Sell" | |
5946 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() | |
5947 || (v11 = pMouse->GetCursorPos(&v107)->x - 14, | |
5948 v117 = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v99)->y - 17) >> 5), | |
5949 result = (int)pMouse->GetCursorPos(&v105), | |
5950 *(int *)result <= 13) | |
5951 || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462) | |
5952 || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) ) | |
5953 return; | |
5954 item = &pPlayers[uActiveCharacter]->pInventoryItems[result - 1]; | |
5955 v13 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 3); | |
5956 v30 = BuilDialogueString((char *)pMerchantsSellPhrases[v13], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 3, 0); | |
5957 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; | |
5958 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); | |
5959 return; | |
5960 } | |
5961 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_IDENTIFY) | |
5962 { | |
5963 draw_leather(); | |
5964 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | |
5965 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);// "Select the Item to Identify" | |
5966 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | |
5967 { | |
5968 v2 = pMouse->GetCursorPos(&a2)->x - 14; | |
5969 v117 = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v98)->y - 17) >> 5); | |
5970 result = (int)pMouse->GetCursorPos(&v111); | |
5971 if ( *(int *)result > 13 ) | |
5972 { | |
5973 result = (int)pMouse->GetCursorPos(&v103); | |
5974 if ( *(int *)result < 462 ) | |
5975 { | |
5976 result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117); | |
5977 if ( result ) | |
5978 { | |
5979 item = &pPlayers[uActiveCharacter]->pInventoryItems[result-1]; | |
5980 if ( item->uAttributes & 1 ) | |
5981 { | |
5982 v5 = BuilDialogueString("%24", uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); | |
5983 v6 = (212 - pFontArrus->CalcTextHeight(v5, &dialog_window, 0, 0)) / 2 + 101; | |
5984 dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v5, 3); | |
5985 return; | |
5986 } | |
5987 v8 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 4); | |
5988 v30 = BuilDialogueString((char *)pMerchantsIdentifyPhrases[v8], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); | |
5989 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138; | |
5990 dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v30, 3); | |
5991 return; | |
5992 } | |
5993 } | |
5994 } | |
5995 } | |
5996 return; | |
5997 } | |
5998 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_REPAIR) | |
5999 { | |
6000 draw_leather(); | |
6001 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | |
6002 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);// "Select the Item to Repair" | |
6003 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() | |
6004 || (pTextHeight = pMouse->GetCursorPos(&v110)->x - 14, | |
6005 v117 = (pTextHeight >> 5) + 14 * ((pMouse->GetCursorPos(&v108)->y - 17) >> 5), | |
6006 result = (int)pMouse->GetCursorPos(&v106), | |
6007 *(int *)result <= 13) | |
6008 || (result = (int)pMouse->GetCursorPos(&v104), *(int *)result >= 462) | |
6009 || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) | |
6010 || (result *= 9, !(pPlayers[uActiveCharacter]->field_1F5[4 * result + 15] & 2)) ) | |
6011 return; | |
6012 item = &pPlayers[uActiveCharacter]->pInventoryItems[result - 1]; | |
6013 v29 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItems[result - 1], BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 5); | |
6014 v30 = BuilDialogueString((char *)pMerchantsRepairPhrases[v29], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0); | |
6015 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; | |
6016 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); | |
6017 return; | |
6018 } | |
6019 if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS ) | |
6020 { | |
6021 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | |
6022 { | |
6023 v3 = 0; | |
6024 all_text_height = 0; | |
6025 v33 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); | |
6026 v119 = (const char **)(v33 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100); | |
6027 if ( (signed int)v119 < v33 / 3 ) | |
6028 v119 = (const char **)(v33 / 3); | |
6029 pActiveItemNum = pDialogueWindow->pStartingPosActiveItem; | |
6030 v122 = 0; | |
6031 if ( (signed int)pDialogueWindow->pStartingPosActiveItem >= pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton ) | |
6032 { | |
6033 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);// | |
6034 // "Seek knowledge elsewhere %s the %s" | |
6035 strcat(pTmpBuf, "\n \n"); | |
6036 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further." | |
6037 v6 = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138; | |
6038 dialog_window.DrawTitleText(pFontArrus, v3, v6, pYellowColor, pTmpBuf, 3); | |
6039 return; | |
6040 } | |
6030 do | 6041 do |
6031 { | 6042 { |
6032 //if ( pParty->field_C59C[9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) | 6043 v36 = pDialogueWindow->GetControl(pActiveItemNum)->msg_param - 36; |
6033 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID) | 6044 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v36] && !pPlayers[uActiveCharacter]->pActiveSkills[v36] ) |
6034 ++v117; | 6045 { |
6035 ++v66; | 6046 all_text_height += pFontArrus->CalcTextHeight(pSkillNames[v36], &dialog_window, 0, 0); |
6036 } | 6047 ++v122; |
6037 while ( v66 < 12 ); | 6048 } |
6038 } | 6049 ++pActiveItemNum; |
6039 v67 = GetAsyncKeyState(VK_CONTROL); | 6050 } |
6040 v68 = pPlayers[uActiveCharacter]->CanSteal(); | 6051 while ( pActiveItemNum < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); |
6041 Str = (char *)v68; | 6052 if ( !v122 ) |
6042 if ( v67 && v68 ) | 6053 { |
6043 { | 6054 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);// |
6044 v69 = pGlobalTXT_LocalizationStrings[185];// "Steal item" | 6055 // "Seek knowledge elsewhere %s the %s" |
6045 } | 6056 strcat(pTmpBuf, "\n \n"); |
6046 else | 6057 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further." |
6047 { | 6058 v6 = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138; |
6048 v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy" | 6059 dialog_window.DrawTitleText(pFontArrus, v3, v6, pYellowColor, pTmpBuf, 3); |
6049 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) | 6060 return; |
6050 v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy" | 6061 } |
6051 } | 6062 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v119);// "Skill Cost: %lu" |
6052 DrawTextAtStatusBar(v69, 0); | 6063 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); |
6053 if ( !v117 ) | 6064 v119 = (const char **)((149 - all_text_height) / v122); |
6054 { | 6065 if ( (149 - all_text_height) / v122 > 32 ) |
6055 dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); | 6066 v119 = (const char **)32; |
6056 return; | 6067 v38 = (149 - v122 * (signed int)v119 - all_text_height) / 2 - (signed int)v119 / 2 + 162; |
6057 } | 6068 v118 = 2; |
6058 v70 = pMouse->GetCursorPos(&v102); | 6069 if ( pDialogueWindow->pStartingPosActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton ) |
6059 result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y]; | 6070 { |
6060 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF ) | 6071 v122 = 2; |
6061 { | 6072 do |
6062 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1; | 6073 { |
6063 v117 = v71; | 6074 control_button = pDialogueWindow->GetControl(v122); |
6064 v72 = (int)window_SpeakInHouse->ptr_1C; | 6075 v41 = control_button->msg_param - 36; |
6065 v74 = (ItemGen *)&pParty->StandartItemsInShops[v72][v71]; | 6076 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v41] || pPlayers[uActiveCharacter]->pActiveSkills[v41] ) |
6066 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) | 6077 { |
6067 v74 =&pParty->SpecialItemsInShops[v72][v71]; | 6078 control_button->uW = 0; |
6068 if ( v67 && Str ) | 6079 control_button->uHeight = 0; |
6069 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24" | 6080 control_button->uY = 0; |
6070 else | 6081 } |
6071 { | 6082 else |
6072 v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v74, BildingType_MagicShop, v72, 2); | 6083 { |
6073 v10 = (char *)pMerchantsBuyPhrases[v75]; | 6084 control_button->uY = (unsigned int)((char *)v119 + v38); |
6074 } | 6085 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v41], &dialog_window, 0, 0); |
6075 v30 = BuilDialogueString(v10, uActiveCharacter - 1, v74, (char *)window_SpeakInHouse->ptr_1C, 2, 0); | 6086 v44 = control_button->uY; |
6076 v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; | 6087 control_button->uHeight = pTextHeight; |
6077 dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); | 6088 v38 = v44 + pTextHeight - 1; |
6078 return; | 6089 control_button->uW = v38; |
6079 } | 6090 text_color = pYellowColor; |
6091 if ( pDialogueWindow->pCurrentPosActiveItem != v122 ) | |
6092 text_color = pWhiteColor; | |
6093 dialog_window.DrawTitleText(pFontArrus, 0, v44, text_color, pSkillNames[v41], 3); | |
6094 } | |
6095 ++v122; | |
6096 } | |
6097 while ( v122 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); | |
6098 } | |
6099 } | |
6100 return; | |
6080 } | 6101 } |
6081 return; | 6102 return; |
6082 } | 6103 } |