local UIInfoReminderTipsView = UIViewClass() function UIInfoReminderTipsView:OnOpened(context) self:RegistSystemEvent(EventID.UI_HomeMain_RefreshNotice, self.OnRefreshNotice) self:RefreshFirstNotice() self:RefreshSecondNotice() end function UIInfoReminderTipsView:OnRefreshNotice(isFirst) self:RefreshFirstNotice() self:RefreshSecondNotice() end function UIInfoReminderTipsView:RefreshFirstNotice() if self.secondLoop_Tips.Count == 0 then CSExt.CSFunc_ReloadAll(self.secondLoop_Tips, CTL.InfoReminder.GetFirstNotices) else CSExt.CSFunc_ReloadAll(self.firstLoop_Tips, CTL.InfoReminder.GetFirstNotices) end end function UIInfoReminderTipsView:RefreshSecondNotice() CSExt.CSFunc_ReloadAll(self.secondLoop_Tips, CTL.InfoReminder.GetSecondNotices) if self.secondLoop_Tips.Count == 0 then CSExt.CSFunc_ReloadAll(self.secondLoop_Tips, CTL.InfoReminder.GetFirstNotices) self.firstLoop_Tips:ClearCells() else if self.firstLoop_Tips.Count == 0 then CSExt.CSFunc_ReloadAll(self.firstLoop_Tips, CTL.InfoReminder.GetFirstNotices) end end end function UIInfoReminderTipsView:OnCellInit(scrollRect, index, cellTable, data) local info = DataSheetManager.InfoReminder:GetDataByID(data) UIUtils.SetImageByAssetBundle(cellTable.img_Cell, info.Image) UIUtils.SetLabelText(cellTable.lab_Cell, Const_IDS[info.AuthorityName]) UIUtils.SetActive(cellTable.img_NumBg, false) cellTable.cdTimer:EndTimer() if data == CTL.HomeMain.NoticeType.GuildMineHelp then UIUtils.SetActive(cellTable.img_NumBg, true) local num = MDL.GuildMine.GetMineAssUnReadNum() UIUtils.SetLabel(cellTable.txt_MessageNum, num > 99 and 99 or num) elseif data == CTL.HomeMain.NoticeType.PetBreeding then local _, seconds = MDL.Pet.GetPetBreedState() cellTable.cdTimer:ResetAndBeginCustomTimer(false, seconds, 0, UIUtils.GetLocalizedTxt(Const_IDS[info.AuthorityName]), 1) elseif data == CTL.HomeMain.NoticeType.SlgGvE then local info = MDL.SlgGvE.GetAttackingCityOrBossInfo() if info.deadLine then cellTable.cdTimer:ResetAndBeginCustomTimer(false, info.deadLine - UTL.Time.GetServerTimestamp() , 0, UIUtils.GetLocalizedTxt(Const_IDS.IDS_SlgGve_Main_Hint_15), 1) end end end function UIInfoReminderTipsView:OnCellClicked(scrollRect, index, cellTable, target, data) local info = DataSheetManager.InfoReminder:GetDataByID(data) CTL.Sound.PlayGameSound(info.ClickSound) --第三个参数:仅SlgGvE跳转使用,需要显示二级弹窗 CTL.ItemSources.ExecuteSourceFunctionById(info.JumpUI, nil, true) end return UIInfoReminderTipsView