local Dialogue_Controller = {} local private = {} local CONST_BARRIER_RANK_LIMIT = 10000 local CONST_BARRIER_CHAPTER_LIMIT = 100 local enums_pb = require("Proto/enums_pb") function Dialogue_Controller.OpenUI(uiName,param1, param2, param3) local context if uiName == "UILevelSelectPanel" then context = private.AnalysisLevelSelect(param1) elseif uiName == "UIGoldenHeroStory" then if not MDL.Unlock.IsUnlock(MDL.Unlock.FunctionType.GoldHeroActivity) then CTL.Tips.AddTipsMsg(Const_IDS.IDS_GoldHeroActivity_ActivityLevel_LockHint1) return end context = { heroType = tonumber(param1), levelId = tonumber(param2), activityId = tonumber(param3), } elseif uiName == "UISuperGoldStoryMain" then if not MDL.Unlock.IsUnlock(MDL.Unlock.FunctionType.SuperGoldActivity) then CTL.Tips.AddTipsMsg(Const_IDS.IDS_GoldHeroActivity_ActivityLevel_LockHint1) return end context = { heroType = tonumber(param1), levelId = tonumber(param2), activityId = tonumber(param3), } end UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum[uiName], context) end function private.AnalysisLevelSelect(param) local context = {} local paramInt = param context.difficult = math.modf(paramInt/CONST_BARRIER_RANK_LIMIT) context.chapterId = math.floor(paramInt / CONST_BARRIER_CHAPTER_LIMIT) context.index = paramInt % CONST_BARRIER_CHAPTER_LIMIT context.levelId = paramInt return context end function private.AnalysisGoldHeroLevelSelect(param) local context = {} local paramInt = param return context end function Dialogue_Controller.EnterFuben(id) MDL.LevelSelect.EnterFuben(LuaConst.LevelType.Planes,tonumber(id)) end --接取个人日常任务 function Dialogue_Controller.AcceptDailyRingTask() local isUnlock, content = CTL.Activities.IsOpen(LuaConst.ActivityType.RingDaily) if isUnlock == false then CTL.Tips.AddTipsMsg(content) return end local state = MDL.Task.GetDailyRingTaskState() if(state == MDL.Task.Enum_RingTaskState.Done)then CTL.Tips.AddTipsMsg(Const_IDS["IDS_Task_RingDaily_Max"]) elseif(state == MDL.Task.Enum_RingTaskState.Doing)then CTL.Tips.AddTipsMsg(Const_IDS["IDS_Task_RingDaily_Doing"]) else MDL.Task.AcceptRingTaskRequest(MDL.Task.Enum_RingTaskType.RingDaily) end end function Dialogue_Controller.GuildEscortMain() CTL.GuildEscort.OpenGuildEscortMainPanel() end function Dialogue_Controller.EnterTeamPVE(activityId) CTL.TeamDungeon.OpenMainPanel(tonumber(activityId)) end --官职系统:阶段1晋升 function Dialogue_Controller.OfficialPositionPromotion() CTL.OfficialPosition.OfficialPositionPromotion() end --官职系统:阶段2挑战PVE function Dialogue_Controller.OfficialPositionPve() CTL.OfficialPosition.OfficialPositionPve() end --官职系统:报名 function Dialogue_Controller.OfficialPositionExam() CTL.OfficialPosition.OfficialPositionExam() end function Dialogue_Controller.SelectDialogueBranch1() LuaInputManager.SetSpecialCommand(LuaConst.SpecialCommandType.SelectDialogueBranch1) end function Dialogue_Controller.SelectDialogueBranch2() LuaInputManager.SetSpecialCommand(LuaConst.SpecialCommandType.SelectDialogueBranch2) end function Dialogue_Controller.GetDialogueUIName(type) local name local enumType = MDL.Dialogue.DialogueType if type == enumType.Normal then name = Const_UI_Lua.UIEnum.UIDialogueNormalView elseif type == enumType.Light then name = Const_UI_Lua.UIEnum.UIDialogueLightView elseif type == enumType.TipBlue then name = Const_UI_Lua.UIEnum.UIDialogueTopBlueView elseif type == enumType.TipYellow then name = Const_UI_Lua.UIEnum.UIDialogueTopYellowView elseif type == enumType.TipBottom then name = Const_UI_Lua.UIEnum.UIDialogueBottomView elseif type == enumType.BattleReport then name = Const_UI_Lua.UIEnum.UIDialogueTopReportView elseif type == enumType.BottomYellow then name = Const_UI_Lua.UIEnum.UIDialogueBottomYellowView end return name end -- 点击皇帝出现的进爵对话框,播放进爵动画 function Dialogue_Controller.NobilityStageUp() SystemManager.PlayTimeline(string.format(ConstAssetPathConfig.Path5), true, -1, CTL.Nobility.FindCallBack) end -- 金将活动——任务分支选择 function Dialogue_Controller.AcceptEventTask(nextTaskFatherID) CTL.GoldenHeroStory.TaskTriggerReceive(tonumber(nextTaskFatherID)) end -- 彩金将活动——任务分支选择 function Dialogue_Controller.SuperGoldAcceptEventTask(nextTaskFatherID) CTL.SuperGoldStory.TaskTriggerReceive(tonumber(nextTaskFatherID), true) end return Dialogue_Controller