Ejemplo n.º 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");
            }
        }
Ejemplo n.º 2
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);
        }