From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/UI/GuildInheritProcessDlg.cs | 90 ++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/GuildInheritProcessDlg.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/GuildInheritProcessDlg.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/GuildInheritProcessDlg.cs b/Client/Assets/Scripts/XMainClient/UI/GuildInheritProcessDlg.cs new file mode 100644 index 00000000..9762b083 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/GuildInheritProcessDlg.cs @@ -0,0 +1,90 @@ +using System; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient.UI +{ + internal class GuildInheritProcessDlg : DlgBase + { + public override string fileName + { + get + { + return "Guild/GuildInheritProcessDlg"; + } + } + + public override bool isMainUI + { + get + { + return true; + } + } + + private XElapseTimer m_lastTime; + + private float m_totalTime; + + private GuildInheritProcessDlg.OnSliderProcessEnd _endEvent; + + public delegate void OnSliderProcessEnd(); + + public void ShowProcess(float countdownTime, string mess, string tips, GuildInheritProcessDlg.OnSliderProcessEnd events = null) + { + bool flag = this.m_lastTime == null; + if (flag) + { + this.m_lastTime = new XElapseTimer(); + } + this._endEvent = events; + this.m_totalTime = countdownTime; + this.m_lastTime.LeftTime = this.m_totalTime; + this.SetVisibleWithAnimation(true, null); + base.uiBehaviour.mProcessLabel.SetText(mess); + base.uiBehaviour.mContentLabel.SetText(tips); + } + + public void HideProcess() + { + this.SetVisibleWithAnimation(false, null); + } + + protected override void OnShow() + { + base.OnShow(); + } + + protected override void OnUnload() + { + this.m_lastTime = null; + base.OnUnload(); + } + + public override void OnUpdate() + { + base.OnUpdate(); + this.UpdateTime(); + } + + private void UpdateTime() + { + this.m_lastTime.Update(); + bool flag = this.m_lastTime.LeftTime > 0f; + if (flag) + { + float value = this.m_lastTime.LeftTime / this.m_totalTime; + base.uiBehaviour.mProcessSlider.Value = value; + } + else + { + this.SetVisibleWithAnimation(false, null); + bool flag2 = this._endEvent != null; + if (flag2) + { + this._endEvent(); + } + } + } + } +} -- cgit v1.1-26-g67d0