public void SetArmament(WrapperFollowerArmamentExt item, int garrFollowerID) { this.m_garrFollowerID = garrFollowerID; this.m_item = item; ItemRec record = StaticDB.itemDB.GetRecord(item.ItemID); this.m_armamentName.text = record.Display; SpellTooltipRec spellTooltipRec = StaticDB.spellTooltipDB.GetRecord(item.SpellID); if (spellTooltipRec == null) { this.m_armamentDescription.text = string.Concat(new object[] { "ERROR. Unknown Spell ID: ", item.SpellID, " Item ID:", item.ItemID }); } else { this.m_armamentDescription.text = spellTooltipRec.Description; } this.m_armamentDescription.text = WowTextParser.parser.Parse(this.m_armamentDescription.text, item.SpellID); if (this.m_iconErrorText != null) { this.m_iconErrorText.gameObject.SetActive(false); } Sprite sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, record.IconFileDataID); if (sprite != null) { this.m_armamentIcon.sprite = sprite; } else if (this.m_iconErrorText != null) { this.m_iconErrorText.gameObject.SetActive(true); this.m_iconErrorText.text = string.Concat(string.Empty, record.IconFileDataID); } this.m_armamentQuantity.text = (item.Quantity <= 1 ? string.Empty : string.Concat(string.Empty, item.Quantity)); }
public static void AddOrUpdateArmament(WrapperFollowerArmamentExt armament) { if (PersistentArmamentData.instance.m_armamentDictionary.ContainsKey(armament.ItemID)) { PersistentArmamentData.instance.m_armamentDictionary.Remove(armament.ItemID); } PersistentArmamentData.instance.m_armamentDictionary.Add(armament.ItemID, armament); }
public void SetArmament(WrapperFollowerArmamentExt item, FollowerDetailView followerDetailView) { this.m_armamentItem = new WrapperFollowerArmamentExt?(item); this.m_followerDetailView = followerDetailView; ItemRec record = StaticDB.itemDB.GetRecord(item.ItemID); if (record == null) { this.m_equipmentName.text = string.Concat("Unknown Item ", item.ItemID); } else { this.m_equipmentName.text = string.Concat(GeneralHelpers.GetItemQualityColorTag(record.OverallQualityID), record.Display, "</color>"); } SpellTooltipRec spellTooltipRec = StaticDB.spellTooltipDB.GetRecord(item.SpellID); if (spellTooltipRec == null) { this.m_equipmentDescription.text = string.Concat(new object[] { "ERROR. Unknown Spell ID: ", item.SpellID, " Item ID:", item.ItemID }); } else { this.m_equipmentDescription.text = spellTooltipRec.Description; } this.m_equipmentDescription.text = WowTextParser.parser.Parse(this.m_equipmentDescription.text, item.SpellID); this.m_equipmentDescription.supportRichText = WowTextParser.parser.IsRichText(); if (this.m_iconErrorText != null) { this.m_iconErrorText.gameObject.SetActive(false); } if (record != null) { Sprite sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, record.IconFileDataID); if (sprite != null) { this.m_equipmentIcon.sprite = sprite; } else if (this.m_iconErrorText != null) { this.m_iconErrorText.gameObject.SetActive(true); this.m_iconErrorText.text = string.Concat(string.Empty, record.IconFileDataID); } } this.m_equipmentQuantity.text = (item.Quantity <= 1 ? string.Empty : string.Concat(string.Empty, item.Quantity)); WrapperGarrisonFollower wrapperGarrisonFollower = PersistentFollowerData.followerDictionary[this.m_followerDetailView.GetCurrentFollower()]; bool flag = false; if (wrapperGarrisonFollower.CurrentMissionID != 0) { GarrMissionRec garrMissionRec = StaticDB.garrMissionDB.GetRecord(wrapperGarrisonFollower.CurrentMissionID); if (garrMissionRec != null && (garrMissionRec.Flags & 16) != 0) { flag = true; } } int itemLevelArmor = (wrapperGarrisonFollower.ItemLevelArmor + wrapperGarrisonFollower.ItemLevelWeapon) / 2; bool flag1 = (itemLevelArmor < item.MinItemLevel ? false : itemLevelArmor < item.MaxItemLevel); if (wrapperGarrisonFollower.CurrentMissionID != 0 && !flag) { this.m_useItemButtonLabel.text = StaticDB.GetString("ON_MISSION", null); this.m_useItemButtonLabel.color = new Color(0.5f, 0.5f, 0.5f, 1f); this.m_useItemButton.interactable = false; } else if (!flag1 || (long)itemLevelArmor >= (ulong)GeneralHelpers.GetMaxFollowerItemLevel()) { this.m_useItemButtonLabel.text = FollowerInventoryListItem.m_maxiLevelString; this.m_useItemButtonLabel.color = new Color(0.5f, 0.5f, 0.5f, 1f); this.m_useItemButton.interactable = false; } else { this.m_useItemButtonLabel.text = StaticDB.GetString("USE_ITEM", null); } }