From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/XShowGetAchivementTipDocument.cs | 101 +++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/XShowGetAchivementTipDocument.cs (limited to 'Client/Assets/Scripts/XMainClient/XShowGetAchivementTipDocument.cs') diff --git a/Client/Assets/Scripts/XMainClient/XShowGetAchivementTipDocument.cs b/Client/Assets/Scripts/XMainClient/XShowGetAchivementTipDocument.cs new file mode 100644 index 00000000..3d14f480 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XShowGetAchivementTipDocument.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XShowGetAchivementTipDocument : XDocComponent + { + public override uint ID + { + get + { + return XShowGetAchivementTipDocument.uuID; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("ShowGetAchivementTipDocument"); + + private Queue AchivementQueue = new Queue(); + + public override void OnAttachToHost(XObject host) + { + base.OnAttachToHost(host); + this.AchivementQueue.Clear(); + } + + public override void OnEnterScene() + { + base.OnEnterScene(); + this.CheckScene(); + } + + public override void OnEnterSceneFinally() + { + base.OnEnterSceneFinally(); + bool flag = XSingleton.singleton.CurrentStage.Stage == EXStage.Hall && DlgBase.singleton.queue.Count > 0; + if (flag) + { + DlgBase.singleton.ShowUI(); + } + } + + public override void OnLeaveScene() + { + base.OnLeaveScene(); + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.SetVisible(false, true); + } + } + + public void AddAchivement(uint AchivementID, uint state) + { + bool flag = state != 1u; + if (!flag) + { + AchivementTable.RowData achivementData = XDocuments.GetSpecificDocument(XAchievementDocument.uuID).GetAchivementData(AchivementID); + bool flag2 = achivementData == null; + if (!flag2) + { + bool flag3 = achivementData.ShowAchivementTip == 0; + if (!flag3) + { + this.AchivementQueue.Enqueue(achivementData); + this.CheckScene(); + } + } + } + } + + public void ShowAchivementTip(object o = null) + { + bool flag = this.AchivementQueue.Count > 0 && !DlgBase.singleton.IsVisible(); + if (flag) + { + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.SetAlpha(1f); + } + DlgBase.singleton.SetVisible(true, true); + DlgBase.singleton.ShowTip(this.AchivementQueue.Dequeue()); + } + } + + private void CheckScene() + { + bool flag = XSingleton.singleton.CurrentStage.Stage == EXStage.Hall && !DlgBase.singleton.IsVisible(); + if (flag) + { + this.ShowAchivementTip(null); + } + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + } +} -- cgit v1.1-26-g67d0