using System; using System.Collections.Generic; using KKSG; using UnityEngine; using XMainClient.UI.UICommon; using XUtliPoolLib; namespace XMainClient { internal class XAnnouncementDocument : XDocComponent { public override uint ID { get { return XAnnouncementDocument.uuID; } } public List NoticeList { get { return this._notice_list; } } public bool RedPoint { get { return this._red_point; } set { this._red_point = value; } } public new static readonly uint uuID = XSingleton.singleton.XHash("AnnouncementDocument"); public const int TAB_COUNT = 2; private List _notice_list = new List(); private bool _red_point = false; private bool[] _tab_red_point = new bool[2]; public int CurrentTab = 0; public bool GetTabRedPoint(int index) { return this._tab_red_point[index]; } public void SendFetchNotice() { RpcC2M_FetchPlatNotice rpcC2M_FetchPlatNotice = new RpcC2M_FetchPlatNotice(); rpcC2M_FetchPlatNotice.oArg.type = XSingleton.singleton.AccountType; RuntimePlatform platform = Application.platform; if ((int)platform != 8) { if ((int)platform == 11) { rpcC2M_FetchPlatNotice.oArg.platid = PlatType.PLAT_ANDROID; } } else { rpcC2M_FetchPlatNotice.oArg.platid = PlatType.PLAT_IOS; } XSingleton.singleton.Send(rpcC2M_FetchPlatNotice); } public void SendClickNotice(PlatNotice notice) { RpcC2M_ClickNewNotice rpcC2M_ClickNewNotice = new RpcC2M_ClickNewNotice(); rpcC2M_ClickNewNotice.oArg.info = notice; XSingleton.singleton.Send(rpcC2M_ClickNewNotice); } public void GetNoticeData(List noticeList) { this._red_point = false; Array.Clear(this._tab_red_point, 0, 2); this._notice_list.Clear(); for (int i = 0; i < noticeList.Count; i++) { this._notice_list.Add(noticeList[i]); uint type = noticeList[i].type; if (type - 3u > 1u) { if (type == 6u) { this._tab_red_point[0] |= noticeList[i].isnew; this._red_point |= noticeList[i].isnew; } } else { this._tab_red_point[1] |= noticeList[i].isnew; this._red_point |= noticeList[i].isnew; } } XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_Announcement, true); bool flag = DlgBase.singleton.IsVisible(); if (flag) { bool flag2 = DlgBase.singleton.m_AnnouncementHandler != null; if (flag2) { DlgBase.singleton.m_AnnouncementHandler.RefreshData(); } } bool flag3 = XSingleton.singleton.IsSystemOpened(XSysDefine.XSys_Patface); if (flag3) { DlgBase.singleton.ShowPatface(); } else { XSingleton.singleton.CheckPandoraPLPanel(); } } public void RefreshRedPoint() { this._red_point = false; Array.Clear(this._tab_red_point, 0, 2); for (int i = 0; i < this._notice_list.Count; i++) { uint type = this._notice_list[i].type; if (type - 3u > 1u) { if (type == 6u) { this._tab_red_point[0] |= this._notice_list[i].isnew; this._red_point |= this._notice_list[i].isnew; } } else { this._tab_red_point[1] |= this._notice_list[i].isnew; this._red_point |= this._notice_list[i].isnew; } } XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_Announcement, true); XOperatingActivityDocument specificDocument = XDocuments.GetSpecificDocument(XOperatingActivityDocument.uuID); specificDocument.RefreshRedPoints(); bool flag = DlgBase.singleton.IsVisible(); if (flag) { bool flag2 = DlgBase.singleton.m_AnnouncementHandler != null; if (flag2) { DlgBase.singleton.m_AnnouncementHandler.RefreshTab(); } } } protected override void OnReconnected(XReconnectedEventArgs arg) { } } }