local UIGuildMineSummaryHelp = UIViewClass() local ClimbTowerAutoQuit = DataSheetManager.ConstData:GetDataByID("ClimbTowerAutoQuit").IntValue function UIGuildMineSummaryHelp: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) UIUtils.SetLabel(self.txt_HelpName, mineInfo.beHelpName) 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") UIUtils.SetLabelText(self.txt_BattleFinished, Const_IDS.IDS_Mine_RecaptureSuccess) -- 夺回成功 local mineData = DataSheetManager.MineQuality:GetDataByID(mineInfo.mineLevel) local rewardData = DataSheetManager.MineRewardRepeat:GetDataByID(mineData.AssistanceReward).Item_Table self.loop_SummaryReward:ReloadAll(rewardData) UIUtils.SetLabel(self.labLocal_Name, mineInfo.beHelpName) CTL.Character.SetPortraitAndFrame(self.head_HelpPlayer, mineInfo.beHelpPortraitId, mineInfo.beHelpFrameId) UIUtils.SetLabelText(self.labLocal_Content, Const_IDS.IDS_Mine_ThankYou) -- 感谢发言 else CTL.Sound.PlayGameSound("MUSIC_Fail") UIUtils.SetLabelText(self.txt_BattleFinished, Const_IDS.IDS_Mine_RecaptureFailed) -- 夺回失败 UIUtils.SetLabel(self.labLocal_Name, mineInfo.playerName) CTL.Character.SetPortraitAndFrame(self.head_HelpPlayer, mineInfo.playerPortraitId, mineInfo.playerFrameId) UIUtils.SetLabelText(self.labLocal_Content, Const_IDS.IDS_Mine_Taunt) -- 嘲讽发言 end end function UIGuildMineSummaryHelp: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 UIGuildMineSummaryHelp:OnButtonClicked(comp) if comp == self.btn_Exit then MDL.Level.SendRoleLeaveFuben() --退出副本 end end function UIGuildMineSummaryHelp:OnCellInit(scrollRect, index, cellTable, data) if scrollRect == self.loop_SummaryReward then UTL.Item.SetItemCell(cellTable.UIItem, data.ItemID, data.ItemNum) end end function UIGuildMineSummaryHelp: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 UIGuildMineSummaryHelp