local UIExpelMonsterSummary = UIViewClass() local ClimbTowerAutoQuit = DataSheetManager.ConstData:GetDataByID("ClimbTowerAutoQuit").IntValue function UIExpelMonsterSummary:OnOpened(context) self.txt_Time.text = UTL.Time.FormatTimeBySeconds(context.passTime) local expelMonsterResult = context.expelMonsterResult self.txt_Damage.text = UTL.String.GetCountStr(math.ceil(expelMonsterResult.damage)) if expelMonsterResult.rewards and #expelMonsterResult.rewards > 0 then UIUtils.SetActive(self.no_reward_box, false) self.loop_BoxReward:ReloadAll(expelMonsterResult.rewards) else UIUtils.SetActive(self.no_reward_box, true) end CTL.Sound.PlayGameSound("MUSIC_Victory") self.leftTime = ClimbTowerAutoQuit self.txt_Back.text = string.FormatByIdsId(Const_IDS.IDS_ClimbTower_AutoQuit, self.leftTime) self:StartRepeatFunc(self.OnUpdate, 1, -1, true) end function UIExpelMonsterSummary:OnUpdate(deltaTime, timeSinceUpdate) local timeOffset = self.leftTime - timeSinceUpdate if timeOffset > 0 then self.txt_Back.text = string.FormatByIdsId(Const_IDS.IDS_ClimbTower_AutoQuit, timeOffset) else self:OnButtonClicked(self.btn_Exit) end end function UIExpelMonsterSummary:OnButtonClicked(comp) if comp == self.btn_Exit then MDL.Level.SendRoleLeaveFuben() --退出副本 end end function UIExpelMonsterSummary:OnCellInit(scrollRect, index, cellTable, data) if scrollRect == self.loop_BoxReward then UTL.Item.SetItemCell(cellTable.UIItem, data.ItemId, data.ItemCount) end end function UIExpelMonsterSummary:OnCellClicked(scrollRect, index, cellTable, target, data) if scrollRect == self.loop_BoxReward then if target == cellTable.UIItem.event_Click then UTL.ItemTips.ShowCommonTipsById(data.ItemId) end end end return UIExpelMonsterSummary