local UINationClimbTowerSummary = UIViewClass() function UINationClimbTowerSummary:OnOpened(context) UIManager.ActiveUIModle(false, "UINationClimbTowerSummary") self.isWin = context.Win or MDL.NationClimbTower.IsHasRewards() self.openType = MDL.NationClimbTower.GetTowerOpenInfo() self.openType = MDL.NationClimbTower.GetCurSelectTower() self:RefreshNewUI() end function UINationClimbTowerSummary:OnClosed() UIManager.ActiveUIModle(true, "UINationClimbTowerSummary") end function UINationClimbTowerSummary:OnCellInit(scrollRect, index, cellTable, data) if scrollRect == self.loop_SummaryReward then -- 通关奖励 UTL.Item.SetItemCell(cellTable.UIItem, data.ItemId, data.ItemCount) end end function UINationClimbTowerSummary:OnCellClicked(scrollRect, index, cellTable, target, data) if scrollRect == self.loop_SummaryReward then -- 通关奖励 UTL.ItemTips.ShowCommonTipsById(data.ItemId) end end function UINationClimbTowerSummary:OnButtonClicked(comp) if comp == self.btn_Next then --继续挑战 local canChallenge, nextConfig, unlockText = CTL.NationClimbTower.CanChallengeNextLevel() if canChallenge then self:CloseView() if nextConfig then CTL.NationClimbTower.EnterFuben(nextConfig) else CTL.NationClimbTower.LeaveFuben() end if not self.isWin then CTL.Sound.PlayGameSound("SFX_life") end else CTL.Tips.AddTipsMsg(unlockText) end elseif comp == self.btn_BackTown then --返回主城 --退出副本 CTL.NationClimbTower.LeaveFuben() end end function UINationClimbTowerSummary:RefreshNewUI() --通过的关卡展示 local firstLevelNum = MDL.NationClimbTower.GetFirstEnterLevelNum() local levelNum = MDL.NationClimbTower.GetTowerPassedLvInfo(MDL.NationClimbTower.GetCurSelectTower()) if levelNum < firstLevelNum then levelNum = firstLevelNum end local firstLevelConfig = MDL.NationClimbTower.GetLevelConfigByTowerType(self.openType, firstLevelNum) local levelConfig = MDL.NationClimbTower.GetLevelConfigByTowerType(self.openType, levelNum) UIUtils.SetLabel(self.txt_Level, string.FormatByIdsId(Const_IDS[firstLevelConfig.LevelName], firstLevelConfig.Number)) UIUtils.SetLabel(self.txt_NewLevel, string.FormatByIdsId(Const_IDS[levelConfig.LevelName], levelConfig.Number)) if self.isWin then --胜利 CTL.Sound.PlayGameSound("MUSIC_Victory") self.obj_state:SetState(1) UIUtils.SetActive(self.group_Efficiency, false) --奖励展示 local totalReward = MDL.NationClimbTower.GetTotalRewards() for k, v in pairs(totalReward) do self.loop_SummaryReward:AddData(v, 0) end else --失败 CTL.Sound.PlayGameSound("SFX_die") self.obj_state:SetState(0) end end return UINationClimbTowerSummary