public void Init(LTShowItemData data) { HideUI(); curData = data; item.LTItemData = data; EquipContent.CustomSetActive(false); NormalContent.CustomSetActive(true); if (data.type == LTShowItemType.TYPE_SCROLL) { Hotfix_LT.Data.SkillTemplate skillTpl = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(int.Parse(data.id)); DescLab.text = skillTpl.Description; int magicPoint = BalanceResourceUtil.GetResValue("mana"); MagicPointLab.text = skillTpl.SPCost.ToString(); MagicObj.CustomSetActive(true); DescLab.gameObject.CustomSetActive(true); } else { string id = data.id; if (data.type == LTShowItemType.TYPE_RES) { id = BalanceResourceUtil.GetResID(data.id).ToString(); } Hotfix_LT.Data.EconemyItemTemplate itemTpl = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(id); MagicObj.CustomSetActive(false); if (itemTpl != null) { DescLab.gameObject.CustomSetActive(true); if (itemTpl is Hotfix_LT.Data.EquipmentItemTemplate) { NormalContent.CustomSetActive(false); EquipContent.CustomSetActive(true); InitEquipContent(itemTpl as Hotfix_LT.Data.EquipmentItemTemplate); } else { DescLab.text = itemTpl.Desc; } } else { DescLab.gameObject.CustomSetActive(false); } } ShowUI(); }
private void SetTilteAndIcon() { if (data.type == "res") { int tplID = BalanceResourceUtil.GetResID(data.id); Hotfix_LT.Data.EconemyItemTemplate itemTpl = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(tplID); titleLab.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTMainInstanceLampItem_1974"), itemTpl.Name); CoinSp.spriteName = BalanceResourceUtil.GetResSpriteName(data.id); } else if (data.type == "heroshard") { titleLab.text = EB.Localizer.GetString("ID_codefont_in_LTMainInstanceLampItem_2168"); CoinSp.spriteName = BalanceResourceUtil.GetResSpriteName(data.type); } }
void ShowInfo(string type, string id) { if (type == LTShowItemType.TYPE_RES || type == LTShowItemType.TYPE_HEROMEDAL || type == LTShowItemType.TYPE_ACTICKET || type == LTShowItemType.TYPE_VIPPOINT) { int resNum = BalanceResourceUtil.GetResValue(id); ShowItem.LTItemData = new LTShowItemData(id, 1, LTShowItemType.TYPE_RES, true); HaveNumLabel.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTResToolTipController_951"), resNum); int resIdInEconemy = BalanceResourceUtil.GetResID(id); Hotfix_LT.Data.EconemyItemTemplate itemInfo = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(resIdInEconemy); if (itemInfo != null) { DescTextLabel.text = itemInfo.Desc; } else { DescTextLabel.text = EB.Localizer.GetString("ID_ITEM_DESC"); } } else if (type == LTShowItemType.TYPE_HEROSHARD) { int num = GameItemUtil.GetInventoryItemNum(id); ShowItem.LTItemData = new LTShowItemData(id, 1, LTShowItemType.TYPE_HEROSHARD, true); HaveNumLabel.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTResToolTipController_951"), num); Hotfix_LT.Data.EconemyItemTemplate itemInfo = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(id); if (itemInfo != null) { DescTextLabel.text = itemInfo.Desc; } else { DescTextLabel.text = EB.Localizer.GetString("ID_ITEM_DESC"); } } else if (type == LTShowItemType.TYPE_HEADFRAME) { ShowItem.LTItemData = new LTShowItemData(id, 1, LTShowItemType.TYPE_HEADFRAME); HaveNumLabel.text = string.Format(string.Empty); var data = EconemyTemplateManager.Instance.GetHeadFrame(id, 1); DescTextLabel.text = data.desc; } else if (type == LTShowItemType.TYPE_SCROLL) { ShowItem.LTItemData = new LTShowItemData(id, 1, LTShowItemType.TYPE_SCROLL); HaveNumLabel.text = string.Empty; Hotfix_LT.Data.SkillTemplate skillTpl = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(int.Parse(id)); DescTextLabel.text = skillTpl.Description; } else { int num = GameItemUtil.GetInventoryItemNum(id); //运营活动的脚印数量不存背包,数量要特殊获取 if (type == LTShowItemType.TYPE_ACTIVITY) { if (id.Equals("2005")) { id = "2012"; } DataLookupsCache.Instance.SearchDataByID("tl_acs." + id + ".current", out num); } ShowItem.LTItemData = new LTShowItemData(id, 1, type, true); HaveNumLabel.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTResToolTipController_951"), num); Hotfix_LT.Data.EconemyItemTemplate itemInfo = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(id); if (itemInfo != null) { DescTextLabel.text = itemInfo.Desc; } else { DescTextLabel.text = EB.Localizer.GetString("ID_ITEM_DESC"); } } }
public static LTIconNameQuality GetInfo(string id, string type, bool nameWithColor = false) { string icon = ""; string quality = "1"; string name = ""; if (type.Equals(LTShowItemType.TYPE_GAMINVENTORY)) { var item = EconemyTemplateManager.Instance.GetItem(id); if (item != null) { icon = item.IconId; quality = item.QualityLevel.ToString(); name = item.Name; } } else if (type.Equals(LTShowItemType.TYPE_RES) || type.Equals(LTShowItemType.TYPE_HEROMEDAL) || type.Equals(LTShowItemType.TYPE_VIPPOINT) || type.Equals(LTShowItemType.TYPE_ACTICKET)) { int resId = BalanceResourceUtil.GetResID(id); var item = EconemyTemplateManager.Instance.GetItem(resId); quality = "1"; if (item != null) { icon = item.IconId; quality = item.QualityLevel.ToString(); name = item.Name; } } else if (type.Equals(LTShowItemType.TYPE_HERO)) { bool isCharacterid = CharacterTemplateManager.Instance.HasHeroInfo(int.Parse(id)); if (isCharacterid) { var item = CharacterTemplateManager.Instance.GetHeroInfo(id); if (item != null) { quality = (item.role_grade + 1).ToString(); name = item.name; icon = item.icon; } } else { var temp = CharacterTemplateManager.Instance.GetHeroStat(id); quality = "2"; if (temp != null) { var item = CharacterTemplateManager.Instance.GetHeroInfo(temp.character_id); if (item != null) { quality = (item.role_grade + 1).ToString(); name = item.name; icon = item.icon; } } } } else if (type.Equals(LTShowItemType.TYPE_HEROSHARD)) { bool isCharacterid = CharacterTemplateManager.Instance.HasHeroInfo(int.Parse(id)); if (isCharacterid) { var item = CharacterTemplateManager.Instance.GetHeroInfo(id); if (item != null) { quality = (item.role_grade + 1).ToString(); name = item.name; icon = item.icon; } } else { var temp = CharacterTemplateManager.Instance.GetHeroStat(id); quality = "2"; if (temp != null) { var item = CharacterTemplateManager.Instance.GetHeroInfo(temp.character_id); if (item != null) { quality = (item.role_grade + 1).ToString(); name = item.name + EB.Localizer.GetString("ID_HERO_SHARD_FIX"); icon = item.icon; } } } } else if (type.Equals(LTShowItemType.TYPE_SCROLL)) { SkillTemplate item = SkillTemplateManager.Instance.GetTemplate(int.Parse(id)); quality = "2"; if (item != null) { name = item.Name; icon = item.Icon; } } else if (type.Equals(LTShowItemType.TYPE_HEADFRAME)) { var item = EconemyTemplateManager.Instance.GetHeadFrame(id, 1); quality = "5"; if (item != null) { name = item.name; icon = item.iconId; } } else if (type.Equals(LTShowItemType.TYPE_ACTIVITY)) { var item = EconemyTemplateManager.Instance.GetItem(id); if (id.Equals("2005"))//脚印 { item = EconemyTemplateManager.Instance.GetItem("2012"); } if (item != null) { quality = item.QualityLevel.ToString(); name = item.Name; icon = item.IconId; } } string colorname = string.Format(LTGameColor.QualityToColorStr(quality, nameWithColor), name); return(new LTIconNameQuality(type, icon, colorname, quality)); }