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/XLevelSealView.cs | 130 +++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/XLevelSealView.cs (limited to 'Client/Assets/Scripts/XMainClient/XLevelSealView.cs') diff --git a/Client/Assets/Scripts/XMainClient/XLevelSealView.cs b/Client/Assets/Scripts/XMainClient/XLevelSealView.cs new file mode 100644 index 00000000..ce2d75d2 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XLevelSealView.cs @@ -0,0 +1,130 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XLevelSealView : DlgHandlerBase + { + protected override string FileName + { + get + { + return "OperatingActivity/LevelSeal"; + } + } + + private IXUILabel m_NowSeal; + + private IXUILabel m_Condition; + + private IXUILabel m_LeftTime; + + private IXUILabel m_Description; + + private IXUITexture m_NowSealTex; + + private GameObject m_NextSealWindow; + + private IXUIButton m_NextSealBtn; + + private XUIPool m_NewFunctionPool = new XUIPool(XSingleton.singleton.m_uiTool); + + private XLevelSealDocument doc = null; + + private XLeftTimeCounter _CDCounter = null; + + private bool isCountdown = false; + + protected override void Init() + { + this.doc = XDocuments.GetSpecificDocument(XLevelSealDocument.uuID); + this.doc.View = this; + this.m_NowSeal = (base.transform.Find("Bg/NowSeal/p/Label").GetComponent("XUILabel") as IXUILabel); + this.m_Condition = (base.transform.Find("Bg/NowSeal/p/Condition").GetComponent("XUILabel") as IXUILabel); + this.m_LeftTime = (base.transform.Find("Bg/NowSeal/p/LeftTime").GetComponent("XUILabel") as IXUILabel); + this.m_NowSealTex = (base.transform.Find("Bg/NowSeal/Tex/Tex").GetComponent("XUITexture") as IXUITexture); + this.m_Description = (base.transform.Find("Bg/NowSeal/p/Description").GetComponent("XUILabel") as IXUILabel); + this.m_NextSealBtn = (base.transform.Find("Bg/NowSeal/NextSealBtn").GetComponent("XUIButton") as IXUIButton); + this.m_NextSealWindow = base.transform.Find("Bg/NextSeal").gameObject; + } + + public override void RegisterEvent() + { + this.m_NextSealBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnNextSealBtnClick)); + } + + protected override void OnShow() + { + base.OnShow(); + this.ShowNowSeal(); + this.ShowNewInfo(); + this.doc.ReqGetLevelSealInfo(); + } + + protected override void OnHide() + { + this.m_NextSealWindow.SetActive(false); + this.m_NowSealTex.SetTexturePath(""); + this._CDCounter = null; + base.OnHide(); + } + + public override void OnUnload() + { + this._CDCounter = null; + this.doc.View = null; + base.OnUnload(); + } + + public override void OnUpdate() + { + base.OnUpdate(); + bool flag = this.isCountdown && this._CDCounter != null; + if (flag) + { + this._CDCounter.Update(); + } + } + + private bool OnNextSealGoBattleClicked(IXUIButton sp) + { + DlgBase.singleton.SetVisible(false, true); + XSingleton.singleton.OpenSystem(XSysDefine.XSys_Activity, 0UL); + return true; + } + + private void ShowNextLevelSeal() + { + this.doc.ShowNextLevelSeal(false, this.m_NextSealWindow.transform.position); + } + + private bool OnNextSealBtnClick(IXUIButton btn) + { + this.ShowNextLevelSeal(); + return true; + } + + public void ShowNowSeal() + { + this.m_Condition.SetText(this.doc.GetConditionInfo()); + this.m_NowSeal.SetText(this.doc.GetNowSealTitleInfo()); + this.m_Description.SetText(XSingleton.singleton.ReplaceReturn(XStringDefineProxy.GetString("SEAL_DESCRIPTION"))); + DlgBase.singleton.ShowRemoveSealLeftTime(this.m_LeftTime, ref this._CDCounter, ref this.isCountdown); + } + + public void ShowNewInfo() + { + uint removeSealType = this.doc.GetRemoveSealType(XSingleton.singleton.XPlayerData.Level); + LevelSealTypeTable.RowData levelSealType = XLevelSealDocument.GetLevelSealType(removeSealType); + bool flag = !string.IsNullOrEmpty(levelSealType.NowSealImage); + if (flag) + { + this.m_NowSealTex.SetTexturePath(levelSealType.NowSealImage); + } + } + } +} -- cgit v1.1-26-g67d0