Пример #1
0
        public void UpdateUI()
        {
            if (string.IsNullOrEmpty(Data.id))
            {
                mDMono.gameObject.CustomSetActive(false);
                return;
            }
            else
            {
                mDMono.gameObject.CustomSetActive(true);
            }

            //m_Have_Label.text = string.Format(HaveFormatStr,EB.Localizer.GetString("ID_LABEL_NAME_HADE"),Data.have);

            if (m_Discount_Label != null)
            {
                m_Discount_Label.text = LTChargeManager.GetDiscountText(Data.discount);
                m_Discount_Label.gameObject.CustomSetActive(Data.discount > 0 && Data.discount < 1);
            }

            int resBalance = BalanceResourceUtil.GetResValue(Data.cost_id);

            if (resBalance < Data.cost)
            {
                m_Cost_Label.color = LT.Hotfix.Utility.ColorUtility.RedColor;
            }
            else
            {
                m_Cost_Label.color = LT.Hotfix.Utility.ColorUtility.WhiteColor;
            }

            LTUIUtil.AddBlackOutLineToLabel(m_Cost_Label, Data.cost.ToString());
            m_Cost_Sprite.spriteName = BalanceResourceUtil.GetResSpriteName(Data.cost_id);

            if (m_UIResourceComponent != null)
            {
                m_UIResourceComponent.m_ResID = Data.cost_id;
            }

            m_Item.LTItemData = new LTShowItemData(Data.id, Data.num, Data.type, false);
            LTIconNameQuality itemInfo = LTItemInfoTool.GetInfo(m_Item.LTItemData.id, m_Item.LTItemData.type, m_Item.LTItemData.coloring);

            Data.item_name            = itemInfo.name;
            m_Item.Name.applyGradient = false;

            if (Data.sell_out)
            {
                m_Cost_Label.gameObject.CustomSetActive(false);
                m_Cost_Sprite.gameObject.CustomSetActive(false);
                m_SellOut_Sprite.gameObject.CustomSetActive(true);
                m_BuyBtn.enabled = false;
            }
            else
            {
                m_Cost_Label.gameObject.CustomSetActive(true);
                m_Cost_Sprite.gameObject.CustomSetActive(true);
                m_SellOut_Sprite.gameObject.CustomSetActive(false);
                m_BuyBtn.enabled = true;
            }
        }
Пример #2
0
        private void OpenBox(object data, int x, int y)
        {
            ArrayList list = data as ArrayList;

            if (list != null)
            {
                List <LTShowItemData> gamList = new List <LTShowItemData>();
                for (var i = 0; i < list.Count; ++i)
                {
                    var    item = list[i];
                    string type = EB.Dot.String("type", item, string.Empty);
                    string id   = EB.Dot.String("data", item, string.Empty);
                    int    num  = EB.Dot.Integer("quantity", item, 0);
                    if (list.Count == 1 && (type == LTShowItemType.TYPE_RES || type == LTShowItemType.TYPE_HEROSHARD || id == LTDrawCardConfig.LOTTERY_GOLD_ID || id == LTDrawCardConfig.LOTTERY_HC_ID || type == LTShowItemType.TYPE_ACTIVITY))
                    {
                        if (id == LTDrawCardConfig.LOTTERY_GOLD_ID || id == LTDrawCardConfig.LOTTERY_HC_ID || type == LTShowItemType.TYPE_HEROSHARD || id == LTResID.HcName)
                        {
                            FusionAudio.PostEvent("UI/New/ZuanShi", true);//获取抽奖券、碎片、钻石时播放
                        }
                        else if (id == LTResID.GoldName)
                        {
                            FusionAudio.PostEvent("UI/New/Coin", true);//获得金币时播放
                        }
                        else if (id == LTResID.BuddyExpName)
                        {
                            FusionAudio.PostEvent("UI/New/YaoShui", true);//获得伙伴经验时播放
                        }
                        LTIconNameQuality icon_name_lvl = LTItemInfoTool.GetInfo(id, type);
                        MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, string.Format(EB.Localizer.GetString("ID_codefont_in_LTChallengeInstanceHudController_20066"), icon_name_lvl.name, num));
                        continue;
                    }
                    LTShowItemData itemData = new LTShowItemData(id, num, type);
                    gamList.Add(itemData);
                }

                if (gamList.Count > 0)
                {
                    FusionAudio.PostEvent("UI/New/BaoXiang", true);
                    LTInstanceNodeTemp temp = MapCtrl.GetNodeObjByPos(x, y);
                    if (temp != null)
                    {
                        //首领宝箱奖励
                        var floor = temp as Instance.LTInstanceFloorTemp;
                        if (floor != null && floor.hasOtherModel())
                        {
                            //宝箱表现!
                            floor.ShowBossRewardFX(gamList, UICamera.mainCamera.WorldToScreenPoint(FlyScrollObj.transform.position));
                            return;
                        }
                    }
                    //普通宝箱奖励
                    GlobalMenuManager.Instance.Open("LTShowBoxView", gamList);
                }
            }
        }
Пример #3
0
        public override void SetMenuData(object param)
        {
            controller.gameObject.CustomSetActive(true);
            base.SetMenuData(param);
            if (param != null)
            {
                LTShowItemData    Data = param as LTShowItemData;
                LTIconNameQuality inl  = LTItemInfoTool.GetInfo(Data.id, Data.type);

                if (Data.type.Equals(LTShowItemType.TYPE_HEROSHARD))
                {
                    HeroshardLabel.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTShowGetPartnerController_1021"), Data.count);
                    HeroshardLabel.gameObject.SetActive(true);
                }
                else
                {
                    HeroshardLabel.gameObject.SetActive(false);
                }

                int charTp  = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(int.Parse(Data.id)).character_id;
                var charTpl = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(charTp);

                if (charTpl == null)
                {
                    EB.Debug.LogError("No Character for id = {0}", Data.id);
                    return;
                }

                mModelName = charTpl.model_name;
                isSSR      = charTpl.role_grade >= 4;

                if (isSSR)
                {
                    FusionAudio.PostEvent("UI/New/SSR", true);
                }
                else
                {
                    FusionAudio.PostEvent("UI/New/N", true);
                }

                NameLabel.text         = NameLabel.transform.GetChild(0).GetComponent <UILabel>().text = charTpl.name;
                QualityIcon.spriteName = LTPartnerConfig.PARTNER_GRADE_SPRITE_NAME_DIC[(PartnerGrade)charTpl.role_grade];

                for (int i = 0; i < StarGrid.transform.childCount; i++)
                {
                    StarGrid.transform.GetChild(i).gameObject.SetActive(i < charTpl.init_star);
                }

                StarGrid.Reposition();
            }
        }
Пример #4
0
        public override void OnEnable()
        {
            //base.OnEnable();

            if (mLTItemData != null && Frame != null)
            {
                LTIconNameQuality itemInfo = LTItemInfoTool.GetInfo(mLTItemData.id, mLTItemData.type, mLTItemData.coloring);
                HotfixCreateFX.ShowItemQualityFX(m_QualityFX, m_EffectClip, Frame.transform, int.Parse(itemInfo.quality));
                var t_particle = Frame.transform.GetComponentInChildren <ParticleSystemUIComponent>();
                if (t_particle != null)
                {
                    t_particle.transform.localScale = Vector3.one * (Frame.width / 186f);
                }
            }
        }
Пример #5
0
 public override void OnFetchData(EB.Sparx.Response res, int reqInstanceID)
 {
     if (res.sucessful)
     {
         InitState();
         Hotfix_LT.Data.TaskTemplate tpl  = Hotfix_LT.Data.TaskTemplateManager.Instance.GetTask(mTaskId);
         List <LTShowItemData>       list = TaskStaticData.GetItemRewardList(mTaskId);
         for (int i = 0; i < list.Count; i++)
         {
             LTIconNameQuality icon_name_lvl = LTItemInfoTool.GetInfo(list[i].id, list[i].type);
             MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, string.Format(EB.Localizer.GetString("ID_codefont_in_LTChallengeInstanceHudController_20066"), icon_name_lvl.name, list[i].count));
         }
         Hotfix_LT.Messenger.Raise(EventName.LTChallengeInstaceRewardGet, mLevel);
     }
     else if (res.fatal)
     {
         SparxHub.Instance.FatalError(res.localizedError);
     }
 }
Пример #6
0
        private void OpenBox(object data)
        {
            ArrayList list = data as ArrayList;

            if (list != null)
            {
                List <LTShowItemData> gamList = new List <LTShowItemData>();
                for (var i = 0; i < list.Count; i++)
                {
                    var    item = list[i];
                    string type = EB.Dot.String("type", item, string.Empty);
                    string id   = EB.Dot.String("data", item, string.Empty);
                    int    num  = EB.Dot.Integer("quantity", item, 0);
                    if (list.Count == 1 && (type == LTShowItemType.TYPE_RES || type == LTShowItemType.TYPE_HEROSHARD || id == LTDrawCardConfig.LOTTERY_GOLD_ID || id == LTDrawCardConfig.LOTTERY_HC_ID || type == LTShowItemType.TYPE_ACTIVITY))
                    {
                        if (id == LTDrawCardConfig.LOTTERY_GOLD_ID || id == LTDrawCardConfig.LOTTERY_HC_ID || type == LTShowItemType.TYPE_HEROSHARD || id == LTResID.HcName)
                        {
                            FusionAudio.PostEvent("UI/New/ZuanShi", true);//获取抽奖券、碎片、钻石时播放
                        }
                        else if (id == LTResID.GoldName)
                        {
                            FusionAudio.PostEvent("UI/New/Coin", true);//获得金币时播放
                        }
                        else if (id == LTResID.BuddyExpName)
                        {
                            FusionAudio.PostEvent("UI/New/YaoShui", true);//获得伙伴经验时播放
                        }
                        LTIconNameQuality icon_name_lvl = LTItemInfoTool.GetInfo(id, type);
                        MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, string.Format(EB.Localizer.GetString("ID_codefont_in_LTChallengeInstanceHudController_20066"), icon_name_lvl.name, num));
                        continue;
                    }
                    LTShowItemData itemData = new LTShowItemData(id, num, type);
                    gamList.Add(itemData);
                }
                if (gamList.Count > 0)
                {
                    FusionAudio.PostEvent("UI/New/BaoXiang", true);
                    GlobalMenuManager.Instance.Open("LTShowBoxView", gamList);
                }
            }
        }
Пример #7
0
        public void Show()
        {
            string economyId = "";
            string unhave;
            int    num;

            if (!DataLookupsCache.Instance.SearchDataByID <string>("tooltip.unhave", out unhave, null))
            {
                if (!DataLookupsCache.Instance.SearchDataByID <string>("{" + m_TipTargetStr + "}.economy_id", out economyId, null))
                {
                    EB.Debug.LogError("SearchDataByID {0}.economy_id is null", m_TipTargetStr);
                    return;
                }
                m_InventoryId = InventoryId;
                if (!DataLookupsCache.Instance.SearchIntByID(m_InventoryId + ".num", out num, null))
                {
                    EB.Debug.LogError("SearchDataByID inventory_id==null");
                }
            }
            else
            {
                if (!DataLookupsCache.Instance.SearchDataByID <string>(m_TipTargetStr, out economyId, null))
                {
                    EB.Debug.LogError("SearchDataByID {0} is null", m_TipTargetStr);
                    return;
                }
                num = GameItemUtil.GetInventoryItemNum(economyId);
            }

            LTIconNameQuality inl = LTItemInfoTool.GetInfo(economyId, LTShowItemType.TYPE_GAMINVENTORY);

            m_Icon.spriteName    = inl.icon;
            m_Frame.spriteName   = UIItemLvlDataLookup.LvlToStr(inl.quality);
            m_FrameBG.spriteName = UIItemLvlDataLookup.GetItemFrameBGSprite(inl.quality);
            m_FrameBG.color      = UIItemLvlDataLookup.GetItemFrameBGColor(inl.quality);
            m_QualityLevel       = int.Parse(inl.quality);
            LTUIUtil.SetText(m_GoodsName, inl.name);
            var itemInfo = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetGeneral(economyId);

            if (itemInfo != null)
            {
                m_ClipFlag.CustomSetActive(itemInfo.System == "HeroShard");
            }
            else
            {
                m_ClipFlag.CustomSetActive(false);
            }

            string equipSuitIconStr = Hotfix_LT.Data.EconemyTemplateManager.GetEquipSuitIcon(economyId);

            if (string.IsNullOrEmpty(equipSuitIconStr))
            {
                m_EquipSuitIcon.gameObject.CustomSetActive(false);

                string suitIcon = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetEquipSuit(economyId);
                if (!string.IsNullOrEmpty(suitIcon))
                {
                    m_EquipSuitIcon.gameObject.CustomSetActive(true);
                    m_EquipSuitIcon.spriteName = suitIcon;
                }
            }
            else
            {
                m_EquipSuitIcon.gameObject.CustomSetActive(true);
                m_EquipSuitIcon.spriteName = equipSuitIconStr;
            }

            int grade = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetGoodsGradeNum(economyId);

            m_boxGradeNumLab.gameObject.CustomSetActive(grade != 0);
            if (grade != 0)
            {
                m_boxGradeNumLab.text = string.Format("+{0}", grade);
            }

            var item = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(economyId);

            if (item.DropDatas.Count <= 0)
            {
                DropItemsRoot.gameObject.CustomSetActive(true);
                UpdateDrop(item);
            }
            else
            {
                DropItemsRoot.gameObject.CustomSetActive(true);
                UpdateDrop(item);
            }
            ItemInfo.InventoryId = m_InventoryId;
            ItemInfo.EconomyId   = economyId;
            ItemInfo.Num         = num;
            LTUIUtil.SetText(m_NumLabel, EB.Localizer.GetString("ID_LABEL_NAME_HADE") + num);

            //从伙伴进阶界面打开跳转界面需要做刷新伙伴进阶界面操作
            if (!string.IsNullOrEmpty(LTPartnerDataManager.Instance.itemID))
            {
                Hotfix_LT.Messenger.Raise(Hotfix_LT.EventName.OnPartnerUIRefresh, CultivateType.UpGrade);
            }

            IconParent.CustomSetActive(true);
        }