From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Assets/Scripts/XMainClient/UI/TitleShareDlg.cs | 134 +++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/TitleShareDlg.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/TitleShareDlg.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/TitleShareDlg.cs b/Client/Assets/Scripts/XMainClient/UI/TitleShareDlg.cs new file mode 100644 index 00000000..741e8c3b --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/TitleShareDlg.cs @@ -0,0 +1,134 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient.UI +{ + internal class TitleShareDlg : DlgBase + { + public override int layer + { + get + { + return 1; + } + } + + public override int sysid + { + get + { + return XFastEnumIntEqualityComparer.ToInt(XSysDefine.XSys_Title_Share); + } + } + + public override string fileName + { + get + { + return "GameSystem/TitleShareDlg"; + } + } + + public override bool pushstack + { + get + { + return true; + } + } + + public override bool hideMainMenu + { + get + { + return true; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + private XTitleDocument _Doc; + + private uint m_showTime; + + private bool m_canClose; + + protected override void Init() + { + base.Init(); + this._Doc = XDocuments.GetSpecificDocument(XTitleDocument.uuID); + base.uiBehaviour.m_Close.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.ClickTitleShared)); + } + + protected override void OnShow() + { + base.OnShow(); + this.m_canClose = false; + TitleTable.RowData currentTitle = this._Doc.CurrentTitle; + base.uiBehaviour.m_closeTips.gameObject.SetActive(this.m_canClose); + base.uiBehaviour.m_currentTitle.Set(currentTitle); + bool flag = !string.IsNullOrEmpty(currentTitle.AffectRoute); + if (flag) + { + XSingleton.singleton.CreateAndPlay(currentTitle.AffectRoute + "_Clip01", base.uiBehaviour.transform, Vector3.zero, Vector3.one, 1f, false, 1f, true); + } + XSingleton.singleton.EnableMainDummy(true, base.uiBehaviour.m_snapshotTransfrom); + float interval = XSingleton.singleton.SetMainAnimationGetLength(XSingleton.singleton.Player.Present.PresentLib.Disappear); + this.m_showTime = XSingleton.singleton.SetTimer(interval, new XTimerMgr.ElapsedEventHandler(this.KillTimer), null); + base.uiBehaviour.m_message.SetText(XStringDefineProxy.GetString("TITLE_NEW_GET", new object[] + { + currentTitle.RankName + })); + } + + private void KillTimer(object sender) + { + this.m_canClose = true; + base.uiBehaviour.m_closeTips.gameObject.SetActive(this.m_canClose); + XSingleton.singleton.KillTimer(this.m_showTime); + XSingleton.singleton.SetMainAnimation(XSingleton.singleton.Player.Present.PresentLib.AttackIdle); + } + + protected override void OnHide() + { + XSingleton.singleton.EnableMainDummy(false, base.uiBehaviour.m_snapshotTransfrom); + base.OnHide(); + this.m_showTime = 0u; + XSingleton.singleton.EnableMainDummy(false, null); + } + + protected override void OnUnload() + { + XSingleton.singleton.KillTimer(this.m_showTime); + XSingleton.singleton.OnUIUnloadMainDummy(base.uiBehaviour.m_snapshotTransfrom); + bool flag = base.uiBehaviour != null; + if (flag) + { + base.uiBehaviour.m_currentTitle.Reset(); + } + base.OnUnload(); + } + + private void ClickTitleShared(IXUISprite texture) + { + bool flag = !this.m_canClose; + if (flag) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("TITILE_QUIKE"), "fece00"); + } + else + { + this.SetVisibleWithAnimation(false, null); + } + } + } +} -- cgit v1.1-26-g67d0