public void Refresh(int itemId) { (base.get_transform() as RectTransform).set_anchoredPosition(new Vector2(5000f, 5000f)); this.BtnUseVisibility = false; this.ItemLv = string.Empty; Items item = BackpackManager.Instance.GetItem(itemId); if (item != null) { this.ItemFrame = GameDataUtils.GetItemFrame(item.id); this.ItemIcon = GameDataUtils.GetIcon(item.icon); this.ItemName = GameDataUtils.GetItemName(item, true); if (item.minLv > EntityWorld.Instance.EntSelf.Lv) { this.ItemLv = string.Format(GameDataUtils.GetChineseContent(509011, false), item.minLv); } string color = TextColorMgr.GetColor(BackpackManager.Instance.OnGetGoodCount(itemId).ToString(), "ff7d4b", string.Empty); string chineseContent = GameDataUtils.GetChineseContent(509010, false); this.ItemNum = TextColorMgr.GetColor(string.Format(chineseContent, " " + color), "eccd9b", string.Empty); this.ItemProfession = GameDataUtils.GetItemProfession(item); if (item.step <= 0) { this.ItemStepVisibility = false; } else { this.ItemStepVisibility = true; this.ItemStepText = string.Format(GameDataUtils.GetChineseContent(505023, false), item.step); } this.ExcellentCount = item.gogok; this.TextItems.Clear(); List <string> itemAttr = BackpackManager.Instance.GetItemAttr(item); if (itemAttr != null) { GameObject gameObject = GameObject.Find("Attrs"); if (gameObject != null) { gameObject.GetComponent <Image>().set_enabled(true); } for (int i = 0; i < itemAttr.get_Count(); i++) { this.TextItems.Add(new OOItem2Text { Content = TextColorMgr.GetColor(itemAttr.get_Item(i), "ECCD9B", string.Empty) }); } } else { GameObject gameObject2 = GameObject.Find("Attrs"); if (gameObject2 != null) { gameObject2.GetComponent <Image>().set_enabled(false); } } if (item.describeId1 > 0) { this.Desc = TextColorMgr.GetColor(GameDataUtils.GetChineseContent(item.describeId1, false), "FF7D4B", string.Empty); } else { this.Desc = string.Empty; } if (item.describeId2 > 0) { this.AttrDesc = TextColorMgr.GetColor(GameDataUtils.GetChineseContent(item.describeId2, false), "5AB9FF", string.Empty); } else { this.AttrDesc = string.Empty; } } }
private void SetItem(Items dataItem, int itemNum, int money_type, int group_price) { if (dataItem == null) { return; } this.m_group_price = group_price; this.m_money_type = money_type; long num = BackpackManager.Instance.OnGetGoodCount(dataItem.id); this.ItemFrame = GameDataUtils.GetItemFrame(dataItem.id); this.ItemIcon = GameDataUtils.GetIcon(dataItem.icon); this.ItemName = GameDataUtils.GetItemName(dataItem, true); this.ItemDesc = GameDataUtils.GetItemDescWithTab(dataItem, "6c4734"); this.BuyCount = string.Empty + itemNum; if (dataItem.firstType == 1) { this.ItemProfessionName = "职业:"; this.ItemProfession = GameDataUtils.GetItemProfession(dataItem); this.ItemFightingName = "战力评分:"; this.ItemFighting = EquipmentManager.Instance.GetEquipFightingByItemID(dataItem.id).ToString(); zZhuangBeiPeiZhiBiao zZhuangBeiPeiZhiBiao = DataReader <zZhuangBeiPeiZhiBiao> .Get(dataItem.id); if (zZhuangBeiPeiZhiBiao != null) { if (EntityWorld.Instance.EntSelf.Lv >= zZhuangBeiPeiZhiBiao.level) { this.ItemNumName = "穿戴等级:"; this.ItemOwn = " " + zZhuangBeiPeiZhiBiao.level.ToString(); } else { this.ItemNumName = "<color=#ff0000>穿戴等级不足</color>"; this.ItemOwn = string.Empty; } } } else { this.ItemNumName = "数量:"; this.ItemProfessionName = string.Empty; this.ItemProfession = string.Empty; this.ItemOwn = num.ToString(); this.ItemFightingName = GameDataUtils.GetItemProfession(dataItem); this.ItemFighting = string.Empty; } this.CostIcon = MoneyType.GetIcon(money_type); this.Input = 1.ToString(); this.SetMoney(1); bool flag = false; this.DefenceVisible = flag; flag = flag; this.AttackVisible = flag; flag = flag; this.DodgeVisible = flag; this.AttrTxtVisible = flag; this.AttackTxtNum = string.Empty; this.DefenceTxtNum = string.Empty; this.DodgeTxtNum = string.Empty; int attId = dataItem.atti; if (dataItem.firstType == 5) { attId = GemGlobal.GetAttrId(dataItem.id); } List <string> itemAttrText = this.GetItemAttrText(attId); int attrs_count = 0; if (itemAttrText != null) { this.AttrTxtVisible = true; attrs_count = itemAttrText.get_Count(); for (int i = 0; i < itemAttrText.get_Count(); i++) { switch (i) { case 0: this.AttackVisible = true; this.AttackTxtNum = itemAttrText.get_Item(0); break; case 1: this.DodgeVisible = true; this.DodgeTxtNum = itemAttrText.get_Item(1); break; case 2: this.DefenceVisible = true; this.DefenceTxtNum = itemAttrText.get_Item(2); break; } } } BuyUIView.Instance.SetAutoLayOut(attrs_count, this.BuyNumberAdjustOn); }
public static string GetItemProfession(int cfgId) { Items dataItem = DataReader <Items> .Get(cfgId); return(GameDataUtils.GetItemProfession(dataItem)); }