From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/UI/RecycleSystemDlg.cs | 128 +++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/RecycleSystemDlg.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/RecycleSystemDlg.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/RecycleSystemDlg.cs b/Client/Assets/Scripts/XMainClient/UI/RecycleSystemDlg.cs new file mode 100644 index 00000000..daacdabd --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/RecycleSystemDlg.cs @@ -0,0 +1,128 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient.UI +{ + internal class RecycleSystemDlg : TabDlgBase + { + public string EffectPath + { + get + { + bool flag = string.IsNullOrEmpty(this.m_effectPath); + if (flag) + { + this.m_effectPath = XSingleton.singleton.GetValue("RecycleEffectPath"); + } + return this.m_effectPath; + } + } + + public override string fileName + { + get + { + return "GameSystem/RecycleDlg"; + } + } + + public RecycleItemBagView _RecycleItemBagView; + + public RecycleItemOperateView _RecycleItemOperateView; + + public GameObject m_RecycleItemBagPanel; + + public GameObject m_RecycleItemOperatePanel; + + public GameObject m_InputBlocker; + + public IXUIButton m_helpBtn; + + private XFx m_fx; + + private string m_effectPath = string.Empty; + + protected override void Init() + { + base.Init(); + this.m_RecycleItemBagPanel = base.uiBehaviour.transform.Find("Bg/ItemListPanel").gameObject; + this.m_RecycleItemBagPanel.SetActive(false); + this.m_RecycleItemOperatePanel = base.uiBehaviour.transform.Find("Bg/LeftPanel/ItemOperateFrame").gameObject; + this.m_RecycleItemOperatePanel.SetActive(false); + this.m_InputBlocker = base.uiBehaviour.transform.Find("Bg/BlockerPanel/InputBlocker").gameObject; + this.m_helpBtn = (base.uiBehaviour.transform.Find("Bg/LeftPanel/T/Help").GetComponent("XUIButton") as IXUIButton); + this.m_helpBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.ShowHelp)); + bool flag = this.m_fx == null; + if (flag) + { + this.m_fx = XSingleton.singleton.CreateFx(this.EffectPath, null, true); + } + else + { + this.m_fx.SetActive(true); + } + this.m_fx.Play(base.uiBehaviour.transform.Find("Bg/p"), Vector3.zero, Vector3.one, 1f, true, false); + } + + protected override void OnLoad() + { + base.OnLoad(); + } + + protected override void OnUnload() + { + bool flag = this.m_fx != null; + if (flag) + { + XSingleton.singleton.DestroyFx(this.m_fx, true); + this.m_fx = null; + } + DlgHandlerBase.EnsureUnload(ref this._RecycleItemBagView); + DlgHandlerBase.EnsureUnload(ref this._RecycleItemOperateView); + base.OnUnload(); + } + + protected override void OnShow() + { + base.OnShow(); + DlgBase.singleton.ShowRecycleTips(); + } + + private bool ShowHelp(IXUIButton button) + { + DlgBase.singleton.ShowHelp(XSysDefine.XSys_Recycle_Equip); + return false; + } + + public override void SetupHandlers(XSysDefine sys) + { + XRecycleItemDocument specificDocument = XDocuments.GetSpecificDocument(XRecycleItemDocument.uuID); + specificDocument.CurrentSys = sys; + XSysDefine xsysDefine = sys; + if (xsysDefine != XSysDefine.XSys_Recycle_Equip) + { + if (xsysDefine != XSysDefine.XSys_Recycle_Jade) + { + XSingleton.singleton.AddErrorLog("System has not finished:", sys.ToString(), null, null, null, null); + return; + } + base._AddActiveHandler(DlgHandlerBase.EnsureCreate(ref this._RecycleItemBagView, this.m_RecycleItemBagPanel, this, true)); + base._AddActiveHandler(DlgHandlerBase.EnsureCreate(ref this._RecycleItemOperateView, this.m_RecycleItemOperatePanel, this, true)); + } + else + { + base._AddActiveHandler(DlgHandlerBase.EnsureCreate(ref this._RecycleItemBagView, this.m_RecycleItemBagPanel, this, true)); + base._AddActiveHandler(DlgHandlerBase.EnsureCreate(ref this._RecycleItemOperateView, this.m_RecycleItemOperatePanel, this, true)); + } + this.ToggleInputBlocker(false); + } + + public void ToggleInputBlocker(bool bBlock) + { + this.m_InputBlocker.SetActive(bBlock); + } + } +} -- cgit v1.1-26-g67d0