private void ShowILVL() { ItemRec record = StaticDB.itemDB.GetRecord(this.m_itemID); if (record == null) { Debug.LogWarning(string.Concat(new object[] { "Invalid Item ID ", this.m_itemID, " from Quest ID ", this.m_questID, ". Ignoring for showing iLevel on map." })); return; } if (AdventureMapPanel.instance.IsFilterEnabled(MapFilterType.Gear) && (record.ClassID == 2 || record.ClassID == 3 || record.ClassID == 4 || record.ClassID == 6)) { WrapperItemStats?itemStats = ItemStatCache.instance.GetItemStats(this.m_itemID, this.m_itemContext); if (!itemStats.HasValue) { ItemStatCache.instance.ItemStatCacheUpdateAction += new Action <int, int, WrapperItemStats>(this.ItemStatsUpdated); } else { this.m_quantityArea.gameObject.SetActive(true); Text mQuantity = this.m_quantity; string str = StaticDB.GetString("ILVL", null); WrapperItemStats value = itemStats.Value; mQuantity.text = string.Concat(str, " ", value.ItemLevel); } } }
private void ItemStatsUpdated(int itemID, int itemContext, WrapperItemStats itemStats) { if (this.m_rewardType == MissionRewardDisplay.RewardType.item) { this.SetItem(this.m_rewardID, itemContext, this.m_rewardIcon.sprite); } }
private void ItemStatsUpdated(int itemID, int itemContext, WrapperItemStats itemStats) { if (this.m_itemID == itemID && this.m_itemContext == itemContext) { ItemStatCache.instance.ItemStatCacheUpdateAction -= new Action <int, int, WrapperItemStats>(this.ItemStatsUpdated); this.ShowILVL(); } }
private void ItemStatsUpdated(int itemID, int itemContext, WrapperItemStats itemStats, WrapperItemInstance?itemInstance) { if (this.m_rewardType == MissionRewardDisplay.RewardType.item) { this.SetItem(this.m_rewardID, itemContext, this.m_rewardIcon.sprite, itemInstance); ItemStatCache instance = ItemStatCache.instance; instance.ItemStatCacheUpdateAction = (Action <int, int, WrapperItemStats, WrapperItemInstance?>)Delegate.Remove(instance.ItemStatCacheUpdateAction, new Action <int, int, WrapperItemStats, WrapperItemInstance?>(this.ItemStatsUpdated)); } }
private void ItemStatsUpdated(int itemID, int itemContext, WrapperItemStats itemStats, WrapperItemInstance?itemInstance) { if (this.m_itemID == itemID && this.m_itemContext == itemContext) { ItemStatCache instance = ItemStatCache.instance; instance.ItemStatCacheUpdateAction = (Action <int, int, WrapperItemStats, WrapperItemInstance?>)Delegate.Remove(instance.ItemStatCacheUpdateAction, new Action <int, int, WrapperItemStats, WrapperItemInstance?>(this.ItemStatsUpdated)); this.ShowILVL(); } }
public void UpdateLootQuality(int itemID, int itemContext, WrapperItemStats stats, WrapperItemInstance?itemInstance) { if (itemID != this.m_itemID) { return; } this.UpdateLootQualityImpl(stats); ItemStatCache instance = ItemStatCache.instance; instance.ItemStatCacheUpdateAction = (Action <int, int, WrapperItemStats, WrapperItemInstance?>)Delegate.Remove(instance.ItemStatCacheUpdateAction, new Action <int, int, WrapperItemStats, WrapperItemInstance?>(this.UpdateLootQuality)); }
public void AddMobileItemStats(int itemID, int itemContext, WrapperItemStats stats) { if (!this.m_records.ContainsKey(itemID)) { this.m_records.Add(itemID, stats); } else { this.m_records[itemID] = stats; } if (this.ItemStatCacheUpdateAction != null) { this.ItemStatCacheUpdateAction(itemID, itemContext, stats); } }
private void UpdateLootQualityImpl(WrapperItemStats stats) { this.m_lootQuality = (ITEM_QUALITY)stats.Quality; if (this.m_normalGlow != null) { if (this.m_lootQuality < ITEM_QUALITY.STANDARD) { this.m_normalGlow.color = this.WORLD_QUEST_GLOW_COLOR_DEFAULT; } if (this.m_lootQuality > ITEM_QUALITY.STANDARD) { string text = "#" + GeneralHelpers.GetItemQualityColor((int)this.m_lootQuality); Color color; if (ColorUtility.TryParseHtmlString(text, ref color)) { this.m_normalGlow.color = color; } } } }
public void SetItem(int itemID, int itemContext, Sprite iconSprite) { string str; string str1; this.m_rewardQuantity.text = string.Empty; this.m_rewardName.text = string.Empty; this.m_rewardDescription.text = string.Empty; this.m_rewardIcon.sprite = iconSprite; ItemRec itemRec = StaticDB.itemDB.GetRecord(itemID); if (itemRec == null) { this.m_rewardName.text = string.Concat("Unknown Item", itemID); this.m_rewardDescription.text = string.Empty; } else { WrapperItemStats?itemStats = ItemStatCache.instance.GetItemStats(itemID, itemContext); if (!itemStats.HasValue) { this.m_rewardName.text = string.Concat(GeneralHelpers.GetItemQualityColorTag(itemRec.OverallQualityID), itemRec.Display, "</color>"); } else { Text mRewardName = this.m_rewardName; WrapperItemStats value = itemStats.Value; mRewardName.text = string.Concat(GeneralHelpers.GetItemQualityColorTag(value.Quality), itemRec.Display, "</color>"); } this.m_rewardName.supportRichText = true; if (itemRec.ItemNameDescriptionID > 0) { ItemNameDescriptionRec itemNameDescriptionRec = StaticDB.itemNameDescriptionDB.GetRecord(itemRec.ItemNameDescriptionID); if (itemNameDescriptionRec != null) { Text text = this.m_rewardName; str = text.text; text.text = string.Concat(new string[] { str, "\n<color=#", GeneralHelpers.GetColorFromInt(itemNameDescriptionRec.Color), "ff>", itemNameDescriptionRec.Description, "</color>" }); } } if (this.m_azeriteFrame != null) { this.m_azeriteFrame.SetActive(StaticDB.azeriteEmpoweredItemDB.GetRecordFirstOrDefault((AzeriteEmpoweredItemRec record) => record.ItemID == itemID) != null); } if (itemRec.ClassID == 2 || itemRec.ClassID == 3 || itemRec.ClassID == 4 || itemRec.ClassID == 5 || itemRec.ClassID == 6) { int itemLevel = itemRec.ItemLevel; if (itemStats.HasValue) { itemLevel = itemStats.Value.ItemLevel; } Text mRewardName1 = this.m_rewardName; str = mRewardName1.text; mRewardName1.text = string.Concat(new string[] { str, "\n<color=#", GeneralHelpers.s_defaultColor, ">", StaticDB.GetString("ITEM_LEVEL", null), " ", itemLevel.ToString(), "</color>" }); } if (itemRec.Bonding > 0) { string empty = string.Empty; if ((itemRec.Flags[0] & 134217728) != 0) { empty = ((itemRec.Flags[1] & 131072) == 0 ? StaticDB.GetString("ITEM_BIND_TO_ACCOUNT", null) : StaticDB.GetString("ITEM_BIND_TO_BNETACCOUNT", null)); } else if (itemRec.Bonding == 1) { empty = StaticDB.GetString("ITEM_BIND_ON_PICKUP", null); } else if (itemRec.Bonding == 4) { empty = StaticDB.GetString("ITEM_BIND_QUEST", null); } else if (itemRec.Bonding == 2) { empty = StaticDB.GetString("ITEM_BIND_ON_EQUIP", null); } else if (itemRec.Bonding == 3) { empty = StaticDB.GetString("ITEM_BIND_ON_USE", null); } if (empty != string.Empty) { Text text1 = this.m_rewardName; str = text1.text; text1.text = string.Concat(new string[] { str, "\n<color=#", GeneralHelpers.s_normalColor, ">", empty, "</color>" }); } } ItemSubClassRec itemSubclass = StaticDB.GetItemSubclass(itemRec.ClassID, itemRec.SubclassID); if (itemSubclass != null && itemSubclass.DisplayName != null && itemSubclass.DisplayName != string.Empty && (itemSubclass.DisplayFlags & 1) == 0 && itemRec.InventoryType != 16) { if (this.m_rewardDescription.text != string.Empty) { Text mRewardDescription = this.m_rewardDescription; mRewardDescription.text = string.Concat(mRewardDescription.text, "\n"); } Text mRewardDescription1 = this.m_rewardDescription; str = mRewardDescription1.text; mRewardDescription1.text = string.Concat(new string[] { str, "<color=#", GeneralHelpers.s_normalColor, ">", itemSubclass.DisplayName, "</color>" }); } string inventoryTypeString = GeneralHelpers.GetInventoryTypeString((INVENTORY_TYPE)itemRec.InventoryType); if (inventoryTypeString != null && inventoryTypeString != string.Empty) { if (this.m_rewardDescription.text != string.Empty) { Text mRewardDescription2 = this.m_rewardDescription; mRewardDescription2.text = string.Concat(mRewardDescription2.text, "\n"); } Text text2 = this.m_rewardDescription; str = text2.text; text2.text = string.Concat(new string[] { str, "<color=#", GeneralHelpers.s_normalColor, ">", inventoryTypeString, "</color>" }); } if (itemStats.HasValue) { if (itemStats.Value.MinDamage != 0 || itemStats.Value.MaxDamage != 0) { if (this.m_rewardDescription.text != string.Empty) { Text mRewardDescription3 = this.m_rewardDescription; mRewardDescription3.text = string.Concat(mRewardDescription3.text, "\n"); } if (itemStats.Value.MinDamage != itemStats.Value.MaxDamage) { Text text3 = this.m_rewardDescription; string str2 = text3.text; string str3 = itemStats.Value.MinDamage.ToString(); WrapperItemStats wrapperItemStat = itemStats.Value; text3.text = string.Concat(str2, GeneralHelpers.TextOrderString(string.Concat(str3, " - ", wrapperItemStat.MaxDamage.ToString()), StaticDB.GetString("DAMAGE", null))); } else { Text mRewardDescription4 = this.m_rewardDescription; string str4 = mRewardDescription4.text; WrapperItemStats value1 = itemStats.Value; mRewardDescription4.text = string.Concat(str4, GeneralHelpers.TextOrderString(value1.MinDamage.ToString(), StaticDB.GetString("DAMAGE", null))); } } if (itemStats.Value.EffectiveArmor > 0) { if (this.m_rewardDescription.text != string.Empty) { Text text4 = this.m_rewardDescription; text4.text = string.Concat(text4.text, "\n"); } Text mRewardDescription5 = this.m_rewardDescription; str = mRewardDescription5.text; string[] sNormalColor = new string[] { str, "<color=#", GeneralHelpers.s_normalColor, ">", null, null }; WrapperItemStats wrapperItemStat1 = itemStats.Value; sNormalColor[4] = GeneralHelpers.TextOrderString(wrapperItemStat1.EffectiveArmor.ToString(), StaticDB.GetString("ARMOR", null)); sNormalColor[5] = "</color>"; mRewardDescription5.text = string.Concat(sNormalColor); } foreach (WrapperItemBonusStat bonusStat in itemStats.Value.BonusStats) { if (bonusStat.BonusAmount == 0) { continue; } if (this.m_rewardDescription.text != string.Empty) { Text text5 = this.m_rewardDescription; text5.text = string.Concat(text5.text, "\n"); } Text mRewardDescription6 = this.m_rewardDescription; mRewardDescription6.text = string.Concat(mRewardDescription6.text, "<color=#", GeneralHelpers.GetMobileStatColorString(bonusStat.Color), ">"); str1 = (bonusStat.BonusAmount <= 0 ? "-" : "+"); Text text6 = this.m_rewardDescription; text6.text = string.Concat(text6.text, GeneralHelpers.TextOrderString(string.Concat(str1, bonusStat.BonusAmount.ToString()), GeneralHelpers.GetBonusStatString((BonusStatIndex)bonusStat.StatID)), "</color>"); } } int requiredLevel = itemRec.RequiredLevel; if (itemStats.HasValue) { requiredLevel = itemStats.Value.RequiredLevel; } if (requiredLevel > 1) { if (this.m_rewardDescription.text != string.Empty) { Text mRewardDescription7 = this.m_rewardDescription; mRewardDescription7.text = string.Concat(mRewardDescription7.text, "\n"); } string mobileStatColorString = GeneralHelpers.s_normalColor; if (GarrisonStatus.CharacterLevel() < requiredLevel) { mobileStatColorString = GeneralHelpers.GetMobileStatColorString(WrapperStatColor.MOBILE_STAT_COLOR_ERROR); } Text text7 = this.m_rewardDescription; str = text7.text; text7.text = string.Concat(new object[] { str, "<color=#", mobileStatColorString, ">", StaticDB.GetString("ITEM_MIN_LEVEL", null), " ", requiredLevel, "</color>" }); } string itemDescription = GeneralHelpers.GetItemDescription(itemRec); if (itemDescription != null && itemDescription != string.Empty) { if (this.m_rewardDescription.text != string.Empty) { Text mRewardDescription8 = this.m_rewardDescription; mRewardDescription8.text = string.Concat(mRewardDescription8.text, "\n"); } Text text8 = this.m_rewardDescription; text8.text = string.Concat(text8.text, itemDescription); } else if (!itemStats.HasValue) { if (this.m_rewardDescription.text != string.Empty) { Text mRewardDescription9 = this.m_rewardDescription; mRewardDescription9.text = string.Concat(mRewardDescription9.text, "\n"); } Text text9 = this.m_rewardDescription; text9.text = string.Concat(text9.text, "..."); } } }