comparison GUI/UI/UIPopup.cpp @ 2567:d569340b05ff

Few constants changed into enum values
author a.parshin
date Thu, 21 May 2015 01:50:59 +0200
parents 30eb6dcac768
children d87bfbd3bb3b
comparison
equal deleted inserted replaced
2566:30eb6dcac768 2567:d569340b05ff
155 v81 = v81 / 2; 155 v81 = v81 / 2;
156 if ( !pItemsTable->pItems[inspect_item->uItemID].uItemID_Rep_St ) 156 if ( !pItemsTable->pItems[inspect_item->uItemID].uItemID_Rep_St )
157 inspect_item->SetIdentified(); 157 inspect_item->SetIdentified();
158 v77 = 0; 158 v77 = 0;
159 if (inspect_item->GetItemEquipType() == EQUIP_GOLD) 159 if (inspect_item->GetItemEquipType() == EQUIP_GOLD)
160 v77 = inspect_item->uSpecEnchantmentType; 160 v77 = inspect_item->special_enchantment;
161 if ( uActiveCharacter ) 161 if ( uActiveCharacter )
162 { 162 {
163 //try to identify 163 //try to identify
164 if (!inspect_item->IsIdentified()) 164 if (!inspect_item->IsIdentified())
165 { 165 {
298 } 298 }
299 else if (inspect_item->GetItemEquipType() == EQUIP_REAGENT) 299 else if (inspect_item->GetItemEquipType() == EQUIP_REAGENT)
300 sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], inspect_item->GetDamageDice()); //"Power" 300 sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], inspect_item->GetDamageDice()); //"Power"
301 else if ( inspect_item->uEnchantmentType ) 301 else if ( inspect_item->uEnchantmentType )
302 sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->m_enchantmentStrength); //"Special" 302 sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->m_enchantmentStrength); //"Special"
303 else if ( inspect_item->uSpecEnchantmentType ) 303 else if ( inspect_item->special_enchantment )
304 sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pBonusStatement); 304 sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], pItemsTable->pSpecialEnchantments[inspect_item->special_enchantment-1].pBonusStatement);
305 else if ( inspect_item->uNumCharges ) 305 else if ( inspect_item->uNumCharges )
306 sprintf(out_text + 200, "%s: %lu", pGlobalTXT_LocalizationStrings[464], inspect_item->uNumCharges); //"Charges" 306 sprintf(out_text + 200, "%s: %lu", pGlobalTXT_LocalizationStrings[464], inspect_item->uNumCharges); //"Charges"
307 } 307 }
308 iteminfo_window.uFrameWidth -= 12; 308 iteminfo_window.uFrameWidth -= 12;
309 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; 309 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1;
321 Str += pFontSmallnum->CalcTextHeight(pItemsTable->pItems[inspect_item->uItemID].pDescription, &iteminfo_window, 100, 0); 321 Str += pFontSmallnum->CalcTextHeight(pItemsTable->pItems[inspect_item->uItemID].pDescription, &iteminfo_window, 100, 0);
322 iteminfo_window.uFrameHeight = pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), 322 iteminfo_window.uFrameHeight = pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(),
323 TEXTURE_16BIT_PALETTE)->uTextureHeight + v81 + 54; 323 TEXTURE_16BIT_PALETTE)->uTextureHeight + v81 + 54;
324 if ( (signed int)Str > (signed int)iteminfo_window.uFrameHeight ) 324 if ( (signed int)Str > (signed int)iteminfo_window.uFrameHeight )
325 iteminfo_window.uFrameHeight = (unsigned int)Str; 325 iteminfo_window.uFrameHeight = (unsigned int)Str;
326 if ( inspect_item->uAttributes & ITEM_TEMP_BONUS && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) 326 if ( inspect_item->uAttributes & ITEM_TEMP_BONUS && (inspect_item->special_enchantment || inspect_item->uEnchantmentType) )
327 iteminfo_window.uFrameHeight += LOBYTE(pFontComic->uFontHeight); 327 iteminfo_window.uFrameHeight += LOBYTE(pFontComic->uFontHeight);
328 v85 = 0; 328 v85 = 0;
329 if ( pFontArrus->uFontHeight ) 329 if ( pFontArrus->uFontHeight )
330 { 330 {
331 iteminfo_window.uFrameWidth -= 24; 331 iteminfo_window.uFrameWidth -= 24;
373 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0); 373 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0);
374 pRenderer->ResetUIClipRect(); 374 pRenderer->ResetUIClipRect();
375 } 375 }
376 else 376 else
377 { 377 {
378 if ( (inspect_item->uAttributes & ITEM_TEMP_BONUS) && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) 378 if ( (inspect_item->uAttributes & ITEM_TEMP_BONUS) && (inspect_item->special_enchantment || inspect_item->uEnchantmentType) )
379 { 379 {
380 init_summoned_item(&v67, inspect_item->uExpireTime - pParty->uTimePlayed); 380 init_summoned_item(&v67, inspect_item->uExpireTime - pParty->uTimePlayed);
381 strcpy(pTmpBuf.data(), "Duration:"); 381 strcpy(pTmpBuf.data(), "Duration:");
382 Str = (char *)(v67.field_18_expire_year - game_starting_year); 382 Str = (char *)(v67.field_18_expire_year - game_starting_year);
383 if (v67.field_18_expire_year != 1168 ) 383 if (v67.field_18_expire_year != 1168 )
1717 if ( item->uItemID < ITEM_POTION_BOTTLE || item->uItemID > ITEM_POTION_REJUVENATION) // all potions 1717 if ( item->uItemID < ITEM_POTION_BOTTLE || item->uItemID > ITEM_POTION_REJUVENATION) // all potions
1718 { 1718 {
1719 if (item->uItemID >= ITEM_BLASTER && item->uItemID <= ITEM_LASER_RIFLE || 1719 if (item->uItemID >= ITEM_BLASTER && item->uItemID <= ITEM_LASER_RIFLE ||
1720 item->uItemID >= ITEM_ARTIFACT_PUCK || 1720 item->uItemID >= ITEM_ARTIFACT_PUCK ||
1721 item->IsBroken() || 1721 item->IsBroken() ||
1722 item->uSpecEnchantmentType || 1722 item->special_enchantment ||
1723 item->uEnchantmentType || 1723 item->uEnchantmentType ||
1724 item->GetItemEquipType() >= EQUIP_ARMOUR) // only melee weapons and bows 1724 item->GetItemEquipType() >= EQUIP_ARMOUR) // only melee weapons and bows
1725 { 1725 {
1726 pMouse->RemoveHoldingItem(); 1726 pMouse->RemoveHoldingItem();
1727 no_rightlick_in_inventory = true; 1727 no_rightlick_in_inventory = true;
1729 } 1729 }
1730 1730
1731 item->UpdateTempBonus(pParty->uTimePlayed); 1731 item->UpdateTempBonus(pParty->uTimePlayed);
1732 if (pParty->pPickedItem.uItemID == ITEM_POTION_SLAYING_POTION) 1732 if (pParty->pPickedItem.uItemID == ITEM_POTION_SLAYING_POTION)
1733 { 1733 {
1734 item->uSpecEnchantmentType = 40; // of Slaying 1734 item->special_enchantment = ITEM_ENCHANTMENT_40; // of Slaying
1735 v31 = (double)(1800 * pParty->pPickedItem.uEnchantmentType * 128); 1735 v31 = (double)(1800 * pParty->pPickedItem.uEnchantmentType * 128);
1736 } 1736 }
1737 else 1737 else
1738 { 1738 {
1739 static int _4E2904_enchantment_by_potion_lut[] = 1739 static ITEM_ENCHANTMENT _4E2904_enchantment_by_potion_lut[] =
1740 { 1740 {
1741 164, 93, 22, 1741 (ITEM_ENCHANTMENT)164, (ITEM_ENCHANTMENT)93, (ITEM_ENCHANTMENT)22,
1742 164, 93, 22, 1742 (ITEM_ENCHANTMENT)164, (ITEM_ENCHANTMENT)93, (ITEM_ENCHANTMENT)22,
1743 11, 5, 13, 7, 59 1743 ITEM_ENCHANTMENT_OF_FLAME,
1744 }; 1744 ITEM_ENCHANTMENT_OF_FROST,
1745 item->uSpecEnchantmentType = _4E2904_enchantment_by_potion_lut[pParty->pPickedItem.uItemID - 240]; 1745 ITEM_ENCHANTMENT_OF_POISON,
1746 ITEM_ENCHANTMENT_OF_SPARKS,
1747 (ITEM_ENCHANTMENT)59
1748 };
1749 item->special_enchantment = _4E2904_enchantment_by_potion_lut[pParty->pPickedItem.uItemID - 240];
1746 v31 = (double)(1800 * pParty->pPickedItem.uEnchantmentType * 128); 1750 v31 = (double)(1800 * pParty->pPickedItem.uEnchantmentType * 128);
1747 } 1751 }
1748 1752
1749 item->uExpireTime = pParty->uTimePlayed + v31 * 0.033333335; 1753 item->uExpireTime = pParty->uTimePlayed + v31 * 0.033333335;
1750 item->uAttributes = alchemy_skill_level | 0x18; 1754 item->uAttributes = alchemy_skill_level | 0x18;
1762 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID == ITEM_POTION_BOTTLE) 1766 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID == ITEM_POTION_BOTTLE)
1763 { 1767 {
1764 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType = alchemy_skill_points + pParty->pPickedItem.GetDamageDice(); 1768 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType = alchemy_skill_points + pParty->pPickedItem.GetDamageDice();
1765 switch ( pParty->pPickedItem.uItemID ) 1769 switch ( pParty->pPickedItem.uItemID )
1766 { 1770 {
1767 case 200: 1771 case ITEM_REAGENT_WIDOWSWEEP_BERRIES:
1768 case 201: 1772 case ITEM_REAGENT_CRUSHED_ROSE_PETALS:
1769 case 202: 1773 case ITEM_TROLL_BLOOD:
1770 case 203: 1774 case ITEM_TROLL_RUBY:
1771 case 204: 1775 case ITEM_DRAGON_EYE:
1772 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = 222; 1776 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = ITEM_POTION_CURE_WOUNDS;
1773 break; 1777 break;
1774 case 205: 1778
1775 case 206: 1779 case ITEM_PHIMA_ROOT:
1776 case 207: 1780 case ITEM_METEORITE_FRAGMENT:
1777 case 208: 1781 case ITEM_HARPY_FEATHER:
1778 case 209: 1782 case ITEM_MOONSTONE:
1779 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = 223; 1783 case ITEM_ELVISH_TOADSTOOL:
1784 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = ITEM_POTION_MAGIC_POTION;
1780 break; 1785 break;
1781 case 210: 1786
1782 case 211: 1787 case ITEM_POPPYSNAPS:
1783 case 212: 1788 case ITEM_FAE_DUST:
1784 case 213: 1789 case ITEM_SULFUR:
1785 case 214: 1790 case ITEM_GARNET:
1786 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = 224; 1791 case ITEM_DEVIL_ICHOR:
1792 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = ITEM_POTION_CURE_WEAKNESS;
1787 break; 1793 break;
1788 case 215: 1794
1789 case 216: 1795 case ITEM_MUSHROOM:
1790 case 217: 1796 case ITEM_OBSIDIAN:
1791 case 218: 1797 case ITEM_OOZE_ENDOPLASM_VIAL:
1792 case 219: 1798 case ITEM_MERCURY:
1793 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = 221; 1799 case ITEM_REAGENT_PHILOSOPHERS_STONE:
1800 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = ITEM_POTION_CATALYST;
1794 break; 1801 break;
1795 default: 1802 default:
1796 break; 1803 break;
1797 } 1804 }
1798 pMouse->RemoveHoldingItem(); 1805 pMouse->RemoveHoldingItem();
1902 } 1909 }
1903 else //if ( damage_level == 0 ) 1910 else //if ( damage_level == 0 )
1904 { 1911 {
1905 if ( alchemy_skill_points ) 1912 if ( alchemy_skill_points )
1906 { 1913 {
1907 if ( pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID == 221 || pParty->pPickedItem.uItemID == 221 )//catalyst(�����������) 1914 if (pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID == ITEM_POTION_CATALYST || pParty->pPickedItem.uItemID == ITEM_POTION_CATALYST)
1908 { 1915 {
1909 if ( pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID == 221 ) 1916 if (pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID == ITEM_POTION_CATALYST)
1910 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = pParty->pPickedItem.uItemID; 1917 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = pParty->pPickedItem.uItemID;
1911 if ( pParty->pPickedItem.uItemID == 221 ) 1918 if (pParty->pPickedItem.uItemID == ITEM_POTION_CATALYST)
1912 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType = pParty->pPickedItem.uEnchantmentType; 1919 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType = pParty->pPickedItem.uEnchantmentType;
1913 } 1920 }
1914 else 1921 else
1915 { 1922 {
1916 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = potionID; 1923 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = potionID;
1917 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType = (pParty->pPickedItem.uEnchantmentType 1924 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType = (pParty->pPickedItem.uEnchantmentType
1918 + pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType) / 2; 1925 + pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType) / 2;
1919 pPlayers[uActiveCharacter]->SetVariable(VAR_AutoNotes, pItemsTable->potion_note[potion1_id][potion2_id]); 1926 pPlayers[uActiveCharacter]->SetVariable(VAR_AutoNotes, pItemsTable->potion_note[potion1_id][potion2_id]);
1920 } 1927 }
1921 int bottle = pPlayers[uActiveCharacter]->AddItem(-1, 220);//������� 1928 int bottle = pPlayers[uActiveCharacter]->AddItem(-1, ITEM_POTION_BOTTLE);
1922 if ( bottle ) 1929 if ( bottle )
1923 pPlayers[uActiveCharacter]->pOwnItems[bottle - 1].uAttributes = ITEM_IDENTIFIED; 1930 pPlayers[uActiveCharacter]->pOwnItems[bottle - 1].uAttributes = ITEM_IDENTIFIED;
1924 if ( !(pItemsTable->pItems[pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID].uItemID_Rep_St) ) 1931 if ( !(pItemsTable->pItems[pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID].uItemID_Rep_St) )
1925 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uAttributes |= 1; 1932 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uAttributes |= 1;
1926 if ( !dword_4E455C ) 1933 if ( !dword_4E455C )