Mercurial > mm7
comparison UI/UIPopup.cpp @ 1721:1c072d19e397
Слияние
author | Ritor1 |
---|---|
date | Wed, 25 Sep 2013 09:03:56 +0600 |
parents | 5f2583a4fa7d 0f6cd60ca987 |
children | 29924bbb2a4e |
comparison
equal
deleted
inserted
replaced
1720:5f2583a4fa7d | 1721:1c072d19e397 |
---|---|
133 if ( pMouse->GetCursorPos(&a2)->x <= 320 ) | 133 if ( pMouse->GetCursorPos(&a2)->x <= 320 ) |
134 v2 = pMouse->GetCursorPos(&a2)->x + 30; | 134 v2 = pMouse->GetCursorPos(&a2)->x + 30; |
135 else | 135 else |
136 v2 = pMouse->GetCursorPos(&a2)->x - iteminfo_window.uFrameWidth - 30; | 136 v2 = pMouse->GetCursorPos(&a2)->x - iteminfo_window.uFrameWidth - 30; |
137 iteminfo_window.uFrameX = v2; | 137 iteminfo_window.uFrameX = v2; |
138 v78 = 100 - pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->uTextureWidth; | 138 v78 = 100 - pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->uTextureWidth; |
139 v81 = 144 - pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->uTextureHeight; | 139 v81 = 144 - pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->uTextureHeight; |
140 if ( v78 > 0 ) | 140 if ( v78 > 0 ) |
141 v78 = v78 / 2; | 141 v78 = v78 / 2; |
142 if ( v81 <= 0 ) | 142 if ( v81 <= 0 ) |
143 v81 = 0; | 143 v81 = 0; |
144 else | 144 else |
145 v81 = v81 / 2; | 145 v81 = v81 / 2; |
146 if ( !pItemsTable->pItems[inspect_item->uItemID].uItemID_Rep_St ) | 146 if ( !pItemsTable->pItems[inspect_item->uItemID].uItemID_Rep_St ) |
147 inspect_item->SetIdentified(); | 147 inspect_item->SetIdentified(); |
148 v77 = 0; | 148 v77 = 0; |
149 if (pItemsTable->pItems[inspect_item->uItemID].uEquipType == EQUIP_GOLD) | 149 if (inspect_item->GetItemEquipType() == EQUIP_GOLD) |
150 v77 = inspect_item->uSpecEnchantmentType; | 150 v77 = inspect_item->uSpecEnchantmentType; |
151 if ( uActiveCharacter ) | 151 if ( uActiveCharacter ) |
152 { | 152 { |
153 //try to identify | 153 //try to identify |
154 if (!inspect_item->IsIdentified()) | 154 if (!inspect_item->IsIdentified()) |
195 iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12); | 195 iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12); |
196 iteminfo_window.uFrameWidth -= 24; | 196 iteminfo_window.uFrameWidth -= 24; |
197 iteminfo_window.uFrameHeight -= 12; | 197 iteminfo_window.uFrameHeight -= 12; |
198 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | 198 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; |
199 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | 199 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; |
200 pRenderer->DrawTransparentRedShade(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)); | 200 pRenderer->DrawTransparentRedShade(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)); |
201 if ( inspect_item->IsIdentified()) | 201 if ( inspect_item->IsIdentified()) |
202 pText = (char *)inspect_item->GetIdentifiedName(); | 202 pText = (char *)inspect_item->GetIdentifiedName(); |
203 else | 203 else |
204 pText = pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName; | 204 pText = pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName; |
205 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), pText, 3); | 205 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), pText, 3); |
206 iteminfo_window.DrawTitleText(pFontArrus, 0x64u, ((signed int)iteminfo_window.uFrameHeight >> 1) - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &iteminfo_window, 0, 0) / 2, | 206 iteminfo_window.DrawTitleText(pFontArrus, 0x64u, ((signed int)iteminfo_window.uFrameHeight >> 1) - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &iteminfo_window, 0, 0) / 2, |
207 TargetColor(0xFFu, 0x19u, 0x19u), pGlobalTXT_LocalizationStrings[32], 3); //"Broken Item" | 207 TargetColor(0xFFu, 0x19u, 0x19u), pGlobalTXT_LocalizationStrings[32], 3); //"Broken Item" |
208 pRenderer->ResetTextureClipRect(); | 208 pRenderer->ResetTextureClipRect(); |
209 if ( !areWeLoadingTexture ) | 209 if ( !areWeLoadingTexture ) |
210 { | 210 { |
211 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release(); | 211 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release(); |
212 pIcons_LOD->SyncLoadedFilesCount(); | 212 pIcons_LOD->SyncLoadedFilesCount(); |
213 } | 213 } |
214 return; | 214 return; |
215 } | 215 } |
216 if (!inspect_item->IsIdentified()) | 216 if (!inspect_item->IsIdentified()) |
220 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12); | 220 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12); |
221 iteminfo_window.uFrameWidth -= 24; | 221 iteminfo_window.uFrameWidth -= 24; |
222 iteminfo_window.uFrameHeight -= 12; | 222 iteminfo_window.uFrameHeight -= 12; |
223 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | 223 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; |
224 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | 224 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; |
225 pRenderer->DrawTextureTransparent(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)); | 225 pRenderer->DrawTextureTransparent(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)); |
226 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName, 3); | 226 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName, 3); |
227 iteminfo_window.DrawTitleText(pFontArrus, 0x64u, ((signed int)iteminfo_window.uFrameHeight >> 1) - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &iteminfo_window, 0, 0) / 2, | 227 iteminfo_window.DrawTitleText(pFontArrus, 0x64u, ((signed int)iteminfo_window.uFrameHeight >> 1) - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &iteminfo_window, 0, 0) / 2, |
228 TargetColor(0xFFu, 0x19u, 0x19u), pGlobalTXT_LocalizationStrings[232], 3);//"Not Identified" | 228 TargetColor(0xFFu, 0x19u, 0x19u), pGlobalTXT_LocalizationStrings[232], 3);//"Not Identified" |
229 pRenderer->ResetTextureClipRect(); | 229 pRenderer->ResetTextureClipRect(); |
230 if ( !areWeLoadingTexture ) | 230 if ( !areWeLoadingTexture ) |
231 { | 231 { |
232 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release(); | 232 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release(); |
233 pIcons_LOD->SyncLoadedFilesCount(); | 233 pIcons_LOD->SyncLoadedFilesCount(); |
234 } | 234 } |
235 return; | 235 return; |
236 } | 236 } |
237 sprintfex(out_text, pGlobalTXT_LocalizationStrings[463], pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName); //"Type: %s" | 237 sprintfex(out_text, pGlobalTXT_LocalizationStrings[463], pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName); //"Type: %s" |
238 out_text[100] = 0; | 238 out_text[100] = 0; |
239 out_text[200] = 0; | 239 out_text[200] = 0; |
240 switch (pItemsTable->pItems[inspect_item->uItemID].uEquipType) | 240 switch (inspect_item->GetItemEquipType()) |
241 { | 241 { |
242 case EQUIP_OFF_HAND: | 242 case EQUIP_OFF_HAND: |
243 case EQUIP_MAIN_HAND: | 243 case EQUIP_MAIN_HAND: |
244 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[LOCSTR_ATTACK], | 244 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[LOCSTR_ATTACK], |
245 (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod, pGlobalTXT_LocalizationStrings[53], | 245 (int)inspect_item->GetDamageMod(), pGlobalTXT_LocalizationStrings[53], |
246 (int)pItemsTable->pItems[inspect_item->uItemID].uDamageDice, (int)pItemsTable->pItems[inspect_item->uItemID].uDamageRoll); //"Damage" | 246 (int)inspect_item->GetDamageDice(), (int)inspect_item->GetDamageRoll()); //"Damage" |
247 if (pItemsTable->pItems[inspect_item->uItemID].uDamageMod) | 247 if (inspect_item->GetDamageMod()) |
248 { | 248 { |
249 char mod[16]; | 249 char mod[16]; |
250 sprintf(mod, "+%d", (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod); | 250 sprintf(mod, "+%d", (int)inspect_item->GetDamageMod()); |
251 strcat(out_text + 100, mod); | 251 strcat(out_text + 100, mod); |
252 } | 252 } |
253 break; | 253 break; |
254 | 254 |
255 case EQUIP_BOW: | 255 case EQUIP_BOW: |
256 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], //"Shoot" | 256 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], //"Shoot" |
257 (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod, pGlobalTXT_LocalizationStrings[53], //"Damage" | 257 (int)inspect_item->GetDamageMod(), pGlobalTXT_LocalizationStrings[53], //"Damage" |
258 (int)pItemsTable->pItems[inspect_item->uItemID].uDamageDice, (int)pItemsTable->pItems[inspect_item->uItemID].uDamageRoll); | 258 (int)inspect_item->GetDamageDice(), (int)inspect_item->GetDamageRoll()); |
259 if (pItemsTable->pItems[inspect_item->uItemID].uDamageMod) | 259 if (inspect_item->GetDamageMod()) |
260 { | 260 { |
261 char mod[16]; | 261 char mod[16]; |
262 sprintf(mod, "+%d", (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod); | 262 sprintf(mod, "+%d", (int)inspect_item->GetDamageMod()); |
263 strcat(out_text + 100, mod); | 263 strcat(out_text + 100, mod); |
264 } | 264 } |
265 break; | 265 break; |
266 | 266 |
267 case EQUIP_ARMOUR: | 267 case EQUIP_ARMOUR: |
271 case EQUIP_CLOAK: | 271 case EQUIP_CLOAK: |
272 case EQUIP_GAUNTLETS: | 272 case EQUIP_GAUNTLETS: |
273 case EQUIP_BOOTS: | 273 case EQUIP_BOOTS: |
274 case EQUIP_RING: | 274 case EQUIP_RING: |
275 case EQUIP_AMULET: | 275 case EQUIP_AMULET: |
276 if (pItemsTable->pItems[inspect_item->uItemID].uDamageDice) //"Armor" | 276 if (inspect_item->GetDamageDice()) //"Armor" |
277 sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], | 277 sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], |
278 pItemsTable->pItems[inspect_item->uItemID].uDamageDice + pItemsTable->pItems[inspect_item->uItemID].uDamageMod); | 278 inspect_item->GetDamageDice() + inspect_item->GetDamageMod()); |
279 break; | 279 break; |
280 } | 280 } |
281 | 281 |
282 if ( !v77 ) | 282 if ( !v77 ) |
283 { | 283 { |
284 if (pItemsTable->pItems[inspect_item->uItemID].uEquipType ==EQUIP_POTION) //this is CORRECT! do not move to switch! | 284 if (inspect_item->GetItemEquipType() ==EQUIP_POTION) //this is CORRECT! do not move to switch! |
285 { | 285 { |
286 if ( inspect_item->uEnchantmentType ) | 286 if ( inspect_item->uEnchantmentType ) |
287 sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEnchantmentType); //"Power" | 287 sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEnchantmentType); //"Power" |
288 } | 288 } |
289 else if (pItemsTable->pItems[inspect_item->uItemID].uEquipType == EQUIP_REAGENT) | 289 else if (inspect_item->GetItemEquipType() == EQUIP_REAGENT) |
290 sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power" | 290 sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], inspect_item->GetDamageDice()); //"Power" |
291 else if ( inspect_item->uEnchantmentType ) | 291 else if ( inspect_item->uEnchantmentType ) |
292 sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->m_enchantmentStrength); //"Special" | 292 sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->m_enchantmentStrength); //"Special" |
293 else if ( inspect_item->uSpecEnchantmentType ) | 293 else if ( inspect_item->uSpecEnchantmentType ) |
294 sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pBonusStatement, inspect_item->m_enchantmentStrength); | 294 sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pBonusStatement, inspect_item->m_enchantmentStrength); |
295 else if ( inspect_item->uNumCharges ) | 295 else if ( inspect_item->uNumCharges ) |
307 v84 += 100; | 307 v84 += 100; |
308 } | 308 } |
309 v28 = pItemsTable->pItems[inspect_item->uItemID].pDescription; | 309 v28 = pItemsTable->pItems[inspect_item->uItemID].pDescription; |
310 if ( *v28 ) | 310 if ( *v28 ) |
311 Str += pFontSmallnum->CalcTextHeight(pItemsTable->pItems[inspect_item->uItemID].pDescription, &iteminfo_window, 100, 0); | 311 Str += pFontSmallnum->CalcTextHeight(pItemsTable->pItems[inspect_item->uItemID].pDescription, &iteminfo_window, 100, 0); |
312 iteminfo_window.uFrameHeight = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, | 312 iteminfo_window.uFrameHeight = pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), |
313 TEXTURE_16BIT_PALETTE)->uTextureHeight + v81 + 54; | 313 TEXTURE_16BIT_PALETTE)->uTextureHeight + v81 + 54; |
314 if ( (signed int)Str > (signed int)iteminfo_window.uFrameHeight ) | 314 if ( (signed int)Str > (signed int)iteminfo_window.uFrameHeight ) |
315 iteminfo_window.uFrameHeight = (unsigned int)Str; | 315 iteminfo_window.uFrameHeight = (unsigned int)Str; |
316 if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) | 316 if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) |
317 iteminfo_window.uFrameHeight += LOBYTE(pFontComic->uFontHeight); | 317 iteminfo_window.uFrameHeight += LOBYTE(pFontComic->uFontHeight); |
333 iteminfo_window.uFrameWidth -= 12; | 333 iteminfo_window.uFrameWidth -= 12; |
334 iteminfo_window.uFrameHeight -= 12; | 334 iteminfo_window.uFrameHeight -= 12; |
335 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | 335 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; |
336 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | 336 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; |
337 pRenderer->DrawTextureTransparent(iteminfo_window.uFrameX + v78, | 337 pRenderer->DrawTextureTransparent(iteminfo_window.uFrameX + v78, |
338 iteminfo_window.uFrameY + (signed int)(iteminfo_window.uFrameHeight - pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->uTextureHeight) / 2, | 338 iteminfo_window.uFrameY + (signed int)(iteminfo_window.uFrameHeight - pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->uTextureHeight) / 2, |
339 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)); | 339 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)); |
340 | 340 |
341 v34 = (int)(v85 + 35); | 341 v34 = (int)(v85 + 35); |
342 Str = out_text; | 342 Str = out_text; |
343 for ( uint i = 1; i <= 3; i++ ) | 343 for ( uint i = 1; i <= 3; i++ ) |
344 { | 344 { |
399 if ( !(BYTE1(inspect_item->uAttributes) & 2) ) | 399 if ( !(BYTE1(inspect_item->uAttributes) & 2) ) |
400 { | 400 { |
401 pRenderer->ResetTextureClipRect(); | 401 pRenderer->ResetTextureClipRect(); |
402 if ( !areWeLoadingTexture ) | 402 if ( !areWeLoadingTexture ) |
403 { | 403 { |
404 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release(); | 404 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release(); |
405 pIcons_LOD->SyncLoadedFilesCount(); | 405 pIcons_LOD->SyncLoadedFilesCount(); |
406 } | 406 } |
407 return; | 407 return; |
408 } | 408 } |
409 pText = pGlobalTXT_LocalizationStrings[651]; //"Hardened" | 409 pText = pGlobalTXT_LocalizationStrings[651]; //"Hardened" |
413 iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), inspect_item->uAttributes, pText, 0, 0, 0); | 413 iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), inspect_item->uAttributes, pText, 0, 0, 0); |
414 pRenderer->ResetTextureClipRect(); | 414 pRenderer->ResetTextureClipRect(); |
415 } | 415 } |
416 if ( !areWeLoadingTexture ) | 416 if ( !areWeLoadingTexture ) |
417 { | 417 { |
418 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release(); | 418 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release(); |
419 pIcons_LOD->SyncLoadedFilesCount(); | 419 pIcons_LOD->SyncLoadedFilesCount(); |
420 } | 420 } |
421 return; | 421 return; |
422 } | 422 } |
423 // 4E455C: using guessed type int dword_4E455C; | 423 // 4E455C: using guessed type int dword_4E455C; |