Mercurial > mm7
comparison UI/UIShops.cpp @ 1739:1776d4f033a7
WeaponShop cleared
author | Ritor1 |
---|---|
date | Fri, 27 Sep 2013 15:19:32 +0600 |
parents | f44b6e02e81c |
children | 4b0e19d91505 |
comparison
equal
deleted
inserted
replaced
1735:873ac151c38d | 1739:1776d4f033a7 |
---|---|
14 #include "..\Viewport.h" | 14 #include "..\Viewport.h" |
15 | 15 |
16 //----- (004B910F) -------------------------------------------------------- | 16 //----- (004B910F) -------------------------------------------------------- |
17 void WeaponShopDialog() | 17 void WeaponShopDialog() |
18 { | 18 { |
19 int v0; // ebx@1 | 19 int phrases_id; // eax@16 |
20 int pNumActiveItem; // eax@6 | |
21 signed int v2; // esi@8 | |
22 ItemGen *v4; // eax@11 | |
23 char *v5; // ecx@12 | |
24 unsigned __int8 v6; // dl@13 | |
25 char *v7; // edx@14 | |
26 int v9; // ST08_4@16 | |
27 int v10; // eax@16 | |
28 signed int v11; // esi@18 | |
29 int v12; // ST08_4@21 | |
30 int v13; // eax@21 | |
31 int v14; // edi@23 | |
32 char **v15; // esi@23 | |
33 int v16; // eax@24 | |
34 //int v18; // edx@25 | |
35 int v19; // edi@25 | 20 int v19; // edi@25 |
36 unsigned __int8 v20; // sf@25 | |
37 GUIButton *pButton; // esi@27 | 21 GUIButton *pButton; // esi@27 |
38 int pNewItem; // eax@27 | |
39 unsigned int v24; // ecx@27 | |
40 int v25; // edx@27 | |
41 unsigned int pColorText; // ax@27 | 22 unsigned int pColorText; // ax@27 |
42 signed int v27; // esi@32 | |
43 int v28; // ST08_4@36 | |
44 int v29; // eax@36 | |
45 signed int v32; // esi@41 | 23 signed int v32; // esi@41 |
46 unsigned int v33; // esi@43 | 24 const char *pText; // ecx@84 |
47 int v34; // eax@43 | |
48 unsigned int v35; // eax@44 | |
49 int v36; // eax@46 | |
50 __int32 v37; // ecx@51 | |
51 int v40; // eax@53 | |
52 char *v41; // eax@55 | |
53 unsigned int v43; // ecx@55 | |
54 const char **v44; // edx@55 | |
55 int v45; // eax@55 | |
56 int v47; // eax@59 | |
57 const char **v48; // eax@63 | |
58 unsigned int v49; // esi@65 | |
59 Texture *v50; // eax@65 | |
60 int v51; // edi@65 | |
61 int v52; // esi@70 | |
62 Texture *v53; // ST1C_4@70 | |
63 int v54; // edi@70 | |
64 signed int v55; // ecx@73 | |
65 SHORT v56; // di@82 | |
66 bool v57; // eax@82 | |
67 const char *v58; // ecx@84 | |
68 POINT *v59; // esi@89 | |
69 LONG v60; // ecx@90 | |
70 int v61; // eax@90 | |
71 int v62; // ecx@90 | |
72 ItemGen *pItemInShop; // esi@90 | |
73 //int v64; // eax@95 | |
74 int all_text_height; // esi@96 | 25 int all_text_height; // esi@96 |
75 char **v66; // edi@96 | 26 ItemGen *item; |
76 int v67; // eax@97 | 27 int pItemID; |
77 int v69; // edx@98 | 28 POINT mouse; // [sp+64h] [bp-94h]@8 |
78 int v70; // edi@98 | |
79 int v71; | |
80 const char **v72; // eax@100 | |
81 int pTextHeight; // eax@100 | |
82 unsigned int v74; // ecx@100 | |
83 int v78; // [sp-14h] [bp-10Ch]@14 | |
84 ItemGen *v79; // [sp-10h] [bp-108h]@12 | |
85 int v80; // [sp-10h] [bp-108h]@14 | |
86 void *v81; // [sp-Ch] [bp-104h]@12 | |
87 unsigned __int16 v82; // [sp-Ch] [bp-104h]@14 | |
88 int v83; // [sp-8h] [bp-100h]@11 | |
89 char *v84; // [sp-8h] [bp-100h]@14 | |
90 __int64 *v85; // [sp-4h] [bp-FCh]@11 | |
91 unsigned int v86; // [sp-4h] [bp-FCh]@14 | |
92 POINT v87; // [sp+Ch] [bp-ECh]@8 | |
93 POINT v88; // [sp+14h] [bp-E4h]@18 | |
94 POINT v89; // [sp+1Ch] [bp-DCh]@89 | |
95 POINT v90; // [sp+24h] [bp-D4h]@19 | |
96 POINT v91; // [sp+2Ch] [bp-CCh]@89 | |
97 POINT v92; // [sp+34h] [bp-C4h]@9 | |
98 POINT v93; // [sp+3Ch] [bp-BCh]@33 | |
99 POINT v94; // [sp+44h] [bp-B4h]@18 | |
100 POINT v95; // [sp+4Ch] [bp-ACh]@32 | |
101 POINT v96; // [sp+54h] [bp-A4h]@18 | |
102 POINT v97; // [sp+5Ch] [bp-9Ch]@32 | |
103 POINT a2; // [sp+64h] [bp-94h]@8 | |
104 POINT v99; // [sp+6Ch] [bp-8Ch]@32 | |
105 POINT v100; // [sp+74h] [bp-84h]@8 | |
106 GUIWindow dialog_window; // [sp+7Ch] [bp-7Ch]@1 | 29 GUIWindow dialog_window; // [sp+7Ch] [bp-7Ch]@1 |
107 char *Str; // [sp+D0h] [bp-28h]@55 | |
108 __int32 v103; // [sp+D4h] [bp-24h]@25 | 30 __int32 v103; // [sp+D4h] [bp-24h]@25 |
109 int pColorYellow; // [sp+D8h] [bp-20h]@1 | 31 int pPrice; // [sp+ECh] [bp-Ch]@26 |
110 int pColorWhite; // [sp+DCh] [bp-1Ch]@1 | 32 unsigned int v109; |
111 POINT v106; // [sp+E0h] [bp-18h]@8 | |
112 Player *pPlayer; // [sp+E8h] [bp-10h]@1 | |
113 int pItemNum; // [sp+ECh] [bp-Ch]@26 | |
114 const char **v109; // [sp+F0h] [bp-8h]@26 | |
115 unsigned __int8 v110; // [sp+F7h] [bp-1h]@16 | |
116 int pNumString; | 33 int pNumString; |
34 int item_X; | |
117 | 35 |
118 pPlayer = pPlayers[uActiveCharacter]; | |
119 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window)); | 36 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window)); |
120 dialog_window.uFrameX = 483; | 37 dialog_window.uFrameX = 483; |
121 dialog_window.uFrameWidth = 148; | 38 dialog_window.uFrameWidth = 148; |
122 dialog_window.uFrameZ = 334; | 39 dialog_window.uFrameZ = 334; |
123 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu); | |
124 pColorYellow = TargetColor(0xE1u, 0xCDu, 0x23u); | |
125 | 40 |
126 switch(dialog_menu_id) | 41 switch(dialog_menu_id) |
127 { | 42 { |
128 case HOUSE_DIALOGUE_MAIN: | 43 case HOUSE_DIALOGUE_MAIN: |
129 { | 44 { |
130 pNumActiveItem = HouseUI_CheckIfPlayerCanInteract(); | 45 if ( HouseUI_CheckIfPlayerCanInteract() ) |
131 if ( pNumActiveItem ) | |
132 { | 46 { |
133 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; | 47 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; |
134 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; | 48 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; |
135 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; | 49 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; |
136 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; | 50 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; |
137 all_text_height = 0; | 51 all_text_height = 0; |
138 for (int i = 0; i < 4; ++i)//while ( (signed int)v15 < (signed int)&unk_F8B1C8 ); | 52 for ( int i = 0; i < 4; ++i ) |
139 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | 53 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
140 v103 = (174 - all_text_height) / 4; | 54 v103 = (174 - all_text_height) / 4; |
141 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem; | |
142 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; |
143 v20 = -pDialogueWindow->pNumPresenceButton < 0; | 56 pNumString = 0; |
144 if ( v20 ^ (pNumActiveItem > pNumActiveItem + pDialogueWindow->pNumPresenceButton )) | 57 for ( uint i = pDialogueWindow->pStartingPosActiveItem; i < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++i ) |
145 { | 58 { |
146 pItemNum = 2; | 59 pButton = pDialogueWindow->GetControl(i); |
147 pNumString = 0; | 60 pButton->uY = v103 + v19; |
148 do | 61 pButton->uHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0); |
149 { | 62 v19 = pButton->uY + pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0) - 1; |
150 pButton = pDialogueWindow->GetControl(pItemNum); | 63 pButton->uW = v19; |
151 pButton->uY = v103 + v19; | 64 pColorText = TargetColor(0xE1u, 0xCDu, 0x23u); |
152 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0); | 65 if ( pDialogueWindow->pCurrentPosActiveItem != i ) |
153 pButton->uHeight = pTextHeight; | 66 pColorText = TargetColor(0xFFu, 0xFFu, 0xFFu); |
154 v19 = pButton->uY + pTextHeight - 1; | 67 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3); |
155 pButton->uW = v19; | 68 ++pNumString; |
156 pColorText = pColorYellow; | |
157 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum ) | |
158 pColorText = pColorWhite; | |
159 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3); | |
160 ++pItemNum; | |
161 ++pNumString; | |
162 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; | |
163 } | |
164 while ( pItemNum < pNumActiveItem ); | |
165 } | 69 } |
166 } | 70 } |
167 break; | 71 break; |
168 } | 72 } |
169 | |
170 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD: | 73 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD: |
171 { | 74 { |
172 pRenderer->DrawTextureIndexed(8, 8, ShopTexture); | 75 pRenderer->DrawTextureIndexed(8, 8, ShopTexture); |
173 v48 = 0; | 76 item_X = 0; |
174 pItemNum = 0; | 77 for ( uint i = 0; i < 6; ++i ) |
175 v109 = 0; | 78 { |
176 do | 79 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID) |
177 { | 80 { |
178 // if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)window_SpeakInHouse->ptr_1C]] ) | 81 pRenderer->DrawTextureTransparent((60 - ((signed int)ItemsInShopTexture[i]->uTextureWidth / 2)) + item_X, weapons_Ypos[i] + 30, ItemsInShopTexture[i]); |
179 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(int)v48].uItemID) | 82 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[(60 - ((signed int)ItemsInShopTexture[i]->uTextureWidth / 2)) + item_X + 640 * (weapons_Ypos[i] + 30)], ItemsInShopTexture[i], i + 1); |
180 { | 83 } |
181 v49 = word_F8B158[(signed int)v48]; | 84 item_X += 70; |
182 v50 = ItemsInShopTexture[(signed int)v48]; | 85 } |
183 v49 += 30; | 86 if ( HouseUI_CheckIfPlayerCanInteract() ) |
184 v51 = 60 - ((signed int)v50->uTextureWidth >> 1); | 87 { |
185 pRenderer->DrawTextureTransparent(v51 + pItemNum, v49, v50); | 88 uint item_num = 0; |
186 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v51 + pItemNum + 640 * v49], ItemsInShopTexture[(signed int)v109], (int)((char *)v109 + 1)); | 89 for ( uint i = 0; i < 6; ++i ) |
187 v48 = v109; | 90 { |
188 } | 91 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID) |
189 pItemNum += 70; | 92 ++item_num; |
190 v48 = (const char **)((char *)v48 + 1); | 93 } |
191 v109 = v48; | 94 if ( GetAsyncKeyState(17) && pPlayers[uActiveCharacter]->CanSteal() ) |
192 } | 95 pText = pGlobalTXT_LocalizationStrings[185];//Украсть предмет |
193 while ( (signed int)v48 < 6 ); | |
194 pNumActiveItem = HouseUI_CheckIfPlayerCanInteract(); | |
195 if ( pNumActiveItem ) | |
196 { | |
197 v55 = 0; | |
198 v106.x = 0; | |
199 v106.x = 0; | |
200 do | |
201 { | |
202 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID)//9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) | |
203 ++v106.x; | |
204 ++v55; | |
205 } | |
206 while ( v55 < 6 ); | |
207 v56 = GetAsyncKeyState(17); | |
208 v57 = pPlayer->CanSteal(); | |
209 Str = (char *)v57; | |
210 if ( v56 && v57 ) | |
211 { | |
212 v58 = pGlobalTXT_LocalizationStrings[185]; | |
213 } | |
214 else | 96 else |
215 { | 97 { |
216 v58 = pGlobalTXT_LocalizationStrings[195]; | 98 pText = pGlobalTXT_LocalizationStrings[195];//Выберите предмет для покупки |
217 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) | 99 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) |
218 v58 = pGlobalTXT_LocalizationStrings[196]; | 100 pText = pGlobalTXT_LocalizationStrings[196];//Выберите особый предмет для покупки |
219 } | 101 } |
220 DrawTextAtStatusBar(v58, 0); | 102 DrawTextAtStatusBar(pText, 0); |
221 if ( v106.x ) | 103 if ( item_num ) |
222 { | 104 { |
223 v59 = pMouse->GetCursorPos(&v91); | 105 pMouse->GetCursorPos(&mouse); |
224 pNumActiveItem = v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y]; | 106 if ( pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF ) |
225 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF ) | 107 { |
226 { | 108 item = &pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; |
227 v60 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1; | 109 if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal() ) |
228 v106.x = v60; | |
229 v61 = (int)window_SpeakInHouse->ptr_1C;//maybe ptr_1C - BuildID_2Events | |
230 // v62 = 9 * (v60 + 12 * v61); | |
231 pItemInShop = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60]; | |
232 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) | |
233 pItemInShop = &pParty->SpecialItemsInShops[(int)v61][v60]; | |
234 if ( !v56 || !Str ) | |
235 { | 110 { |
236 v7 = BuildDialogueString((char *)pMerchantsBuyPhrases[pPlayer->SelectPhrasesTransaction(pItemInShop, BuildingType_WeaponShop, v61, 2)], | 111 pText = BuildDialogueString((char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 2)], |
237 uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0); | 112 uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); |
238 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0); | 113 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); |
239 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3); | |
240 } | 114 } |
241 else | 115 else |
242 { | 116 { |
243 v7 = BuildDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0); | 117 pText = BuildDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); |
244 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0); | 118 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); |
245 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3); | |
246 } | 119 } |
247 } | 120 } |
248 } | 121 } |
249 else | 122 else |
250 { | |
251 dialog_window.DrawCurrentTime( pParty->field_3C.Shops_next_generation_time[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);//Приходите через 7 дней | 123 dialog_window.DrawCurrentTime( pParty->field_3C.Shops_next_generation_time[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed);//Приходите через 7 дней |
252 pNumActiveItem = 0; //added | 124 } |
253 } | 125 break; |
126 } | |
127 | |
128 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL: | |
129 { | |
130 pRenderer->DrawTextureIndexed(8, 8, ShopTexture); | |
131 item_X = 0; | |
132 for ( uint i = 0; i < 6; ++i ) | |
133 { | |
134 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID) | |
135 { | |
136 pRenderer->DrawTextureTransparent((60 - ((signed int)ItemsInShopTexture[i]->uTextureWidth / 2)) + item_X, weapons_Ypos[i] + 30, ItemsInShopTexture[i]); | |
137 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[(60 - ((signed int)ItemsInShopTexture[i]->uTextureWidth / 2)) + item_X + 640 * (weapons_Ypos[i] + 30)], ItemsInShopTexture[i], i + 1); | |
138 } | |
139 item_X += 70; | |
140 } | |
141 if ( HouseUI_CheckIfPlayerCanInteract() ) | |
142 { | |
143 uint item_num = 0; | |
144 for ( uint i = 0; i < 6; ++i ) | |
145 { | |
146 if ( pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID ) | |
147 ++item_num; | |
148 } | |
149 if ( GetAsyncKeyState(17) && pPlayers[uActiveCharacter]->CanSteal() ) | |
150 pText = pGlobalTXT_LocalizationStrings[185]; | |
151 else | |
152 { | |
153 pText = pGlobalTXT_LocalizationStrings[195]; | |
154 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) | |
155 pText = pGlobalTXT_LocalizationStrings[196]; | |
156 } | |
157 DrawTextAtStatusBar(pText, 0); | |
158 if ( item_num ) | |
159 { | |
160 pMouse->GetCursorPos(&mouse); | |
161 if ( pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF ) | |
162 { | |
163 item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; | |
164 if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal() ) | |
165 { | |
166 pText = BuildDialogueString((char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 2)], | |
167 uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); | |
168 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); | |
169 } | |
170 else | |
171 { | |
172 pText = BuildDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); | |
173 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); | |
174 } | |
175 } | |
176 } | |
177 else | |
178 dialog_window.DrawCurrentTime( pParty->field_3C.Shops_next_generation_time[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); | |
254 } | 179 } |
255 break; | 180 break; |
256 } | 181 } |
257 | 182 |
258 case HOUSE_DIALOGUE_SHOP_SELL: | 183 case HOUSE_DIALOGUE_SHOP_SELL: |
260 draw_leather(); | 185 draw_leather(); |
261 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 186 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
262 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0); | 187 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0); |
263 if ( !HouseUI_CheckIfPlayerCanInteract() ) | 188 if ( !HouseUI_CheckIfPlayerCanInteract() ) |
264 return; | 189 return; |
265 if((v11 = pMouse->GetCursorPos(&v96)->x - 14, v106.x = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v88)->y - 17) >> 5), | 190 pMouse->GetCursorPos(&mouse); |
266 pMouse->GetCursorPos(&v94)->x <= 13) || pMouse->GetCursorPos(&v90)->x >= 462 | 191 v109 = ((mouse.x + 14) >> 5) + 14 * ((mouse.y - 17) >> 5); |
267 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) ) | 192 if( mouse.x <= 13 || mouse.x >= 462 ) |
268 return; | 193 return; |
269 v79 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1]; | 194 pItemID = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v109); |
270 v13 = pPlayer->SelectPhrasesTransaction(v79, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 3); | 195 if ( !pItemID ) |
271 v7 = BuildDialogueString((char *)pMerchantsSellPhrases[v13], uActiveCharacter - 1, v79, (char *)window_SpeakInHouse->ptr_1C, 3, 0); | 196 return; |
272 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0); | 197 item = &pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1]; |
273 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3); | 198 phrases_id = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 3); |
199 pText = BuildDialogueString((char *)pMerchantsSellPhrases[phrases_id], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 3, 0); | |
200 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); | |
274 break; | 201 break; |
275 } | 202 } |
276 | |
277 case HOUSE_DIALOGUE_SHOP_IDENTIFY: | 203 case HOUSE_DIALOGUE_SHOP_IDENTIFY: |
278 { | 204 { |
279 draw_leather(); | 205 draw_leather(); |
280 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 206 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
281 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); | 207 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0); |
282 if ( !HouseUI_CheckIfPlayerCanInteract() ) | 208 if ( !HouseUI_CheckIfPlayerCanInteract() ) |
283 return; | 209 return; |
284 if((v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5), | 210 pMouse->GetCursorPos(&mouse); |
285 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462 | 211 v109 = ((mouse.x - 14) >> 5) + 14 * ((mouse.y - 17) >> 5); |
286 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) ) | 212 if( mouse.x <= 13 || mouse.x >= 462 ) |
287 return; | 213 return; |
288 v4 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1]; | 214 pItemID = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v109); |
289 if (!v4->IsIdentified()) | 215 if ( !pItemID ) |
290 { | 216 return; |
291 v10 = pPlayer->SelectPhrasesTransaction(v4, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 4); | 217 item = &pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1]; |
292 v7 = BuildDialogueString((char *)pMerchantsIdentifyPhrases[v10], uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0); | 218 if (!item->IsIdentified()) |
293 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0); | 219 { |
294 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3); | 220 phrases_id = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 4); |
221 pText = BuildDialogueString((char *)pMerchantsIdentifyPhrases[phrases_id], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); | |
222 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); | |
295 } | 223 } |
296 else | 224 else |
297 { | 225 { |
298 v7 = BuildDialogueString("%24", uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0); | 226 pText = BuildDialogueString("%24", uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); |
299 pTextHeight = pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0); | 227 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); |
300 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v7, 3); | |
301 } | 228 } |
302 break; | 229 break; |
303 } | 230 } |
304 | 231 |
305 case HOUSE_DIALOGUE_SHOP_REPAIR: | 232 case HOUSE_DIALOGUE_SHOP_REPAIR: |
306 { | 233 { |
307 draw_leather(); | 234 draw_leather(); |
308 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 235 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
309 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0); | 236 DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0); |
310 if ( !HouseUI_CheckIfPlayerCanInteract()) | 237 if ( !HouseUI_CheckIfPlayerCanInteract()) |
311 return; | 238 return; |
312 if( (v2 = pMouse->GetCursorPos(&a2)->x - 14, v106.x = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v87)->y - 17) >> 5), | 239 pMouse->GetCursorPos(&mouse); |
313 pMouse->GetCursorPos(&v100)->x <= 13) || pMouse->GetCursorPos(&v92)->x >= 462 | 240 v109 = ((mouse.x - 14) >> 5) + 14 * (mouse.y - 17) >> 5; |
314 || (pNumActiveItem = pPlayer->GetItemIDAtInventoryIndex((int *)&v106.x), !pNumActiveItem) | 241 if( ( mouse.x <= 13) || mouse.x >= 462 ) |
315 || (!(pPlayer->pOwnItems[pNumActiveItem-1].uAttributes& 2)) ) | 242 return; |
316 return; | 243 pItemID = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v109); |
317 v4 = (ItemGen *)&pPlayer->pInventoryItemList[pNumActiveItem - 1]; | 244 if ( !pItemID || (!(pPlayers[uActiveCharacter]->pOwnItems[pItemID - 1].uAttributes & 2)) ) |
318 v10 = pPlayer->SelectPhrasesTransaction(v4, BuildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 5); | 245 return; |
319 v7 = BuildDialogueString((char *)pMerchantsRepairPhrases[v10], uActiveCharacter - 1, v4, (char *)window_SpeakInHouse->ptr_1C, 5, 0); | 246 item = &pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1]; |
320 pTextHeight = (174 - pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0)) / 2 + 138; | 247 phrases_id = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 5); |
321 dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorWhite, v7, 3); | 248 pText = BuildDialogueString((char *)pMerchantsRepairPhrases[phrases_id], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0); |
249 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); | |
322 return; | 250 return; |
323 } | 251 } |
324 break; | 252 break; |
325 | 253 |
326 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT: | 254 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT: |
332 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];//repair | 260 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];//repair |
333 all_text_height = 0; | 261 all_text_height = 0; |
334 for ( int i = 0; i < 3; ++i ) | 262 for ( int i = 0; i < 3; ++i ) |
335 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | 263 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
336 v103 = (174 - all_text_height) / 3; | 264 v103 = (174 - all_text_height) / 3; |
337 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem; | 265 v19 = (3 * (58 - (signed int)v103) - all_text_height) / 2 - ((174 - all_text_height) / 3) / 2 + 138; |
338 v70 = (3 * (58 - (signed int)v103) - all_text_height) / 2 - ((174 - all_text_height) / 3) / 2 + 138; | 266 pNumString = 0; |
339 v20 = -pDialogueWindow->pNumPresenceButton < 0; | 267 for ( uint i = pDialogueWindow->pStartingPosActiveItem; i < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++i ) |
340 if ( v20 ^ (pNumActiveItem > pNumActiveItem + pDialogueWindow->pNumPresenceButton )) | 268 { |
341 { | 269 pButton = pDialogueWindow->GetControl(i); |
342 pItemNum = 2; | 270 pButton->uY = v103 + v19; |
343 pNumString = 0; | 271 pButton->uHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0); |
344 do | 272 v19 = pButton->uY + pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0) - 1; |
345 { | 273 pButton->uW = v19; |
346 pButton = pDialogueWindow->GetControl(pItemNum); | 274 pColorText = TargetColor(0xE1u, 0xCDu, 0x23u); |
347 pButton->uY = v103 + v70; | 275 if ( pDialogueWindow->pCurrentPosActiveItem != i ) |
348 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0); | 276 pColorText = TargetColor(0xFFu, 0xFFu, 0xFFu); |
349 pButton->uHeight = pTextHeight; | 277 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3); |
350 v70 = pButton->uY + pTextHeight - 1; | 278 ++pNumString; |
351 pButton->uW = v70; | 279 } |
352 pColorText = pColorYellow; | |
353 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum ) | |
354 pColorText = pColorWhite; | |
355 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3); | |
356 ++pItemNum; | |
357 ++pNumString; | |
358 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; | |
359 } | |
360 while ( pItemNum < pNumActiveItem ); | |
361 } | |
362 break; | |
363 } | |
364 | |
365 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL: | |
366 { | |
367 pRenderer->DrawTextureIndexed(8, 8, ShopTexture); | |
368 v109 = 0; | |
369 pItemNum = 0; | |
370 do | |
371 { | |
372 // if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)window_SpeakInHouse->ptr_1C] + 724] ) | |
373 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)v109].uItemID) | |
374 { | |
375 v52 = word_F8B158[(signed int)v109] + 30; | |
376 v53 = ItemsInShopTexture[(signed int)v109]; | |
377 v54 = 60 - ((signed int)v53->uTextureWidth >> 1); | |
378 pRenderer->DrawTextureTransparent(v54 + pItemNum, word_F8B158[(signed int)v109] + 30, v53); | |
379 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[v54 + pItemNum + 640 * v52], ItemsInShopTexture[(signed int)v109], (int)((char *)v109 + 1)); | |
380 } | |
381 v109 = (const char **)((char *)v109 + 1); | |
382 pItemNum += 70; | |
383 } | |
384 while ( (signed int)v109 < 6 ); | |
385 pNumActiveItem = HouseUI_CheckIfPlayerCanInteract(); | |
386 if ( pNumActiveItem ) | |
387 { | |
388 v55 = 0; | |
389 v106.x = 0; | |
390 do | |
391 { | |
392 // if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) | |
393 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID) | |
394 ++v106.x; | |
395 ++v55; | |
396 } | |
397 while ( v55 < 6 ); | |
398 v56 = GetAsyncKeyState(17); | |
399 v57 = pPlayer->CanSteal(); | |
400 Str = (char *)v57; | |
401 if ( v56 && v57 ) | |
402 { | |
403 v58 = pGlobalTXT_LocalizationStrings[185]; | |
404 } | |
405 else | |
406 { | |
407 v58 = pGlobalTXT_LocalizationStrings[195]; | |
408 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) | |
409 v58 = pGlobalTXT_LocalizationStrings[196]; | |
410 } | |
411 DrawTextAtStatusBar(v58, 0); | |
412 if ( v106.x ) | |
413 { | |
414 v59 = pMouse->GetCursorPos(&v91); | |
415 pNumActiveItem = v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y]; | |
416 if ( pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF ) | |
417 { | |
418 v60 = (pRenderer->pActiveZBuffer[pNumActiveItem] & 0xFFFF) - 1; | |
419 v106.x = v60; | |
420 v61 = (int)window_SpeakInHouse->ptr_1C; | |
421 // v62 = 9 * (v60 + 12 * v61); | |
422 pItemInShop = (ItemGen *)&pParty->StandartItemsInShops[(int)v61][v60]; | |
423 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) | |
424 pItemInShop = &pParty->SpecialItemsInShops[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724]; | |
425 if ( !v56 || !Str ) | |
426 { | |
427 v7 = BuildDialogueString((char *)pMerchantsBuyPhrases[pPlayer->SelectPhrasesTransaction(pItemInShop, BuildingType_WeaponShop, v61, 2)], | |
428 uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0); | |
429 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0)) / 2 + 138, pColorWhite, v7, 3); | |
430 } | |
431 else | |
432 { | |
433 v7 = BuildDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, pItemInShop, (char *)window_SpeakInHouse->ptr_1C, 2, 0); | |
434 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(v7, &dialog_window, 0, 0)) / 2 + 138, pColorWhite, v7, 3); | |
435 } | |
436 } | |
437 } | |
438 else | |
439 { | |
440 dialog_window.DrawCurrentTime( pParty->field_3C.Shops_next_generation_time[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); | |
441 pNumActiveItem = 0; //added | |
442 } | |
443 } | |
444 break; | 280 break; |
445 } | 281 } |
446 | 282 |
447 case HOUSE_DIALOGUE_LEARN_SKILLS: | 283 case HOUSE_DIALOGUE_LEARN_SKILLS: |
448 { | 284 { |
449 if (!HouseUI_CheckIfPlayerCanInteract()) | 285 if (!HouseUI_CheckIfPlayerCanInteract()) |
450 return; | 286 return; |
451 v0 = 0; | 287 uint item_num = 0; |
452 all_text_height = 0; | 288 all_text_height = 0; |
453 //v32 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v31] * 500.0); | |
454 v32 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); | 289 v32 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); |
455 pItemNum = v32 * (100 - pPlayer->GetMerchant()) / 100; | 290 pPrice = v32 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100; |
456 if ( pItemNum < v32 / 3 ) | 291 if ( pPrice < v32 / 3 ) |
457 pItemNum = v32 / 3; | 292 pPrice = v32 / 3; |
458 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem; | 293 for ( uint i = pDialogueWindow->pStartingPosActiveItem; |
459 if ( pNumActiveItem >= pNumActiveItem + pDialogueWindow->pNumPresenceButton ) | 294 i < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++i ) |
460 { | 295 { |
461 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]); | 296 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][pDialogueWindow->GetControl(i)->msg_param - 36] |
462 strcat(pTmpBuf.data(), "\n \n"); | 297 && !pPlayers[uActiveCharacter]->pActiveSkills[pDialogueWindow->GetControl(i)->msg_param - 36] ) |
463 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]); | 298 { |
464 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0); | 299 all_text_height += pFontArrus->CalcTextHeight(pSkillNames[pDialogueWindow->GetControl(i)->msg_param - 36], &dialog_window, 0, 0); |
465 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorYellow, pTmpBuf.data(), 3); | 300 item_num++; |
466 return; | 301 } |
467 } | 302 } |
468 do | 303 if ( item_num ) |
469 { | 304 { |
470 v35 = pDialogueWindow->GetControl(pNumActiveItem)->msg_param - 36; | 305 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pPrice);//Стоимость навыка: %lu |
471 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v35] && !pPlayer->pActiveSkills[v35] ) | 306 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3); |
472 { | 307 v103 = (149 - all_text_height) / item_num; |
473 all_text_height += pFontArrus->CalcTextHeight(pSkillNames[v35], &dialog_window, 0, 0); | 308 if ( (149 - all_text_height) / item_num > 32 ) |
474 v0++; | 309 v103 = 32; |
475 } | 310 v19 = (149 - item_num * v103 - all_text_height) / 2 - v103 / 2 + 162; |
476 ++pNumActiveItem; | 311 for ( uint i = pDialogueWindow->pStartingPosActiveItem; |
477 } | 312 i < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++i ) |
478 while ( pNumActiveItem < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); | 313 { |
479 if ( !v0 ) | 314 pButton = pDialogueWindow->GetControl(i); |
480 { | 315 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][pButton->msg_param - 36] || pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param - 36] ) |
481 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]); | |
482 strcat(pTmpBuf.data(), "\n \n"); | |
483 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]); | |
484 pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0); | |
485 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorYellow, pTmpBuf.data(), 3); | |
486 return; | |
487 } | |
488 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], pItemNum); | |
489 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3); | |
490 v103 = (149 - all_text_height) / v0; | |
491 if ( (149 - all_text_height) / v0 > 32 ) | |
492 v103 = 32; | |
493 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem; | |
494 v37 = (149 - v0 * v103 - all_text_height) / 2 - v103 / 2 + 162; | |
495 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton ) | |
496 { | |
497 pItemNum = 2; | |
498 do | |
499 { | |
500 pButton = pDialogueWindow->GetControl(pItemNum); | |
501 v40 = pButton->msg_param - 36; | |
502 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v40] || pPlayer->pActiveSkills[v40] ) | |
503 { | 316 { |
504 pButton->uW = 0; | 317 pButton->uW = 0; |
505 pButton->uHeight = 0; | 318 pButton->uHeight = 0; |
506 pButton->uY = 0; | 319 pButton->uY = 0; |
507 } | 320 } |
508 else | 321 else |
509 { | 322 { |
510 pButton->uY = v103 + v37; | 323 pButton->uY = v103 + v19; |
511 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v40], &dialog_window, 0, 0); | 324 pButton->uHeight = pFontArrus->CalcTextHeight(pSkillNames[pButton->msg_param - 36], &dialog_window, 0, 0); |
512 pButton->uHeight = pTextHeight; | 325 v19 = pButton->uY + pFontArrus->CalcTextHeight(pSkillNames[pButton->msg_param - 36], &dialog_window, 0, 0) - 1; |
513 v37 = pButton->uY + pTextHeight - 1; | 326 pButton->uW = v19; |
514 pButton->uW = v37; | 327 pColorText = TargetColor(0xE1u, 0xCDu, 0x23u); |
515 pColorText = pColorYellow; | 328 if ( pDialogueWindow->pCurrentPosActiveItem != i ) |
516 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum ) | 329 pColorText = TargetColor(0xFFu, 0xFFu, 0xFFu); |
517 pColorText = pColorWhite; | 330 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[pButton->msg_param - 36], 3); |
518 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[v40], 3); | 331 } |
519 } | 332 } |
520 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; | 333 break; |
521 pItemNum++; | 334 } |
522 } | 335 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]); |
523 while ( pItemNum < pNumActiveItem ); | 336 strcat(pTmpBuf.data(), "\n \n"); |
524 } | 337 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);//Больше ничего не могу предложить. |
525 break; | 338 dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xE1u, 0xCDu, 0x23u), pTmpBuf.data(), 3); |
339 return; | |
526 } | 340 } |
527 default: | 341 default: |
528 { | 342 { |
529 if( dialog_menu_id > HOUSE_DIALOGUE_SHOP_REPAIR) | 343 __debugbreak(); |
530 pNumActiveItem = dialog_menu_id - 96; | |
531 else | |
532 pNumActiveItem = dialog_menu_id - 4; | |
533 break; | 344 break; |
534 } | 345 } |
535 } | 346 } |
536 } | 347 } |
537 | 348 |