local UICommonSummary = require "View/Common/UICommonSummary" local UIHeroBiographySummary = UIViewClass(UICommonSummary) function UIHeroBiographySummary:SetSummaryInfo(context) UIUtils.SetActive(self.group_BtnNext, false) UIUtils.SetActive(self.group_BtnAgain, false) UIUtils.SetActive(self.group_Hint, false) if self.isWin then self.enableNext, self.nextConfig, self.unableContent = CTL.Biography.CanChallengeNextLevel() if self.enableNext then UIUtils.SetActive(self.group_BtnNext, true) self.txt_Back.text = nil local seconds = DataSheetManager.ConstData:GetDataByID("ClimbTowerAutoNextLevel").IntValue self.leftTime = seconds self.txt_Next.text = string.format(UIUtils.GetLocalizedTxt(Const_IDS.IDS_ClimbTower_AutoNextLevel), seconds) else UIUtils.SetActive(self.group_BtnNext, false) self.txt_Next.text = nil local seconds = DataSheetManager.ConstData:GetDataByID("ClimbTowerAutoQuit").IntValue self.leftTime = seconds self.txt_Back.text = string.format(UIUtils.GetLocalizedTxt(Const_IDS.IDS_ClimbTower_AutoQuit), seconds) end else local seconds = DataSheetManager.ConstData:GetDataByID("ClimbTowerAutoQuit").IntValue self.leftTime = seconds self.enableNext = false self.txt_Exit.text = string.FormatByIdsId(Const_IDS.IDS_ClimbTower_AutoQuit, seconds) UIUtils.SetActive(self.group_BtnAgain, false) end end function UIHeroBiographySummary:OnClickNext() if self.enableNext then self:StopRepeatFunc(self.OnUpdate) --挑战下一关 local nextConfig = self.nextConfig if nextConfig then local nextLevelId = nextConfig[1] local biographyId = CTL.Biography.GetTempBiographyId() CTL.Biography.SetTempBiographyLevelId(nextConfig[1]) -- 保存当前进入关卡 MDL.Biography.EnterHeroBiographyRequest(biographyId, nextLevelId) else MDL.Level.SendRoleLeaveFuben() end else --弹出无法挑战Tips CTL.Tips.AddTipsMsg(self.unableContent) end end function UIHeroBiographySummary:OnUpdate(deltaTime, timeSinceUpdate) local timeOffset = self.leftTime - timeSinceUpdate if timeOffset > 0 then if self.enableNext then self.txt_Next.text = string.FormatByIdsId(Const_IDS.IDS_ClimbTower_AutoNextLevel,timeOffset) else if self.isWin then self.txt_Back.text = string.FormatByIdsId(Const_IDS.IDS_ClimbTower_AutoQuit,timeOffset) else self.txt_Exit.text = string.FormatByIdsId(Const_IDS.IDS_ClimbTower_AutoQuit,timeOffset) end end else self:StopRepeatFunc(self.OnUpdate) if self.enableNext then self:OnButtonClicked(self.btn_Next) else self:OnButtonClicked(self.btn_BackTown) end end end return UIHeroBiographySummary