local SuperGoldStory_Controller = {} local private = {} ---@public 体验关主界面 function SuperGoldStory_Controller.OpenStoryMain(activityID, heroType) local taskID = 0 local taskList = MDL.SuperGoldStory.GetTaskIDListByGoldenHeroID(heroType) for k, v in ipairs(taskList) do local taskState = MDL.SuperGoldStory.GetTaskStateByActivityID_HeroType_TaskFatherID(activityID, heroType, v) if k == 1 then taskID = v end if taskState == MDL.GoldenHeroStory.Enum_TaskState.Doing then taskID = v end end if taskID == DataSheetManager.SuperGoldGroup[MDL.SuperGoldMain.GetHeroTypeByActivityId(activityID)]:GetDataByGroupChildID(1).TaskID and #MDL.SuperGoldStory.GetDoneGroupIDs(activityID) > 0 then taskID = MDL.SuperGoldStory.GetCanSelectTaskLineID(activityID) if not MDL.SuperGoldStory.GetTaskLineIsDone(activityID, heroType, DataSheetManager.SuperGoldStoryTask:GetDataByTaskID(taskID).TaskChainID) then taskID = MDL.SuperGoldStory.GetTaskIDListByGoldenHeroID(heroType)[1] end end UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UISuperGoldStoryMain, {activityId = activityID, heroType = heroType, taskId = taskID}) end ---@public 打开结局界面 function SuperGoldStory_Controller.OpenGoldHeroStoryEndingPanel(heroType, endingID) local endingInfo = DataSheetManager.SuperGoldEndingRecord[heroType]:GetDataByEndingID(endingID) UIManager.OpenView(Const_UI_Lua.UIEnum.UIGoldenHeroStoryAchieve, {endingID = endingID, endingInfo = endingInfo}) end ---@public 结局图鉴展示 function SuperGoldStory_Controller.OpenEndingViewLibrary(activityId, heroType) UIManager.OpenView(Const_UI_Lua.UIEnum.UISuperGoldStoryEndingLibrary, {activityId = activityId, heroType = heroType}) end ---@public 结局大图展示 function SuperGoldStory_Controller.ShowEndingBigPicture(activityId, heroType, config) local endingInfo = {bgName = config.Pic_Big, endingTitle = config.EndingName, endingDes = config.EndingDes} UIManager.OpenView(Const_UI_Lua.UIEnum.UISuperGoldStoryEndingShow, {activityId = activityId, heroType = heroType, endingData = endingInfo}, "GoldenHero/GoldenHeroStory/UIGoldenHeroStoryEndingShow") end ---@public 打开任务或关卡详情界面 function SuperGoldStory_Controller.ChangeSubUIPanel(activityId, heroType, subPanelID, taskOrLevel_Data) UIManager.CloseView(Const_UI_Lua.UIEnum.UISuperGoldStoryTaskInfo) UIManager.CloseView(Const_UI_Lua.UIEnum.UISuperGoldStoryLevelInfo) UIManager.CloseView(Const_UI_Lua.UIEnum.UISuperGoldStoryEndingShow) if subPanelID == 0 then UIManager.OpenView(Const_UI_Lua.UIEnum.UISuperGoldStoryTaskInfo, {activityId = activityId, heroType = heroType, storyTaskInfo = taskOrLevel_Data}) elseif subPanelID == 1 then UIManager.OpenView(Const_UI_Lua.UIEnum.UISuperGoldStoryLevelInfo, {activityId = activityId, heroType = heroType, storyLevelInfo = taskOrLevel_Data}) elseif subPanelID == 2 then SuperGoldStory_Controller.ShowEndingBigPicture(activityId, heroType, taskOrLevel_Data) end end ---@public 退出副本回来打开指定的秘闻关卡界面 function SuperGoldStory_Controller.OpenStoryAndLevelView(activityId, levelId, levelIsFirst) local heroType = MDL.SuperGoldMain.GetHeroTypeByActivityId(activityId) UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UISuperGoldStoryMain, {activityId = activityId, heroType = heroType, levelId = levelId}) end ---@public 任务触发器触发,客户端主动接任务 function SuperGoldStory_Controller.TaskTriggerReceive(taskLineID, isSelectEnding) if MDL.SuperGoldStory.SuperGoldQuitTask(isSelectEnding) then MDL.Task.ClientAcceptTaskRequest(taskLineID) end end ---@public 获取奖励物品信息并整理成表返回打开结算界面 function SuperGoldStory_Controller.ShowBattleSummary(msg, activityId) local rewardList = {} for k,v in ipairs(msg.Resp.Rewards) do local itemData = DataSheetManager.ItemData:GetDataByID(v.ItemId) table.insert(rewardList, {ItemId = v.ItemId, ItemCount = v.ItemCount}) end CTL.HomeMain.CloseOpenView() UIManager.OpenView(Const_UI_Lua.UIEnum.UISuperGoldStorySummary, {Reward = rewardList, isWin = msg.isWin, Time = msg.passTime}, "Common/UICommonSummary") end return SuperGoldStory_Controller