Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        public void Refresh()
        {
            //原物品信息
            Hotfix_LT.Data.GeneralItemTemplate SourceItemDate = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetGeneral(itemID);
            sourceNum = GameItemUtil.GetInventoryItemNum(itemID);

            SourceItem.LTItemData = new LTShowItemData((itemID).ToString(), sourceNum, LTShowItemType.TYPE_GAMINVENTORY);
            //LTUIUtil.SetText(SourceItem.Count, sourceNum.ToString());
            SourceItemLabel.text = sourceNum.ToString();

            int DesItemID = 0;

            int.TryParse(SourceItemDate.CompoundItem, out DesItemID);
            if (CheckCanCompound(DesItemID))
            {
                int desNum = GameItemUtil.GetInventoryItemNum(DesItemID);
                DesItem.LTItemData = new LTShowItemData(DesItemID.ToString(), desNum, LTShowItemType.TYPE_GAMINVENTORY);
                //LTUIUtil.SetText(DesItem.Count, desNum.ToString());
                DesItemLabel.text = desNum.ToString();

                transNum = SourceItemDate.NeedNum;
                LTUIUtil.SetText(TransNumLabel, Mathf.Min(sourceNum / transNum, 1).ToString());
                LTUIUtil.SetText(TipLabel, string.Format("{0}{1}1", transNum, EB.Localizer.GetString("ID_AWAKENDUNGEON_TRANS")));
                CheckPlusSubBtn();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 根据物品数量判断物品是否可以使用
        /// </summary>
        public bool IsItemCanUse()
        {
            GenericItemInfo ItemInfo = new GenericItemInfo();

            ItemInfo.EconomyId   = templateid;
            ItemInfo.InventoryId = EB.Dot.String("inventory_id", BagItemData, null);
            ItemInfo.Num         = EB.Dot.Integer("num", BagItemData, 0);
            ItemInfo.Price       = 0;
            Hotfix_LT.Data.GeneralItemTemplate item = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(templateid) as Hotfix_LT.Data.GeneralItemTemplate;
            return((item == null) ? false : ItemInfo.Num >= item.NeedNum);
        }
Ejemplo n.º 4
0
        public void ShowGoodsList()
        {
            IDictionary itemDataCollection;

            DataLookupsCache.Instance.SearchDataByID("inventory", out itemDataCollection);

            List <string> goodsIdList = new List <string>();

            foreach (var goodsId in itemDataCollection.Keys)
            {
                IDictionary dic     = itemDataCollection[goodsId] as IDictionary;
                string      ss      = EB.Dot.String("location", dic, "");
                string      typeStr = EB.Dot.String("system", dic, "");
                if (ss == "bag_items" && typeStr != "Equipment")
                {
                    int EconomyId = EB.Dot.Integer("economy_id", dic, 0);
                    Hotfix_LT.Data.GeneralItemTemplate itemData = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(EconomyId) as Hotfix_LT.Data.GeneralItemTemplate;

                    if (itemData != null && itemData.Exp > 0)
                    {
                        goodsIdList.Add(goodsId.ToString());
                    }
                }
            }
            goodsIdList.Sort(0, goodsIdList.Count, new LTSkillBreakGoodsComparer());
            bagCellDataList = new List <UIInventoryBagCellData>();
            for (int i = 0; i < goodsIdList.Count; i++)
            {
                UIInventoryBagCellData bagCellData = new UIInventoryBagCellData(goodsIdList[i]);
                bagCellDataList.Add(bagCellData);
            }

            if (bagCellDataList.Count < 25)
            {
                for (int i = bagCellDataList.Count; i < 25; i++)
                {
                    bagCellDataList.Add(null);
                }
            }

            Scroll.SetItemDatas(bagCellDataList);
        }
Ejemplo n.º 5
0
        public void AddOrDelExp(int economyId, bool isAdd, int times)
        {
            int exp = 0;

            Hotfix_LT.Data.GeneralItemTemplate generalItemData = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(economyId) as Hotfix_LT.Data.GeneralItemTemplate;
            if (generalItemData == null)
            {
                Hotfix_LT.Data.EquipmentItemTemplate equipmentItemData = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(economyId) as Hotfix_LT.Data.EquipmentItemTemplate;
                exp = equipmentItemData.BaseExp;
            }
            else
            {
                exp = generalItemData.Exp;
            }
            if (isAdd)
            {
                addSkillExp += exp * times;
            }
            else
            {
                addSkillExp -= exp * times;
            }
        }