local UIBattleVictoryPopUp = UIViewClass() local EventSystem = require('Event/EventSystem') function UIBattleVictoryPopUp:OnOpened(context) self.isWin = self.context.isWin self.duration = self.context.duration self.idsString = self.context.idsString self.isShowTips = self.context.isShowTips self.isShowBg = self.context.isShowBg self.summaryTemplateEffectHandle1, self.summaryTemplateEffectHandle2 = CTL.LevelSelect.ShowCommonSummaryTemplate( self, self.isWin, self.isShowTips, self.isShowBg ) self:StartRepeatFunc(self.UpdateCloseFunc, 1, -1) end function UIBattleVictoryPopUp:UpdateCloseFunc(deltaTime, timeSinceUpdate) if timeSinceUpdate >= self.duration then self:CloseView() return end if self.isShowTips then UIUtils.SetLabel(self.new_summary.lab_Tips, string.FormatByIdsId(Const_IDS[self.idsString], math.ceil(self.duration - timeSinceUpdate))) end end function UIBattleVictoryPopUp:OnClosed() CTL.LevelSelect.RemoveSummaryTemplateEffect(self) EventSystem.Dispatch(EventID.UIBattle_VictoryPopPanelClosed) end return UIBattleVictoryPopUp