From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/XSystemTipDocument.cs | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/XSystemTipDocument.cs (limited to 'Client/Assets/Scripts/XMainClient/XSystemTipDocument.cs') diff --git a/Client/Assets/Scripts/XMainClient/XSystemTipDocument.cs b/Client/Assets/Scripts/XMainClient/XSystemTipDocument.cs new file mode 100644 index 00000000..0042edce --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XSystemTipDocument.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XSystemTipDocument : XDocComponent + { + public override uint ID + { + get + { + return XSystemTipDocument.uuID; + } + } + + public int LeftCount + { + get + { + return this.m_StrQueue.Count; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("SystemTipDocument"); + + private Queue m_StrQueue = new Queue(); + + public void ShowTip(string text, string rgb) + { + this.m_StrQueue.Enqueue(string.Format("[{0}]{1}", rgb, text)); + bool flag = !DlgBase.singleton.IsVisible(); + if (flag) + { + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.SetAlpha(1f); + } + DlgBase.singleton.SetVisible(true, true); + } + } + + public bool TryGetTip(ref string s) + { + bool flag = this.m_StrQueue.Count == 0; + bool result; + if (flag) + { + result = false; + } + else + { + s = this.m_StrQueue.Dequeue(); + result = true; + } + return result; + } + + public override void OnLeaveScene() + { + base.OnLeaveScene(); + this.m_StrQueue.Clear(); + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + } +} -- cgit v1.1-26-g67d0