local UIGuildMineSummaryPlunder = UIViewClass() local ClimbTowerAutoQuit = DataSheetManager.ConstData:GetDataByID("ClimbTowerAutoQuit").IntValue function UIGuildMineSummaryPlunder:OnOpened(context) self.isWin = context.isWin self.state_Summary:SetState(self.isWin and 0 or 1) local mineInfo = context.finishMineInfo UIUtils.SetLabel(self.txt_PlayerName, mineInfo.playerName) self.txt_Back.text = nil self.leftTime = ClimbTowerAutoQuit self.txt_Back.text = string.FormatByIdsId(Const_IDS.IDS_ClimbTower_AutoQuit, self.leftTime) self:StartRepeatFunc(self.OnUpdate, 1, -1, true) if self.isWin then CTL.Sound.PlayGameSound("MUSIC_Victory") if mineInfo.fightType == MDL.GuildMine.GuidMineOpType.Loot then UIUtils.SetLabelText(self.txt_BattleFinished, Const_IDS.IDS_Mine_SucceededInPlundering) -- 掠夺成功 else UIUtils.SetLabelText(self.txt_BattleFinished, Const_IDS.IDS_Mine_SuccessfulCounterattack) -- 反击成功 end local mineData = DataSheetManager.MineQuality:GetDataByID(mineInfo.mineLevel) local rewardData = DataSheetManager.MineRewardRepeat:GetDataByID(mineData.PlunderReward).Item_Table self.loop_SummaryReward:ReloadAll(rewardData) else CTL.Sound.PlayGameSound("MUSIC_Fail") if mineInfo.fightType == MDL.GuildMine.GuidMineOpType.Loot then UIUtils.SetLabelText(self.txt_BattleFinished, Const_IDS.IDS_Mine_FailedToPlunder) -- 掠夺失败 else UIUtils.SetLabelText(self.txt_BattleFinished, Const_IDS.IDS_Mine_CounterattackFailed) -- 反击失败 end end end function UIGuildMineSummaryPlunder: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 UIGuildMineSummaryPlunder:OnButtonClicked(comp) if comp == self.btn_Exit then MDL.Level.SendRoleLeaveFuben() --退出副本 end end function UIGuildMineSummaryPlunder:OnCellInit(scrollRect, index, cellTable, data) if scrollRect == self.loop_SummaryReward then UTL.Item.SetItemCell(cellTable.UIItem, data.ItemID, data.ItemNum) end end function UIGuildMineSummaryPlunder:OnCellClicked(scrollRect, index, cellTable, target, data) if scrollRect == self.loop_SummaryReward then if target == cellTable.UIItem.event_Click then UTL.ItemTips.ShowCommonTipsById(data.ItemID) end end end return UIGuildMineSummaryPlunder