コード例 #1
0
        //主线任务打开副本界面
        public static void StartTaskCampaignFinding(string taskid, bool isMainCampaign)
        {
            if (AllianceUtil.IsInTransferDart)
            {
                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_TaskSystem_5855"));
                return;
            }
            if (isMainCampaign)
            {
                string campaign_name = Hotfix_LT.Data.TaskTemplateManager.Instance.GetTask(taskid).target_parameter_1;
                Hotfix_LT.Data.LostMainCampaignsTemplate campaignData = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostMainCampaignTplById(campaign_name);

                if (!LTInstanceUtil.GetChapterIsOpen(int.Parse(campaignData.ChapterId)))
                {
                    MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_TaskSystem_17027"));
                    return;
                }
                Action act = new Action(delegate
                {
                    LTMainInstanceHudController.EnterInstance(campaignData.ChapterId);
                });
                UIStack.Instance.ShowLoadingScreen(act, false, true, true);
            }
            else
            {
                Hotfix_LT.Data.FuncTemplate ft = Hotfix_LT.Data.FuncTemplateManager.Instance.GetFunc(10065);
                if (ft != null && !ft.IsConditionOK())
                {
                    MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, ft.GetConditionStr());
                    return;
                }
                GlobalMenuManager.Instance.Open("LTChallengeInstanceSelectHud");
            }
        }
コード例 #2
0
        public void OnClickArtifactBtn()
        {
            if (HaveArtifact())
            {
                if (!LTInstanceUtil.IsCampaignsComplete(t_camid))
                {
                    var t_targetcampaign = Data.SceneTemplateManager.Instance.GetLostMainCampaignTplById(t_camid);
                    MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, string.Format(EB.Localizer.GetString("ID_FUNC_OPENTIP_2"), t_targetcampaign.Name));
                    return;
                }


                if (data.Star < star)
                {
                    MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, string.Format(EB.Localizer.GetString("ID_ARTIFACT_STAR_TIP"), star));
                    return;
                }
                // GlobalMenuManager.Instance.Open("LTArtifactUIHud");
                GlobalMenuManager.Instance.Open("LTArtifactDetailUIHud", infoId);
            }
            else
            {
                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, Localizer.GetString("ID_ARTIFACT_NO_TIP"));
            }
        }
コード例 #3
0
 public override void OnCancelButtonClick()
 {
     if (isMoving)
     {
         return;
     }
     //新手引导特殊处理
     if (GuideNodeManager.IsGuide && !LTInstanceUtil.IsFirstChapterCompleted())
     {
         if (clickCount >= 3)
         {
             clickCount = 0;
             MessageTemplateManager.ShowMessage(901099, null, delegate(int result)
             {
                 if (result == 0)
                 {
                     GuideNodeManager.currentGuideId = 0;
                     GuideNodeManager.GetInstance().JumpGuide();//跳过主线
                 }
                 return;
             });
         }
         clickCount++;
         MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString(GuideNodeManager.GUIDE_CANNOT_RETURN));
         return;
     }
     GlobalMenuManager.Instance.RemoveCache("LTInstanceMapHud");
     base.OnCancelButtonClick();
 }
コード例 #4
0
        private IEnumerator ResetScroll()
        {
            DataList = LTInstanceUtil.GetBlitzDataChange();
            DynamicScroll.Clear();
            yield return(null);

            InitUI();
        }
コード例 #5
0
        public void OnLevelSelect(int lv)
        {
            mLevel = lv;
            int level = LTInstanceUtil.GetChallengeLevel(mLevel);

            mTaskId = 7000 + level;
            InitState();
            InitItem();
        }
コード例 #6
0
        public override IEnumerator OnAddToStack()
        {
            yield return(base.OnAddToStack());

            DataLookupsCache.Instance.SearchIntByID("userCampaignStatus.challengeChapters.curLevel", out m_CurLevel);

            int showLevel = LTInstanceUtil.GetChallengeLevel(m_CurLevel);

            LTUIUtil.SetText(LevelLabel, string.Format(EB.Localizer.GetString("ID_codefont_in_LTChallengeInstanceLoadCtrl_1580"), showLevel));
        }
コード例 #7
0
        public void OnMultiBlitzBtnClick()
        {
            if (campaignId <= 0)
            {
                return;
            }

            Hotfix_LT.Data.FuncTemplate ft = Hotfix_LT.Data.FuncTemplateManager.Instance.GetFunc(10077);
            if (ft != null && !ft.IsConditionOK())
            {
                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, ft.GetConditionStr());
                return;
            }

            int vaildTimes = IsVigorEnough(10);

            if (vaildTimes <= 0)
            {
                BalanceResourceUtil.TurnToVigorGotView();
                return;
            }

            if (isRequest)
            {
                return;
            }
            InputBlockerManager.Instance.Block(InputBlockReason.FUSION_BLOCK_UI_INTERACTION, 0.5f);
            isRequest = true;

            if (mCallback != null)
            {
                mCallback();
            }

            LTInstanceMapModel.Instance.RequestMainBlitzCampaign(campaignId, vaildTimes, delegate
            {
                isRequest = false;
                List <LTMainInstanceBlitzData> list = LTInstanceUtil.GetBlitzData();
                for (int i = 0; i < list.Count; ++i)
                {
                    FusionTelemetry.ItemsUmengCurrency(list[i].ItemList, "主线扫荡");
                }

                Hashtable data = Johny.HashtablePool.Claim();
                data.Add("list", list);
                data.Add("num", 10);
                data.Add("ItemId", mTargetItemId);
                GlobalMenuManager.Instance.Open("LTMainInstanceBlitzView", data);

                if (!string.IsNullOrEmpty(mTargetItemId))
                {
                    controller.Close();
                }
            });
        }
コード例 #8
0
        public override void OnCancelButtonClick()
        {
            FusionAudio.PostEvent("UI/General/ButtonClick");
            if (!MapCtrl.IsPlayerReady() || LTInstanceMapModel.Instance.moveResultList.Count > 0) { return; }

            MapCtrl.InstanceWaitUpdataMap(delegate
            {
                MapCtrl.ClearMoveActionList();
                if (GuideNodeManager.IsGuide && !LTInstanceUtil.IsFirstChapterCompleted())
                {
                    if (clickCount >= 3)
                    {
                        clickCount = 0;
                        MessageTemplateManager.ShowMessage(901099, null, delegate (int result)
                        {
                            if (result == 0)
                            {
                                GuideNodeManager.currentGuideId = 0;
                                GuideNodeManager.GetInstance().JumpGuide();//跳过主线
                            }
                            return;
                        });
                    }
                    clickCount++;
                    MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString(GuideNodeManager.GUIDE_CANNOT_RETURN));
                    return;
                }

                if (LTInstanceMapModel.Instance.NotMainChapterId())
                {
                    if (LTInstanceMapModel.Instance.IsInsatnceViewAction())
                    {
                        LTInstanceMapModel.Instance.SwitchViewAction(false, true, delegate
                        {
                            if(controller!=null) controller.Close();
                        });
                    }
                    return;
                }
                
                LTInstanceMapModel.Instance.ClearInstanceData();
                LTInstanceMapModel.Instance.RequestLeaveChapter("main", delegate
                {
                    if (LTInstanceMapModel.Instance.IsInsatnceViewAction())
                    {
                        LTInstanceMapModel.Instance.SwitchViewAction(false, true, delegate
                        {
                            if (controller != null) controller.Close();
                        });
                    }
                });
            });
        }
コード例 #9
0
 //主线副本快速获取
 public void OnQuicklyGetButtonClick(int campaignId)
 {
     LTInstanceMapModel.Instance.RequestMainBlitzCampaign(campaignId, sweepsNumber, delegate
     {
         List <LTShowItemData> list = LTInstanceUtil.GetQuicklyBlitzData();
         GlobalMenuManager.Instance.Open("LTShowRewardView", list);
         //处理后续显示,以及伙伴界面刷新
         //Fill(curId, curNeednum);
         //controller.FillMaterial();
         Hotfix_LT.Messenger.Raise(Hotfix_LT.EventName.OnPartnerUIRefresh, CultivateType.UpGrade);
     });
 }
コード例 #10
0
        public void Init(Hotfix_LT.Data.LostMainChapterTemplate data)
        {
            m_ChapterData         = data;
            mDMono.transform.name = m_ChapterData.Id;
            chapterId             = int.Parse(m_ChapterData.Id);
            newChapterFX.CustomSetActive(false);
            ContainerObj.CustomSetActive(true);

            BGSprite.spriteName = m_ChapterData.Icon;
            if (m_ChapterData.IsBoxRewardType())
            {
                InfoObj.CustomSetActive(false);
                BoxTipObj.CustomSetActive(true);
                PerfectObj.CustomSetActive(false);
                int mForwardChapterId = 0;
                int.TryParse(m_ChapterData.ForwardChapterId, out mForwardChapterId);
                BoxLabel.text = string.Format(EB.Localizer.GetString("ID_INSTANCE_MAP_BOX_REWRAD_TIP"), mForwardChapterId % 100);
                if (LTInstanceUtil.IsChapterComplete(m_ChapterData.ForwardChapterId))
                {
                    if (LTInstanceMapModel.Instance.GetMainChapterRewardState(m_ChapterData.Id))
                    {
                        ContainerObj.CustomSetActive(false);
                    }
                    else
                    {
                        RedPoint.CustomSetActive(true);
                    }
                }
                else
                {
                    RedPoint.CustomSetActive(false);
                }
                BGSprite.target.width  = 376;
                BGSprite.target.height = 360;
            }
            else
            {
                InfoObj.CustomSetActive(true);
                BoxTipObj.CustomSetActive(false);

                int allStarNum  = LTInstanceUtil.GetChapterCurStarNum(m_ChapterData.Id);
                int fullStarNum = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostMainChapterMaxStarNumById(m_ChapterData.Id);
                PerfectObj.CustomSetActive(LTInstanceUtil.GetChapterIsPerfectComplete(m_ChapterData.Id) && allStarNum == fullStarNum);
                StarLabel.text = string.Format("{0}{1}/{2}", (allStarNum >= fullStarNum) ? "[42fe76]" : "", allStarNum, fullStarNum);
                NameLabel.text = m_ChapterData.Name;
                UpdateRedPoint();
                BGSprite.target.width  = 360;
                BGSprite.target.height = 420;
            }
            mDMono.transform.localPosition = data.ChapterPos;
            mDMono.gameObject.CustomSetActive(true);
        }
コード例 #11
0
        //创建已开放章节列表
        private void InitChapter()
        {
            Hashtable chapterData;

            DataLookupsCache.Instance.SearchDataByID <Hashtable>("userCampaignStatus.normalChapters", out chapterData);
            openChapterIds.Clear();
            if (!openChapterIds.Contains("101"))
            {
                openChapterIds.Add("101");
            }
            if (chapterData != null)
            {
                foreach (DictionaryEntry data in chapterData)
                {
                    string chapterId = data.Key.ToString();
                    if (!openChapterIds.Contains(chapterId))
                    {
                        openChapterIds.Add(chapterId);
                    }
                }
            }
            List <Data.LostMainChapterTemplate> temps = Data.SceneTemplateManager.Instance.GetLostMainChapterBoxRewards();

            for (int i = 0; i < temps.Count; ++i)
            {
                if (!openChapterIds.Contains(temps[i].Id))
                {
                    openChapterIds.Add(temps[i].Id);
                }
            }

            string maxChapter = Hotfix_LT.Data.SceneTemplateManager.Instance.GetMaxChapter(openChapterIds);

            Hotfix_LT.Data.LostMainChapterTemplate tpl = Hotfix_LT.Data.SceneTemplateManager.Instance.GetNextChapter(maxChapter);
            if (tpl != null && LTInstanceUtil.IsChapterComplete(maxChapter))
            {
                openChapterIds.Add(tpl.Id);
                newChapterId = vaildMaxChapter = tpl.Id;
                maxLandId    = int.Parse(tpl.LandId);
            }
            else
            {
                newChapterId    = string.Empty;
                vaildMaxChapter = maxChapter;
                Hotfix_LT.Data.LostMainChapterTemplate cur = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostMainChatpterTplById(maxChapter);
                maxLandId = int.Parse(cur.LandId);
            }
        }
コード例 #12
0
        /// <summary>
        /// 根据关卡ID判定关卡所在章节能否进入
        /// </summary>
        /// <param name="campaignId"></param>
        /// <returns></returns>
        public static bool GetChapterIsPassByCampaignId(string campaignId)
        {
            Hotfix_LT.Data.LostMainCampaignsTemplate campaignData = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostMainCampaignTplById(campaignId);
            if (campaignData == null)
            {
                return(false);
            }

            Hotfix_LT.Data.LostMainChapterTemplate chapterData = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostMainChatpterTplById(campaignData.ChapterId);
            if (chapterData == null)
            {
                return(false);
            }

            return(BalanceResourceUtil.GetUserLevel() >= chapterData.LevelLimit && LTInstanceUtil.IsPreChapterComplete(campaignData.ChapterId) && GetIsChapterLimitConditionComplete(chapterData, out int num));
        }
コード例 #13
0
        private IEnumerator ResetScroll()
        {
            DataList = LTInstanceUtil.GetBlitzData();
            DynamicScroll.Clear();

            /*TweenScale[] tsArray = DynamicScroll.GetComponentsInChildren<TweenScale>(true);
             * for (int i = 0; i < tsArray.Length; i++)
             * {
             *  tsArray[i].enabled = true;
             *  tsArray[i].ResetToBeginning();
             * }*/
            yield return(null);

            InitUI();
            isNotCallBack = false;
        }
コード例 #14
0
        private void UpdateRedPoint()
        {
            bool IsBoxOpen = true;
            int  starNum   = LTInstanceUtil.GetChapterCurStarNum(m_ChapterData.Id);

            foreach (int key in m_ChapterData.RewardDataDic.Keys)
            {
                if (starNum >= key)
                {
                    IsBoxOpen = LTInstanceUtil.IsChapterStarBoxOpen(m_ChapterData.Id, key);
                }
                if (!IsBoxOpen)
                {
                    break;
                }
            }
            RedPoint.CustomSetActive(!IsBoxOpen);
        }
コード例 #15
0
        public override void Fill(Hotfix_LT.Data.LostChallengeChapter itemData)
        {
            curLevelData = itemData;

            int maxLevel = 0;

            DataLookupsCache.Instance.SearchIntByID("userCampaignStatus.challengeChapters.bigFloor", out maxLevel);

            isLock = curLevelData.CurChapter > maxLevel + 1;

            UnlockTran.gameObject.CustomSetActive(!isLock);

            LockTran.gameObject.CustomSetActive(isLock);

            if (!isLock)
            {
                int level = curLevelData.CurChapter;
                LevelNumLabel.text = string.Format(EB.Localizer.GetString("ID_codefont_in_EconomyTemplateManager_68326"), level);

                SelectSprite.gameObject.CustomSetActive(curLevelData.Level == LTChallengeInstanceSelectHudController.CurSelectLevel);

                int    taskId = 7000 + curLevelData.CurChapter;
                string state  = string.Empty;
                DataLookupsCache.Instance.SearchDataByID(string.Format("tasks.{0}.state", taskId), out state);
                RedPoint.CustomSetActive(state == "finished");

                int floor = LTInstanceUtil.GetChallengeLevel(curLevelData.Level);
                Hotfix_LT.Data.LostChallengeRewardTemplate temp = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostChallengeReward(System.DateTime.Now.DayOfWeek, floor);
                if (temp != null)
                {
                    string id   = temp.DropList[0];
                    var    item = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(id);
                    BGSprite.spriteName = string.Format("Goods_Source_Tiaozhanfuben_{0}", item.QualityLevel - 1);
                }
            }
            else
            {
                RedPoint.CustomSetActive(false);
            }
        }
コード例 #16
0
        //等级改变
        public override void OnLookupUpdate(string dataID, object value)
        {
            if (value == null)
            {
                return;
            }

            if (dataID.Equals("level") && int.TryParse(value.ToString(), out int temp) && temp != currentLevel)
            {
                currentLevel = temp;
                UpdateUI();
            }
            else if (dataID.Equals("userCampaignStatus.normalChapters") && !value.Equals(olddata))
            {
                olddata = value;
                UpdateUI();
            }
            if (dataID.Equals("userCampaignStatus.normalChapters"))
            {
                LTInstanceUtil.GetCurMaxCompleteCampaignId(value as Hashtable);
            }
        }
コード例 #17
0
        private void UpdateGotoBtnRP()
        {
            controller.GObjects["MoveToLeftRP"].CustomSetActive(false);
            controller.GObjects["MoveToRightRP"].CustomSetActive(false);
            bool left  = false;
            bool right = false;
            var  list  = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostMainChapterBoxRewards();

            for (int i = 0; i < list.Count; ++i)
            {
                int land = int.Parse(list[i].LandId);
                if (currentLandId == land)
                {
                    continue;
                }
                if (left && currentLandId > land)
                {
                    continue;
                }
                if (right && currentLandId < land)
                {
                    continue;
                }

                if (LTInstanceUtil.IsChapterComplete(list[i].ForwardChapterId) && !LTInstanceMapModel.Instance.GetMainChapterRewardState(list[i].Id))
                {
                    if (currentLandId > land)
                    {
                        controller.GObjects["MoveToLeftRP"].CustomSetActive(true);
                        left = true;
                    }
                    if (currentLandId < land)
                    {
                        controller.GObjects["MoveToRightRP"].CustomSetActive(true);
                        right = true;
                    }
                }
            }
        }
コード例 #18
0
        /// <summary>
        /// 更新掉落物品信息
        /// </summary>
        private void InitDrop()
        {
            int floor = LTInstanceUtil.GetChallengeLevel(CurSelectLevel);

            Hotfix_LT.Data.LostChallengeRewardTemplate temp = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostChallengeReward(System.DateTime.Now.DayOfWeek, floor);
            List <string> itemList = temp.DropList;

            if (itemList != null)
            {
                for (int i = 0; i < DropItemList.Count; i++)
                {
                    if (i < itemList.Count)
                    {
                        DropItemList[i].mDMono.gameObject.CustomSetActive(true);
                        DropItemList[i].LTItemData = new LTShowItemData(itemList[i], 0, LTShowItemType.TYPE_GAMINVENTORY);
                        DropItemList[i].SetDropRateText(string.Format("{0}%", temp.DropRate * 100));
                    }
                    else
                    {
                        DropItemList[i].mDMono.gameObject.CustomSetActive(false);
                    }
                }
            }
            if (DropItemList.Count > 0)
            {
                if (BGFxList != null)
                {
                    int select = DropItemList[0].QualityLevel - 2;
                    for (var i = 0; i < BGFxList.Count; ++i)
                    {
                        var fx = BGFxList[i];
                        fx.gameObject.CustomSetActive(i == select);
                    }
                }
            }

            ShowHideItemEquipmentWish();
        }
コード例 #19
0
        public void OnStarBoxClick(GameObject box)
        {
            int needNum = int.Parse(box.name);

            int ownNum = LTInstanceUtil.GetChapterStarNum(LTInstanceMapModel.Instance.MainChapterId);

            List<LTShowItemData> itemList = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostMainChapterStarReward(LTInstanceMapModel.Instance.MainChapterId, needNum);
            if (itemList == null)
            {
                EB.Debug.LogError("GetLostMainChapterStarReward: not found, itemList is null, chapterId = {0}, starNum = {1}", LTInstanceMapModel.Instance.MainChapterId, needNum);
                return;
            }

            if (ownNum >= needNum)
            {
                LTInstanceMapModel.Instance.RequestMainGetStarReward(needNum, LTInstanceMapModel.Instance.MainChapterId, delegate
                {
                    if (itemList.Count > 0)
                    {
                        InitStarBox();
                        //上传友盟获得钻石,主线
                        List<LTShowItemData> mlist = itemList;
                        FusionTelemetry.ItemsUmengCurrency(itemList, "主线副本");

                        GlobalMenuManager.Instance.Open("LTShowRewardView", itemList);
                    }
                });
            }
            else
            {
                string tip = string.Format(EB.Localizer.GetString("ID_codefont_in_LTMainInstanceHudController_10032"), needNum);
                Hashtable data = Johny.HashtablePool.Claim();
                data.Add("data", itemList);
                data.Add("tip", tip);

                GlobalMenuManager.Instance.Open("LTRewardShowUI", data);
            }
        }
コード例 #20
0
        public static bool GetChapterIsOpen(int chapterId)
        {
            Hashtable chapterData = Johny.HashtablePool.Claim();

            DataLookupsCache.Instance.SearchHashtableByID("userCampaignStatus.normalChapters", out chapterData);
            int maxChapterId = 101;

            foreach (DictionaryEntry data in chapterData)
            {
                int chapterIntId = int.Parse(data.Key.ToString());
                if (chapterIntId > maxChapterId)
                {
                    maxChapterId = chapterIntId;
                }
            }
            Hotfix_LT.Data.LostMainChapterTemplate tpl = Hotfix_LT.Data.SceneTemplateManager.Instance.GetNextChapter(maxChapterId.ToString());
            if (tpl != null && LTInstanceUtil.IsChapterComplete(maxChapterId.ToString()) && BalanceResourceUtil.GetUserLevel() >= tpl.LevelLimit && LTInstanceUtil.GetIsChapterLimitConditionComplete(tpl, out int num))
            {
                maxChapterId = int.Parse(tpl.Id);
            }

            return(chapterId <= maxChapterId);
        }
コード例 #21
0
 public void ShowStarBox()
 {
     //检查宝箱是否可领取,可领取情况帮忙自动领取
     int starNum = LTInstanceUtil.GetChapterCurStarNum(mChapterTpl.Id);
     foreach (int key in mChapterTpl.RewardDataDic.Keys)
     {
         if (starNum >= key)
         {
             if (!LTInstanceUtil.IsChapterStarBoxOpen(mChapterTpl.Id, key))
             {
                 isShowingBoxReward = true;
                 LTInstanceMapModel.Instance.RequestMainGetStarReward(key, LTInstanceMapModel.Instance.MainChapterId, delegate
                 {
                     List<LTShowItemData> itemList = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostMainChapterStarReward(LTInstanceMapModel.Instance.MainChapterId, key);
                     if (itemList != null && itemList.Count > 0)
                     {
                         InitStarBox();
                         //上传友盟获得钻石,主线
                         FusionTelemetry.ItemsUmengCurrency(itemList, "主线副本");
                         System .Action callback =delegate { isShowingBoxReward = false; } ;
                         var ht = Johny.HashtablePool.Claim();
                         ht["reward"] = itemList;
                         ht["callback"] = callback;
                         ht["title"] =EB.Localizer .GetString("ID_MAIN_INSTANCE_BOX_REWRAD_TIP");
                         GlobalMenuManager.Instance.Open("LTShowBoxView", ht);
                     }
                     else
                     {
                         isShowingBoxReward = false;
                     }
                 });
                 break;
             }
         }
     }
 }
コード例 #22
0
        private void InitStarBox()
        {
            int curStarNum = LTInstanceUtil.GetChapterStarNum(LTInstanceMapModel.Instance.MainChapterId);
            int maxStarNum = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostMainChapterMaxStarNumById(LTInstanceMapModel.Instance.MainChapterId);
            StarNumLabel.text = string.Format("{0}/{1}", curStarNum, maxStarNum);
            StarSlider.value = (float)curStarNum / (float)maxStarNum;

            List<int> starNumList = new List<int>(mChapterTpl.RewardDataDic.Keys);
            for (int i = 0; i < StarBoxList.Count; i++)
            {
                if (i < starNumList.Count)
                {
                    if (maxStarNum == 0) return;
                    StarBoxList[i].CustomSetActive(true);
                    StarBoxList[i].name = starNumList[i].ToString();
                    StarBoxList[i].transform.Find("Num").GetComponent<UILabel>().text = string.Format("x{0}", starNumList[i]);
                    StarBoxList[i].transform.localPosition = new Vector2(((float)starNumList[i] / (float)maxStarNum - 0.5f) * BackBarSprite.localSize.x, StarBoxList[i].transform.localPosition.y);
                    SetStarBoxTween(StarBoxList[i], false);
                    bool isOpen = LTInstanceUtil.IsChapterStarBoxOpen(LTInstanceMapModel.Instance.MainChapterId, starNumList[i]);
                    StarBoxList[i].transform.Find("Open").gameObject.CustomSetActive(isOpen);
                    StarBoxList[i].GetComponent<BoxCollider>("Box").enabled = !isOpen;
                    if (!isOpen)
                    {
                        if (curStarNum >= starNumList[i])
                        {
                            SetStarBoxTween(StarBoxList[i], true);
                        }
                    }
                }
                else
                {
                    StarBoxList[i].CustomSetActive(false);
                }
            }

        }
コード例 #23
0
 public override void OnCancelButtonClick()
 {
     if (FxLimit)
     {
         return;
     }
     if (GuideNodeManager.IsGuide && !MengBanController.Instance.controller.gameObject.activeSelf && !LTInstanceUtil.IsFirstChapterCompleted())
     {
         InputBlockerManager.Instance.Block(InputBlockReason.CONVERT_FLY_ANIM, 1f);
         GlobalMenuManager.Instance.CloseMenu("LTDrawCardTypeUI");
     }
     base.OnCancelButtonClick();
 }
コード例 #24
0
        /// <summary>
        /// 主线副本途径处理
        /// </summary>
        /// <param name="materialId"></param>
        /// <param name="NeedNum"></param>
        private void SetSceneGet(int materialId, int NeedNum, bool isDouble)
        {
            //双倍材料显示
            rate = isDouble ? ActivityUtil.GetTimeLimitActivityMulWithoutReLog(1002) : 1.0f;
            if (isDouble)
            {
                RateObj.CustomSetActive(true);
                RateLabel.text = "×" + rate.ToString();
            }
            else
            {
                RateObj.CustomSetActive(false);
            }
            SceneDropData tempDrop = dropData as SceneDropData;

            dropPath1 = EconemyTemplateManager.Instance.GetItem(materialId).DropChickId1;
            string[] chapterId = dropPath1.Split(':')[1].Split('_');
            LostMainChapterTemplate chapterData = SceneTemplateManager.Instance.GetLostMainChatpterTplById(chapterId[0]);

            DataLookupsCache.Instance.SearchDataByID <int>(string.Format("userCampaignStatus.normalChapters.{0}.campaigns.{1}.star", chapterId[0], chapterId[1]), out m_StarNum);
            DataLookupsCache.Instance.SearchDataByID <bool>(string.Format("userCampaignStatus.normalChapters.{0}.campaigns.{1}.complete", chapterId[0], chapterId[1]), out m_IsComplete);
            if (BalanceResourceUtil.GetUserLevel() < chapterData.LevelLimit || !LTInstanceUtil.GetIsChapterLimitConditionComplete(chapterData, out int num) || !LTInstanceUtil.IsPreChapterComplete(chapterId[0]) || !m_IsComplete)//等级未达到解锁条件,或者前置关卡未解锁
            {
                CenterShowLabel.gameObject.CustomSetActive(false);
                ToGetButton.GetComponent <UISprite>().spriteName = "Ty_Button_4";
                if (ToGetButton.clickEvent != null)
                {
                    ToGetButton.clickEvent.Clear();
                    ToGetButton.clickEvent.Add(new EventDelegate(ToCurMaxChapterTip));
                }
                QuicklyGet.CustomSetActive(false);
                LockObj.gameObject.CustomSetActive(true);
                UnLockChapter.text     = UnLockChapter.transform.GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_PARTNER_UPGRADE_TIP_2");
                UnlockChapterName.text = UnlockChapterName.transform.GetChild(0).GetComponent <UILabel>().text = string.Format(EB.Localizer.GetString("ID_PARTNER_UPGRADE_TIP_10"), chapterData.Name);
            }
            else if (m_IsComplete && m_StarNum < 3)
            {
                CenterShowLabel.gameObject.CustomSetActive(true);
                CenterShowLabel.text = CenterShowLabel.transform.GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_PARTNER_UPGRADE_TIP_1");
                if (ToGetButton.clickEvent != null)
                {
                    ToGetButton.clickEvent.Clear();
                }
                ToGetButton.clickEvent.Add(new EventDelegate(() => GotoSceneChapter(int.Parse(chapterId[1]), materialId.ToString())));
                //ToGetButton.GetComponent<UISprite>().color = new Color(1, 1, 1);
                //ToGetButton.GetComponent<BoxCollider>().enabled = true;
                QuicklyGet.CustomSetActive(false);
                LockObj.gameObject.CustomSetActive(false);
            }
            else if (m_IsComplete && m_StarNum == 3)//可以扫荡
            {
                CenterShowLabel.gameObject.CustomSetActive(false);
                //ToGetButton.GetComponent<UISprite>().color = new Color(1, 1, 1);
                //ToGetButton.GetComponent<BoxCollider>().enabled = true;
                costPerCam  = SceneTemplateManager.Instance.GetLostMainCampaignTplById(chapterId[1]).CostVigor;
                totalvigour = Mathf.CeilToInt((NeedNum - materialNum) / rate) * costPerCam;
                DataLookupsCache.Instance.SearchDataByID <int>("res.vigor.v", out curVigour);
                QuicklyGet.CustomSetActive(true);
                if (ToGetButton.clickEvent != null)
                {
                    ToGetButton.clickEvent.Clear();
                }
                if (curVigour >= totalvigour)
                {
                    sweepsNumber = Mathf.CeilToInt((NeedNum - materialNum) / (rate * 1));
                    ToGetButton.clickEvent.Add(new EventDelegate(() => OnQuicklyGetButtonClick(int.Parse(chapterId[1]))));
                    showVigour = totalvigour;
                    colorStr   = LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal;
                }
                else if (curVigour < totalvigour && curVigour >= costPerCam)
                {
                    sweepsNumber = curVigour / costPerCam;
                    showVigour   = sweepsNumber * costPerCam;
                    ToGetButton.clickEvent.Add(new EventDelegate(() => OnQuicklyGetButtonClick(int.Parse(chapterId[1]))));
                    colorStr = LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal;
                }
                else
                {
                    showVigour = totalvigour;
                    colorStr   = LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal;
                    ToGetButton.clickEvent.Add(new EventDelegate(() => BalanceResourceUtil.TurnToVigorGotView()));
                }

                VigourCost.text = VigourCost.transform.GetChild(0).GetComponent <UILabel>().text = string.Format(LT.Hotfix.Utility.ColorUtility.ColorStringFormat, colorStr, showVigour);
                LockObj.gameObject.CustomSetActive(false);
            }
        }
コード例 #25
0
        public void OnChapterClick()
        {
            if (m_ChapterData.IsBoxRewardType())
            {
                if (!LTInstanceUtil.IsChapterComplete(m_ChapterData.ForwardChapterId))
                {
                    int FC = 0;
                    int.TryParse(m_ChapterData.ForwardChapterId, out FC);
                    MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, string.Format(EB.Localizer.GetString("ID_INSTANCE_MAP_BOX_REWRAD_TIP2"), FC % 100));
                    return;
                }
                if (LTInstanceMapModel.Instance.GetMainChapterRewardState(m_ChapterData.Id))
                {
                    return;
                }
                LTInstanceMapModel.Instance.RequestMainChapterReward(m_ChapterData.Id, delegate
                {
                    ContainerObj.CustomSetActive(false);
                    GlobalMenuManager.Instance.Open("LTShowRewardView", m_ChapterData.RewardDataDic[0]);
                });
                return;
            }

            FusionAudio.PostEvent("UI/General/ButtonClick", true);
            if (AllianceUtil.GetIsInTransferDart("ID_CAMPAGIN"))
            {
                return;
            }

            //此处判断进阶条件是否满足
            if (!LTInstanceUtil.GetIsChapterLimitConditionComplete(m_ChapterData, out int currNum))
            {
                //打开跳转界面
                GlobalMenuManager.Instance.Open("PlayerUpgradeTipView", new int[3] {
                    m_ChapterData.Limitparam2, m_ChapterData.Limitparam1, currNum
                });
                return;
            }
            if (BalanceResourceUtil.GetUserLevel() < m_ChapterData.LevelLimit)
            {
                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, string.Format(EB.Localizer.GetString("ID_codefont_in_LTInstanceMapChapterCtrl_2697"), m_ChapterData.LevelLimit));
                //GlobalMenuManager.Instance.Open("LTPlayerLevelUpTipView", "Levelup");
                return;
            }

            //主线章节入口
            if (LTInstanceMapHudController.curChapterID != null && LTInstanceMapHudController.curChapterID != m_ChapterData.Id)
            {
                return;
            }
            LTInstanceMapHudController.curChapterID = m_ChapterData.Id;

            if (!string.IsNullOrEmpty(m_ChapterData.BeforeChapter))
            {
                string flagStr = PlayerPrefs.GetString(LoginManager.Instance.LocalUserId.Value + m_ChapterData.BeforeChapter);

                if (string.IsNullOrEmpty(flagStr))
                {
                    LTStoryController.OpenStory(OnChapterClick, m_ChapterData.BeforeChapter);
                    PlayerPrefs.SetString(LoginManager.Instance.LocalUserId.Value + m_ChapterData.BeforeChapter, "True");//本地临时保存,等服务器做好了会保存到服务器
                    PlayerPrefs.Save();
                    return;
                }
            }
            Action act = new Action(delegate
            {
                LTMainInstanceHudController.EnterInstance(m_ChapterData.Id);
                LTInstanceMapHudController.curChapterID = null;
            });

            Hotfix_LT.Messenger.Raise(Hotfix_LT.EventName.PlayCloudFxEvent, act);
        }