comparison UI/UIGuilds.cpp @ 1526:f47eab1a70d8

UIHouses.cpp cleaning(continue)
author Ritor1
date Thu, 05 Sep 2013 18:05:50 +0600
parents 58d15177edd0
children 61458df2cb4f
comparison
equal deleted inserted replaced
1525:863de6ec906b 1526:f47eab1a70d8
38 int v24; // eax@39 38 int v24; // eax@39
39 int v25; // eax@40 39 int v25; // eax@40
40 int v26; // ecx@47 40 int v26; // ecx@47
41 GUIButton *pButton; // eax@49 41 GUIButton *pButton; // eax@49
42 unsigned int v29; // eax@49 42 unsigned int v29; // eax@49
43 char *pText; // eax@52
44 int pTextHeight; // eax@55 43 int pTextHeight; // eax@55
45 unsigned int v32; // ecx@55 44 unsigned int v32; // ecx@55
46 int v33; // eax@55 45 int v33; // eax@55
47 unsigned __int16 pTextColor; // ax@55 46 unsigned __int16 pTextColor; // ax@55
48 int v35; // eax@58 47 int v35; // eax@58
73 int pItemNum; 72 int pItemNum;
74 unsigned int v62; // [sp+2E4h] [bp-8h]@13 73 unsigned int v62; // [sp+2E4h] [bp-8h]@13
75 int pPrice; // [sp+2E8h] [bp-4h]@1 74 int pPrice; // [sp+2E8h] [bp-4h]@1
76 int pNumActivItem; 75 int pNumActivItem;
77 int all_text_height; 76 int all_text_height;
77 int pX;
78 78
79 memcpy(&working_window, window_SpeakInHouse, sizeof(GUIWindow)); 79 memcpy(&working_window, window_SpeakInHouse, sizeof(GUIWindow));
80 working_window.uFrameX = 483; 80 working_window.uFrameX = 483;
81 working_window.uFrameWidth = 148; 81 working_window.uFrameWidth = 148;
82 working_window.uFrameZ = 334; 82 working_window.uFrameZ = 334;
121 return; 121 return;
122 } 122 }
123 pRenderer->DrawTextureIndexed(8, 8, ShopTexture); 123 pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
124 v6 = 0; 124 v6 = 0;
125 v62 = 0; 125 v62 = 0;
126 //pPrice = 32; 126 for ( pX = 32; pX < 452; pX += 70 )//расположение в верхнем ряду
127 for ( pPrice = 32; pPrice < 452; pPrice += 70 ) 127 {
128 { 128 if ( pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v6].uItemID )
129 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v6].uItemID) 129 {
130 { 130 pRenderer->DrawTextureTransparent(pX, 90, ItemsInShopTexture[v6]);
131 pRenderer->DrawTextureTransparent(pPrice, 90, ItemsInShopTexture[v6]);
132 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 230528), ItemsInShopTexture[v6], v6 + 1); 131 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 230528), ItemsInShopTexture[v6], v6 + 1);
133 } 132 }
134 //pPrice += 70;
135 v62 += 280; 133 v62 += 280;
136 ++v6; 134 ++v6;
137 } 135 }
138 //while ( pPrice < 452 );
139 v62 = 1680; 136 v62 = 1680;
140 v7 = 6; 137 v7 = 6;
141 //pPrice = 32; 138 for ( pX = 32; pX < 452; pX += 70 )//расположение в нижнем ряду
142 for ( pPrice = 32; pPrice < 452; pPrice += 70 )
143 { 139 {
144 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v7].uItemID) 140 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v7].uItemID)
145 { 141 {
146 pRenderer->DrawTextureTransparent(pPrice, 250, ItemsInShopTexture[v7]); 142 pRenderer->DrawTextureTransparent(pX, 250, ItemsInShopTexture[v7]);
147 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 638448), ItemsInShopTexture[v7], v7 + 1); 143 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 638448), ItemsInShopTexture[v7], v7 + 1);
148 } 144 }
149 //pPrice += 70;
150 v62 += 280; 145 v62 += 280;
151 ++v7; 146 ++v7;
152 } 147 }
153 //while ( pPrice < 452 );
154 if ( HouseUI_CheckIfPlayerCanInteract() ) 148 if ( HouseUI_CheckIfPlayerCanInteract() )
155 { 149 {
156 v8 = 0; 150 v8 = 0;
157 //v9 = 12;
158 //do
159 for ( v9 = 12; v9; --v9 ) 151 for ( v9 = 12; v9; --v9 )
160 { 152 {
161 if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v9].uItemID ) 153 if ( pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v9].uItemID > 0 )
162 ++v8; 154 ++v8;
163 //--v9; 155 }
164 }
165 //while ( v9 );
166 GetAsyncKeyState(17); 156 GetAsyncKeyState(17);
167 statusbar_string = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy" 157 statusbar_string = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy"
168 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) 158 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
169 statusbar_string = pGlobalTXT_LocalizationStrings[196]; //"Select the Special Item to Buy" 159 statusbar_string = pGlobalTXT_LocalizationStrings[196]; //"Select the Special Item to Buy"
170 DrawTextAtStatusBar(statusbar_string, 0); 160 DrawTextAtStatusBar(statusbar_string, 0);
171 if ( !v8 ) 161 if ( !v8 )
172 { 162 {
173 working_window.DrawCurrentTime(__PAIR__( *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44472], 163 working_window.DrawCurrentTime(pParty->field_3C.field_50[window_SpeakInHouse->par1C] - pParty->uTimePlayed);//"Приходите через 14 дней"
174 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44468]) - pParty->uTimePlayed);
175 return; 164 return;
176 } 165 }
177 v12 = pMouse->GetCursorPos(&v51); 166 v12 = pMouse->GetCursorPos(&v51);
178 result = v12->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v50)->y]; 167 result = v12->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v50)->y];
179 v13 = pRenderer->pActiveZBuffer[result] & 0xFFFF; 168 v13 = pRenderer->pActiveZBuffer[result] & 0xFFFF;
194 } 183 }
195 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)pPlayers[uActiveCharacter]->_achieved_awards_bits, 184 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)pPlayers[uActiveCharacter]->_achieved_awards_bits,
196 guild_mambership_flags[(unsigned int)window_SpeakInHouse->ptr_1C-139]) ) 185 guild_mambership_flags[(unsigned int)window_SpeakInHouse->ptr_1C-139]) )
197 { //you must me member 186 { //you must me member
198 v38 = pFontArrus->CalcTextHeight(pNPCTopics[121].pText, &working_window, 0, 0); 187 v38 = pFontArrus->CalcTextHeight(pNPCTopics[121].pText, &working_window, 0, 0);
199 working_window.DrawTitleText(pFontArrus, 0, (212 - v38) / 2 + 101, pColorYellow, pNPCTopics[121].pText, 3u); 188 working_window.DrawTitleText(pFontArrus, 0, (212 - v38) / 2 + 101, pColorYellow, pNPCTopics[121].pText, 3);
200 pDialogueWindow->pNumPresenceButton = 0; 189 pDialogueWindow->pNumPresenceButton = 0;
201 return; 190 return;
202 } 191 }
203 if ( !HouseUI_CheckIfPlayerCanInteract() ) 192 if ( !HouseUI_CheckIfPlayerCanInteract() )
204 return; 193 return;
264 { 253 {
265 pButton = pDialogueWindow->GetControl(pItemNum); 254 pButton = pDialogueWindow->GetControl(pItemNum);
266 v29 = pButton->msg_param; 255 v29 = pButton->msg_param;
267 if ( v29 == 18 ) 256 if ( v29 == 18 )
268 { 257 {
269 pText = pGlobalTXT_LocalizationStrings[400]; //"Buy Spells"
270 pButton->uY = v58 + v26; 258 pButton->uY = v58 + v26;
271 pTextHeight = pFontArrus->CalcTextHeight(pText, &working_window, 0, 0); 259 pTextHeight = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[400], &working_window, 0, 0);
272 v32 = pButton->uY; 260 v32 = pButton->uY;
273 pButton->uHeight = pTextHeight; 261 pButton->uHeight = pTextHeight;
274 v33 = v32 + pTextHeight - 1; 262 v33 = v32 + pTextHeight - 1;
275 pButton->uW = v33; 263 pButton->uW = v33;
276 v26 = v33; 264 v26 = v33;
277 pTextColor = pColorYellow; 265 pTextColor = pColorYellow;
278 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum ) 266 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
279 pTextColor = pColorWhite; 267 pTextColor = pColorWhite;
280 working_window.DrawTitleText(pFontArrus, 0, v32, pTextColor, pText, 3); 268 working_window.DrawTitleText(pFontArrus, 0, v32, pTextColor, pGlobalTXT_LocalizationStrings[400], 3);//"Buy Spells"
281 } 269 }
282 else 270 else
283 { 271 {
284 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v29 - 36] 272 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v29 - 36]
285 && !pPlayers[uActiveCharacter]->pActiveSkills[v29 - 36] ) 273 && !pPlayers[uActiveCharacter]->pActiveSkills[v29 - 36] )