local UIGuildMineHelpPopUp = UIViewClass() function UIGuildMineHelpPopUp:OnOpened() MDL.GuildMine.GetGuildMineAssHistoryRequest() UIUtils.SetLabelText(self.UICommonBlackGoldPopUp.txt_Title, Const_IDS["IDS_Mine_Help"]) self:RegistSystemEvent(EventID.UI_GuildMine_CloseView, self.OnBackButtonPressed) -- GMS self:RegistSystemEvent(EventID.UI_GuildMine_Ass_History_Refresh, self.RefreshList) -- 援助历史刷新 self:RegistSystemEvent(EventID.UI_Guild_BeKickOutRefresh, self.CloseView) -- 被踢出势力 self:RegistSystemEvent(EventID.New_Day_Refresh, self.NewDayRefresh) -- 跨天刷新 MDL.GuildMine.GetAssHistory() end function UIGuildMineHelpPopUp:RefreshList() local assHistoryList = MDL.GuildMine.GetAssHistory() self.loop_HelpPlayer:ReloadAll(assHistoryList) UIUtils.SetActive(self.empty_node, #assHistoryList <= 0) end function UIGuildMineHelpPopUp:NewDayRefresh() MDL.GuildMind.GetGuildMineAssHistoryRequest() end function UIGuildMineHelpPopUp:OnBackButtonPressed() self:OnButtonClicked(self.UICommonBlackGoldPopUp.btn_Close) end function UIGuildMineHelpPopUp:OnButtonClicked(comp) if comp == self.UICommonBlackGoldPopUp.btn_Close then self:CloseView() end end function UIGuildMineHelpPopUp:OnCellInit(scrollRect, index, cellTable, data) local baseInfo = data.baseInfo local supplementInfo = data.supplementInfo local memberShowInfo = data.supplementInfo.memberShowInfo local isSelf = memberShowInfo.playerAcid == BattleDataGetter.GetAcID() -- 玩家信息 CTL.Character.SetPortraitAndFrame(cellTable.Hero, memberShowInfo.playerPortraitId, memberShowInfo.playerFrameId, memberShowInfo.playerLevel) CTL.Player.OperateGenderImage(cellTable.img_Gender, memberShowInfo.playerSex) if isSelf then UIUtils.SetLabel(cellTable.txt_HeroName, UTL.Color.FormatTextByColor("8fe391", memberShowInfo.playerName)) else UIUtils.SetLabel(cellTable.txt_HeroName, UTL.Color.FormatWhiteColor(memberShowInfo.playerName)) end -- 掠夺信息 UIUtils.SetLabelText(cellTable.txt_Dialogue, Const_IDS[supplementInfo.assIDS]) local dataSheet = DataSheetManager.MineQuality:GetDataByID(baseInfo.mineLevel) local mineName = UTL.Color.GetColorfulText(DataSheetManager.QualityColor:GetDataByID(dataSheet.CharacterColorID).CharacterColor, dataSheet.Name) local lootItemInfo = UTL.Item.GetItemDataSpliceByType(baseInfo.lootItemId).Name..'*'..baseInfo.lootItemNum local str = string.FormatByIdsId(Const_IDS.IDS_Mine_PlunderFoHelpDes, baseInfo.guildName, baseInfo.playerName,mineName, lootItemInfo) UIUtils.SetLabel(cellTable.txt_HelpInfo,str) UIUtils.SetLabel(cellTable.txt_Time, os.date(UTL.Time.FormatDateEnum.HMS, supplementInfo.assStartTime)) --援助状态 self:RefreshCellAssState(cellTable, supplementInfo, isSelf) end function UIGuildMineHelpPopUp:RefreshCellAssState(cellTable, supplementInfo, isSelf) local state = supplementInfo.assState if state == MDL.GuildMine.MineAssStateType.None then --未援助 if isSelf then cellTable.state_Help:SetState(2) else cellTable.state_Help:SetState(1) end else --已援助 cellTable.state_Help:SetState(0) UIUtils.SetActive(cellTable.group_Sign, state == MDL.GuildMine.MineAssStateType.ReTakeBySelf) UIUtils.SetActive(cellTable.group_HelpSign, state == MDL.GuildMine.MineAssStateType.ReTakeByOther) UIUtils.SetLabel(cellTable.txt_Name, supplementInfo.assName) end end function UIGuildMineHelpPopUp:OnCellClicked(scrollRect, index, cellTable, target, data) if target == cellTable.btn_Help then local limitTimes = DataSheetManager.ConstData:GetDataByID("MineDailyAssistanceNum").IntValue local times = limitTimes - MDL.GuildMine.GetAssCount() if times <= 0 then CTL.Tips.AddTipsMsg(Const_IDS["IDS_Mine_NoAssistanceFrequency"]) return end if CTL.GuildMine.IsFormationFinished(MDL.GuildMine.GetMineCurKingdomId()) then MDL.GuildMine.GetGuildMineEnemyLineUpRequest(data.supplementInfo.memberShowInfo.playerAcid, data.baseInfo.lootTime, data.baseInfo.lootAcid, data.baseInfo.lootGuildId) else CTL.GuildMine.OpenSelectOfficerMessageBox() end end end return UIGuildMineHelpPopUp