示例#1
0
        static public void PopToolTip(LTShowItemData itemData, bool isDescription = false)
        {
            if (itemData.type == LTShowItemType.TYPE_GAMINVENTORY)
            {
                Hotfix_LT.Data.EconemyItemTemplate eit = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(itemData.id);

                if (eit == null)
                {
                    return;
                }

                string system = "";

                if (eit is Hotfix_LT.Data.EquipmentItemTemplate)
                {
                    system = "Equipment";
                }
                else
                {
                    system = "Generic";
                }

                //以下判断显示物品来源Tip还是描述Tip,由物品bool ToolTipIsDesc字段决定
                if (!isDescription)
                {
                    UITooltipManager.Instance.DisplayTooltipSrc(itemData.id, system, "default");//来源
                }
                else
                {
                    LTResToolTipController.Show(itemData.type, itemData.id);//描述
                }
            }
            else if (itemData.type == LTShowItemType.TYPE_HERO)
            {
                Vector2 screenPos = UICamera.lastEventPosition;
                var     ht        = Johny.HashtablePool.Claim();
                ht.Add("id", itemData.id);
                ht.Add("screenPos", screenPos);
                GlobalMenuManager.Instance.Open("LTHeroToolTipUI", ht);
            }
            else
            {
                LTResToolTipController.Show(itemData.type, itemData.id);
            }
        }
示例#2
0
        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");
                }
            }
        }