From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Guild/XGuildTaskRefreshResultDlg.cs | 151 +++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlg.cs (limited to 'Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlg.cs') diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlg.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlg.cs new file mode 100644 index 00000000..c35b8f4a --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlg.cs @@ -0,0 +1,151 @@ +using System; +using UILib; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildTaskRefreshResultDlg : DlgBase + { + public override string fileName + { + get + { + return "Guild/DailyTaskResult"; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + public uint AfterScore { get; set; } + + public uint BeforeScore { get; set; } + + private XFx _fx1; + + private XFx _fx2; + + private uint _fx1Token; + + private uint _fx2Token; + + protected override void OnLoad() + { + base.OnLoad(); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + } + + protected override void OnUnload() + { + XSingleton.singleton.KillTimer(this._fx1Token); + XSingleton.singleton.KillTimer(this._fx2Token); + this._fx1Token = 0u; + this._fx2Token = 0u; + bool flag = this._fx1 != null; + if (flag) + { + XSingleton.singleton.DestroyFx(this._fx1, true); + this._fx1 = null; + } + bool flag2 = this._fx2 != null; + if (flag2) + { + XSingleton.singleton.DestroyFx(this._fx2, true); + this._fx2 = null; + } + base.OnUnload(); + } + + protected override void Init() + { + base.Init(); + base.uiBehaviour.blockBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClose)); + } + + protected override void OnShow() + { + base.OnShow(); + base.uiBehaviour.TweenGroup.ResetTween(true); + base.uiBehaviour.TweenGroup.PlayTween(true); + base.uiBehaviour.beforeSprite.SetSprite(base.uiBehaviour.beforeSprite.spriteName.Substring(0, base.uiBehaviour.beforeSprite.spriteName.Length - 1) + this.BeforeScore); + base.uiBehaviour.afterSprite.SetSprite(base.uiBehaviour.afterSprite.spriteName.Substring(0, base.uiBehaviour.afterSprite.spriteName.Length - 1) + this.AfterScore); + bool flag = this.BeforeScore < this.AfterScore; + if (flag) + { + base.uiBehaviour.resultLabel.SetText(XSingleton.singleton.ReplaceReturn(XStringDefineProxy.GetString("DailyTaskRefreshUp"))); + } + else + { + bool flag2 = this.BeforeScore == this.AfterScore; + if (flag2) + { + base.uiBehaviour.resultLabel.SetText(XSingleton.singleton.ReplaceReturn(XStringDefineProxy.GetString("DailyTaskRefreshEqual"))); + } + else + { + base.uiBehaviour.resultLabel.SetText(XSingleton.singleton.ReplaceReturn(XStringDefineProxy.GetString("DailyTaskRefreshDown"))); + } + } + IXPositionGroup ixpositionGroup = base.uiBehaviour.transform.GetComponent("PositionGroup") as IXPositionGroup; + this._fx1Token = XSingleton.singleton.SetTimer(ixpositionGroup.GetGroup(0).x, new XTimerMgr.ElapsedEventHandler(this.DelayCreateFx), 1); + this._fx2Token = XSingleton.singleton.SetTimer(ixpositionGroup.GetGroup(1).x, new XTimerMgr.ElapsedEventHandler(this.DelayCreateFx), 2); + } + + protected override void OnHide() + { + XSingleton.singleton.KillTimer(this._fx1Token); + XSingleton.singleton.KillTimer(this._fx2Token); + this._fx1Token = 0u; + this._fx2Token = 0u; + bool flag = this._fx1 != null; + if (flag) + { + XSingleton.singleton.DestroyFx(this._fx1, true); + this._fx1 = null; + } + bool flag2 = this._fx2 != null; + if (flag2) + { + XSingleton.singleton.DestroyFx(this._fx2, true); + this._fx2 = null; + } + base.OnHide(); + } + + private void DelayCreateFx(object o = null) + { + int num = (int)o; + bool flag = num == 1; + if (flag) + { + this._fx1 = XSingleton.singleton.CreateUIFx("Effects/FX_Particle/UIfx/UI_fptx_Clip01", base.uiBehaviour.m_FxDepth, false); + } + else + { + this._fx2 = XSingleton.singleton.CreateUIFx("Effects/FX_Particle/UIfx/UI_fptx_Clip02", base.uiBehaviour.m_FxDepth2, false); + } + } + + public override void StackRefresh() + { + base.StackRefresh(); + } + + private bool OnClose(IXUIButton uiSprite) + { + this.SetVisible(false, true); + return true; + } + } +} -- cgit v1.1-26-g67d0