local UITeamPVESummary = UIViewClass() local RESULT_DIFFERENT_ERR_CODE = 1 function UITeamPVESummary:OnOpened(context) self.leftTime = DataSheetManager.ConstData:GetDataByID("TeamDungeonAutoQuitTime").IntValue self.isWin = context.isWin if self.isWin then self.obj_state:SetState(1) self.txt_Time.text = UTL.Time.FormatTimeBySeconds(context.passTime) -- 是否首次通关(多人难度副本用) if context.isFirst then UIUtils.SetLabelText(self.lab_reward, Const_IDS.IDS_MultiplayerDungeon_FristReward) else UIUtils.SetLabelText(self.lab_reward, Const_IDS.IDS_Summary_Reward) end --奖励 if context.Rewards then local count = #context.Rewards if count > 0 then self.award_state:SetState(1) for _,v in ipairs(context.Rewards) do self.loop_SummaryReward:AddData(v,0) end else self.award_state:SetState(0) end end self.txt_Back.text = string.FormatByIdsId(Const_IDS.IDS_TeamDungeon1_Quit_Tip,self.leftTime) local bestPlayerInfo for _,v in ipairs(context.allFighterRes) do if v.playerACID == context.bestFighter then bestPlayerInfo = v break end end local damage = bestPlayerInfo.damage self.lab_DPSNum.text = UTL.String.GetCountStr(damage) local entity = LevelPlayerManager.GetPlayerEntitysByPlayerIDInRoom(LevelManager.CurLevelFunc:GetDamageNo1PlayerID())[1] local playerInfo = LevelPlayerManager.GetPlayerInfoByPlayerIDInRoom(LevelManager.CurLevelFunc:GetDamageNo1PlayerID()) local roleId = entity._logicInitData.CharacterID CTL.Sound.PlayGameSound("MUSIC_Victory") UTL.Item.SetHeroIconByHeroId(self.UIHeroHead.img_HeroHead, roleId, BattleDataGetter.GetHeroIsAwaken(LevelManager.CurLevelFunc:GetDamageNo1PlayerID(), roleId)) UIUtils.SetLabel(self.UIHeroHead.txt_Level, UTL.Item.GetNobilityByTeamLevel(playerInfo.teamLevel)) self.lab_PlayerName.text = bestPlayerInfo.playerName self.lab_ServerNum.text = string.FormatByIdsId(Const_IDS.IDS_TeamDungeon1_ServerName,bestPlayerInfo.serverID) else CTL.Sound.PlayGameSound("MUSIC_Fail") self.obj_state:SetState(0) self.txt_Exit.text = string.FormatByIdsId(Const_IDS.IDS_TeamDungeon1_Quit_Tip,self.leftTime) end self.summaryTemplateEffectHandle1,self.summaryTemplateEffectHandle2 = CTL.LevelSelect.ShowCommonSummaryTemplate(self,self.isWin) if context.ErrCode == RESULT_DIFFERENT_ERR_CODE then CTL.Tips.AddTipsMsg(Const_IDS.IDS_TeamDungeon1_DataException) end self:StartRepeatFunc(self.OnUpdate, 1, -1, true) end function UITeamPVESummary:OnUpdate(deltaTime, timeSinceUpdate) local timeOffset = self.leftTime - timeSinceUpdate if timeOffset > 0 then 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 else self:StopRepeatFunc(self.OnUpdate) MDL.Level.SendRoleLeaveFuben() end end function UITeamPVESummary:OnCellInit(scrollRect, index, cellTable, data) UTL.Item.SetItemCell(cellTable.UIItem, data.ItemId, data.ItemCount) UIUtils.SetActive(cellTable.UIItem.group_txt_Team, data.RewardType == MDL.Reward.ItemRewardType.TeamType) end function UITeamPVESummary:OnCellClicked(scrollRect, index, cellTable, target, data) UTL.ItemTips.ShowCommonTipsById(data.ItemId) end function UITeamPVESummary:OnButtonClicked(comp) if comp == self.btn_BackTown or comp == self.btn_Exit then self:CloseView() MDL.Level.SendRoleLeaveFuben() end end function UITeamPVESummary:OnClosed() CTL.LevelSelect.RemoveSummaryTemplateEffect(self) end return UITeamPVESummary