public void ShowItem() { IDictionary itemData; DataLookupsCache.Instance.SearchDataByID <IDictionary>(string.Format("inventory.{0}", goodsId), out itemData); if (itemData == null) { ItemObj.SetActive(false); return; } delGoodsCount = LTPartnerDataManager.Instance.GetSkillBreakDelGoodsByGoodsId(goodsId); economyId = EB.Dot.Integer(m_EconomyIDPropertyName, itemData, 0); goodsCount = EB.Dot.Integer(m_NumPropertyName, itemData, 0); quality = EB.Dot.Integer(m_QualityLevelPropertyName, itemData, 0); QualitySprite.spriteName = LTPartnerConfig.OUT_LINE_SPRITE_NAME_DIC[quality - 1]; Hotfix_LT.Data.EconemyItemTemplate tempItemData = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(economyId); IconDySprite.spriteName = tempItemData.IconId; Hotfix_LT.Data.GeneralItemTemplate tempGenItemData = tempItemData as Hotfix_LT.Data.GeneralItemTemplate; if (tempGenItemData != null) { PartnerChipSprite.gameObject.CustomSetActive(tempGenItemData.System.CompareTo("HeroShard") == 0); } ShowGoodsCount(); ShowGoodsColor(); }
public static string GetResName(string res_id) { int id = GetResID(res_id); Hotfix_LT.Data.EconemyItemTemplate itemTpl = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(id); return(itemTpl.Name); }
/// <summary> /// 点击确定按钮 /// </summary> public void OnClickConfirmBtn() { if (mCurSelectBoxNum < 1 || mCurSelectBoxNum > mBoxMaxNum) { EB.Debug.LogError("LTSelectBoxController UseItem Error, num Error"); return; } Hotfix_LT.Data.SelectBox selectBox = mCurCell.GetCurSelectBoxData(); LTPartnerData partnerData = LTPartnerDataManager.Instance.GetPartnerByStatId(int.Parse(selectBox.ri1)); bool isHasPartner = partnerData != null && partnerData.HeroId > 0; string statId = selectBox.ri1; int summonShard = partnerData == null ? 0 :partnerData.HeroInfo.summon_shard; LTPartnerDataManager.Instance.UseItem(mCurInventoryId, mCurSelectBoxNum, selectBox.index, delegate { if (selectBox.rt1.Equals("hero")) { if (!isHasPartner) { LTShowItemData itemData = new LTShowItemData(statId, 1, "hero"); GlobalMenuManager.Instance.Open("LTShowGetPartnerUI", itemData); } else { LTShowItemData itemData = new LTShowItemData(statId, summonShard * mCurSelectBoxNum, "heroshard"); GlobalMenuManager.Instance.Open("LTShowGetPartnerUI", itemData); } } else { List <LTShowItemData> showItemsList = new List <LTShowItemData>(); Hotfix_LT.Data.EconemyItemTemplate info = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(selectBox.ri1); if (info is Hotfix_LT.Data.EquipmentItemTemplate) { for (int i = 0; i < mCurSelectBoxNum; i++) { LTShowItemData showItemData = new LTShowItemData(selectBox.ri1, selectBox.rn1, selectBox.rt1); showItemsList.Add(showItemData); } } else { LTShowItemData showItemData = new LTShowItemData(selectBox.ri1, selectBox.rn1 * mCurSelectBoxNum, selectBox.rt1); showItemsList.Add(showItemData); } GlobalMenuManager.Instance.Open("LTShowRewardView", showItemsList); } if (mCurSelectBoxNum == mBoxMaxNum) { UIInventoryBagLogic.Instance.FirstItem = null; } UIInventoryBagLogic.Instance.RefeshBag(ShowBagContent.Instance.CurType); controller.Close(); }); }
public static string GetResIcon(string res_id, int count = -1) { int id = GetResID(res_id); Hotfix_LT.Data.EconemyItemTemplate itemTpl = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(id); return(itemTpl.IconId); }
public int Compare(string x, string y) { IDictionary xData; IDictionary yData; DataLookupsCache.Instance.SearchDataByID <IDictionary>(string.Format("inventory.{0}", x), out xData); DataLookupsCache.Instance.SearchDataByID <IDictionary>(string.Format("inventory.{0}", y), out yData); if (xData == null || yData == null) { return(1); } int xEconomyId = EB.Dot.Integer("economy_id", xData, 0); int yEconomyId = EB.Dot.Integer("economy_id", yData, 0); Hotfix_LT.Data.EconemyItemTemplate xItemData = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(xEconomyId); Hotfix_LT.Data.EconemyItemTemplate yItemData = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(yEconomyId); int xExp = (xItemData as Hotfix_LT.Data.GeneralItemTemplate) == null ? (xItemData as Hotfix_LT.Data.EquipmentItemTemplate).BaseExp : (xItemData as Hotfix_LT.Data.GeneralItemTemplate).Exp; int yExp = (yItemData as Hotfix_LT.Data.GeneralItemTemplate) == null ? (yItemData as Hotfix_LT.Data.EquipmentItemTemplate).BaseExp : (yItemData as Hotfix_LT.Data.GeneralItemTemplate).Exp; if (xExp != yExp) { return(yExp - xExp); } else { return(xEconomyId - yEconomyId); } }
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); } }
private void UpdateDrop(Hotfix_LT.Data.EconemyItemTemplate item) { DropDatas = item.DropDatas; int count = DropDatas.Count; BigBG.height = bigBGHighValue[count]; SmallBG.height = smallBGHighValue[count]; if (count > 0) { GetLabelObj.CustomSetActive(false); for (int i = 0; i < 3; ++i) { if (i < count) { m_SourceLabelList[i].transform.parent.gameObject.CustomSetActive(true); item.DropDatas[i].ShowName(m_SourceLabelList[i]); item.DropDatas[i].ShowBG(m_SourceSpriteList[i]); m_SourceLabelList[i].transform.parent.SetSiblingIndex(i); } else { m_SourceLabelList[i].transform.parent.gameObject.CustomSetActive(false); } } for (int i = 0; i < count; i++) { if (!item.DropDatas[i].IsOpen) { m_SourceLabelList[i].transform.parent.SetSiblingIndex(count - 1); } } DropItemsGrid.Reposition(); } else { GetLabelObj.CustomSetActive(true); m_SourceLabelList[1].transform.parent.gameObject.CustomSetActive(false); m_SourceLabelList[2].transform.parent.gameObject.CustomSetActive(false); m_SourceLabelList[0].transform.parent.gameObject.CustomSetActive(false); } ShowUI(); }
private void ClassifyItems(int id, List <DictionaryEntry> entries, out List <UIInventoryBagCellData> bagdatas, out object FirstItem, out IDictionary FirstItemData, out int length, bool FirstIsFill = false) { length = 0; if (FirstIsFill) { FirstItem = this.FirstItem; FirstItemData = this.FirstItemData; } else { FirstItem = null; FirstItemData = null; } bagdatas = new List <UIInventoryBagCellData>(); if (id == 1) { for (int i = 0; i < entries.Count; i++) { int templateid = EB.Dot.Integer("economy_id", entries[i].Value, 0); Data.EconemyItemTemplate eit = Data.EconemyTemplateManager.Instance.GetItem(templateid); Data.GeneralItemTemplate eitGen = eit as Data.GeneralItemTemplate; if (eitGen != null && (eitGen.System.Equals("Generic") || eitGen.System.Equals("SelectBox")) && (eit as Data.GeneralItemTemplate).CanUse) { bagdatas.Add(new UIInventoryBagCellData(GetItemDataIDFromKey(entries[i].Key.ToString()))); length++; if (!FirstIsFill) { FirstItem = entries[i].Value; FirstIsFill = true; DataLookupsCache.Instance.SearchDataByID <IDictionary>(bagdatas[bagdatas.Count - 1].m_DataID, out FirstItemData); } } } } else if (id == 2) { for (int i = 0; i < entries.Count; i++) { int templateid = EB.Dot.Integer("economy_id", entries[i].Value, 0); Hotfix_LT.Data.EconemyItemTemplate eit = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(templateid); if (eit is Hotfix_LT.Data.EquipmentItemTemplate) { bagdatas.Add(new UIInventoryBagCellData(GetItemDataIDFromKey(entries[i].Key.ToString()))); length++; if (!FirstIsFill) { FirstItem = entries[i].Value; FirstIsFill = true; DataLookupsCache.Instance.SearchDataByID <IDictionary>(bagdatas[bagdatas.Count - 1].m_DataID, out FirstItemData); } } } } else if (id == 3) { for (int i = 0; i < entries.Count; i++) { int templateid = EB.Dot.Integer("economy_id", entries[i].Value, 0); Hotfix_LT.Data.EconemyItemTemplate eit = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(templateid); if (eit is Hotfix_LT.Data.GeneralItemTemplate && (eit as Hotfix_LT.Data.GeneralItemTemplate).System == "HeroShard") { bagdatas.Add(new UIInventoryBagCellData(GetItemDataIDFromKey(entries[i].Key.ToString()))); length++; if (!FirstIsFill) { FirstItem = entries[i].Value; FirstIsFill = true; DataLookupsCache.Instance.SearchDataByID <IDictionary>(bagdatas[bagdatas.Count - 1].m_DataID, out FirstItemData); } } } } else if (id == 4) { for (int i = 0; i < entries.Count; i++) { int templateid = EB.Dot.Integer("economy_id", entries[i].Value, 0); Hotfix_LT.Data.EconemyItemTemplate eit = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(templateid); if (eit is Hotfix_LT.Data.GeneralItemTemplate && (eit as Hotfix_LT.Data.GeneralItemTemplate).System == "Generic" && !(eit as Hotfix_LT.Data.GeneralItemTemplate).CanUse) { bagdatas.Add(new UIInventoryBagCellData(GetItemDataIDFromKey(entries[i].Key.ToString()))); length++; if (!FirstIsFill) { FirstItem = entries[i].Value; FirstIsFill = true; DataLookupsCache.Instance.SearchDataByID <IDictionary>(bagdatas[bagdatas.Count - 1].m_DataID, out FirstItemData); } } } } else { EB.Debug.LogError(EB.Localizer.GetString("ID_codefont_in_UIInventoryBagLogic_11306")); } }