From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/XAnnouncementView.cs | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/XAnnouncementView.cs (limited to 'Client/Assets/Scripts/XMainClient/XAnnouncementView.cs') diff --git a/Client/Assets/Scripts/XMainClient/XAnnouncementView.cs b/Client/Assets/Scripts/XMainClient/XAnnouncementView.cs new file mode 100644 index 00000000..25c5a0be --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XAnnouncementView.cs @@ -0,0 +1,67 @@ +using System; +using UILib; +using XMainClient.UI.UICommon; + +namespace XMainClient +{ + internal class XAnnouncementView : DlgBase + { + public override string fileName + { + get + { + return "SelectChar/AnnouncementDlg"; + } + } + + public override int group + { + get + { + return 1; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + public override bool isMainUI + { + get + { + return true; + } + } + + public override bool pushstack + { + get + { + return true; + } + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + base.uiBehaviour.m_Enter.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnEnterClicked)); + } + + private bool OnEnterClicked(IXUIButton button) + { + this.SetVisibleWithAnimation(false, null); + return true; + } + + public void ShowAnnouncement(string announcement) + { + this.SetVisibleWithAnimation(true, null); + base.uiBehaviour.m_Announcement.SetText(announcement); + } + } +} -- cgit v1.1-26-g67d0