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) { } } }