diff options
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/XSystemTipDocument.cs')
-rw-r--r-- | Client/Assets/Scripts/XMainClient/XSystemTipDocument.cs | 71 |
1 files changed, 71 insertions, 0 deletions
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<XCommon>.singleton.XHash("SystemTipDocument");
+
+ private Queue<string> m_StrQueue = new Queue<string>();
+
+ public void ShowTip(string text, string rgb)
+ {
+ this.m_StrQueue.Enqueue(string.Format("[{0}]{1}", rgb, text));
+ bool flag = !DlgBase<XSystemTipView, XSystemTipBehaviour>.singleton.IsVisible();
+ if (flag)
+ {
+ bool flag2 = DlgBase<XSystemTipView, XSystemTipBehaviour>.singleton.IsVisible();
+ if (flag2)
+ {
+ DlgBase<XSystemTipView, XSystemTipBehaviour>.singleton.SetAlpha(1f);
+ }
+ DlgBase<XSystemTipView, XSystemTipBehaviour>.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)
+ {
+ }
+ }
+}
|