From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/UI/GuildArenaDuelFinalResultDlg.cs | 158 +++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/GuildArenaDuelFinalResultDlg.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/GuildArenaDuelFinalResultDlg.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/GuildArenaDuelFinalResultDlg.cs b/Client/Assets/Scripts/XMainClient/UI/GuildArenaDuelFinalResultDlg.cs new file mode 100644 index 00000000..34e65b8a --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/GuildArenaDuelFinalResultDlg.cs @@ -0,0 +1,158 @@ +using System; +using UILib; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient.UI +{ + internal class GuildArenaDuelFinalResultDlg : DlgBase + { + public override string fileName + { + get + { + return "Battle/GuildArenaDuelFinalResultDlg"; + } + } + + public override int layer + { + get + { + return 1; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + private XGuildArenaBattleDocument _Doc; + + private XElapseTimer m_lastTime = new XElapseTimer(); + + private bool Countdown = false; + + private bool mDone = false; + + protected override void OnShow() + { + base.OnShow(); + this.RefreshData(); + this.RefreahCountTime(10f, true); + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.SetVisible(false, true); + } + bool bSpectator = XSingleton.singleton.bSpectator; + if (bSpectator) + { + bool flag2 = DlgBase.singleton.IsLoaded(); + if (flag2) + { + DlgBase.singleton.SetVisible(false, true); + } + } + else + { + bool flag3 = DlgBase.singleton.IsLoaded() && DlgBase.singleton.IsVisible(); + if (flag3) + { + DlgBase.singleton.SkillHandler.ResetPressState(); + DlgBase.singleton.SetVisible(false, true); + } + } + } + + protected override void OnHide() + { + base.OnHide(); + bool bSpectator = XSingleton.singleton.bSpectator; + if (bSpectator) + { + bool flag = DlgBase.singleton.IsLoaded(); + if (flag) + { + DlgBase.singleton.SetVisible(true, true); + } + } + else + { + bool flag2 = DlgBase.singleton.IsLoaded(); + if (flag2) + { + DlgBase.singleton.SetVisible(true, true); + } + } + } + + protected override void Init() + { + base.Init(); + this._Doc = XDocuments.GetSpecificDocument(XGuildArenaBattleDocument.uuID); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + base.uiBehaviour.m_maskSprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.ClickClose)); + } + + private void RefreshData() + { + base.uiBehaviour.m_BlueInfo.Set(this._Doc.BlueDuelResult); + base.uiBehaviour.m_RedInfo.Set(this._Doc.RedDuelResult); + } + + private void ClickClose(IXUISprite sprite) + { + this.ReturnHall(); + } + + public void RefreahCountTime(float time, bool Done) + { + this.m_lastTime.LeftTime = time; + this.Countdown = true; + this.mDone = Done; + } + + public override void OnUpdate() + { + base.OnUpdate(); + this.UpdateCountTime(); + } + + private void UpdateCountTime() + { + bool flag = !this.Countdown; + if (!flag) + { + this.m_lastTime.Update(); + bool flag2 = this.m_lastTime.LeftTime > 0f; + if (flag2) + { + base.uiBehaviour.m_timeLabel.SetText(XSingleton.singleton.TimeDuarationFormatString((int)this.m_lastTime.LeftTime, 5)); + } + else + { + this.Countdown = false; + bool flag3 = this.mDone; + if (flag3) + { + this.ReturnHall(); + } + } + } + } + + private void ReturnHall() + { + XSingleton.singleton.ReqLeaveScene(); + } + } +} -- cgit v1.1-26-g67d0