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/CutoverViewView.cs | 149 +++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/CutoverViewView.cs (limited to 'Client/Assets/Scripts/XMainClient/CutoverViewView.cs') diff --git a/Client/Assets/Scripts/XMainClient/CutoverViewView.cs b/Client/Assets/Scripts/XMainClient/CutoverViewView.cs new file mode 100644 index 00000000..5103899d --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/CutoverViewView.cs @@ -0,0 +1,149 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class CutoverViewView : DlgBase + { + public override string fileName + { + get + { + return "Battle/CutoverViewDlg"; + } + } + + public override bool exclusive + { + get + { + return true; + } + } + + public override int layer + { + get + { + return 1; + } + } + + public override int group + { + get + { + return 1; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + public override bool pushstack + { + get + { + return true; + } + } + + private uint _TimerID = 0u; + + public bool IsOpening = false; + + public XOperationMode SelectLook; + + protected override void Init() + { + } + + public override void RegisterEvent() + { + base.uiBehaviour.m_OK.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnOKClicked)); + base.uiBehaviour.m_25D.ID = (ulong)((long)XFastEnumIntEqualityComparer.ToInt(XOperationMode.X25D)); + base.uiBehaviour.m_25D.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnSetView)); + base.uiBehaviour.m_3D.ID = (ulong)((long)XFastEnumIntEqualityComparer.ToInt(XOperationMode.X3D)); + base.uiBehaviour.m_3D.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnSetView)); + } + + protected override void OnShow() + { + base.OnShow(); + XSingleton.singleton.MakeEffectEnable(XPostEffect.GausBlur, true); + DlgBase.singleton.SetMaqueeSwitch(false); + this.IsOpening = true; + base.uiBehaviour.m_25D.bChecked = true; + this.SelectLook = XOperationMode.X25D; + XSingleton.singleton.KillTimer(this._TimerID); + this._TimerID = XSingleton.singleton.SetTimer(float.Parse(XSingleton.singleton.GetValue("CutoverViewDeadLine")), new XTimerMgr.ElapsedEventHandler(this.SelectView), null); + } + + protected override void OnHide() + { + base.OnHide(); + XSingleton.singleton.KillTimer(this._TimerID); + this._TimerID = 0u; + XSingleton.singleton.MakeEffectEnable(XPostEffect.GausBlur, false); + DlgBase.singleton.SetMaqueeSwitch(true); + this.IsOpening = false; + } + + protected override void OnUnload() + { + XSingleton.singleton.KillTimer(this._TimerID); + this._TimerID = 0u; + XSingleton.singleton.MakeEffectEnable(XPostEffect.GausBlur, false); + DlgBase.singleton.SetMaqueeSwitch(true); + this.IsOpening = false; + base.OnUnload(); + } + + public override void OnUpdate() + { + base.OnUpdate(); + } + + public bool OnOKClicked(IXUIButton sp) + { + this.SelectView(null); + return true; + } + + private void SelectView(object param) + { + XSingleton.singleton.SelectView = true; + XOptionsDocument specificDocument = XDocuments.GetSpecificDocument(XOptionsDocument.uuID); + specificDocument.SetValue(XOptionsDefine.OD_VIEW, XFastEnumIntEqualityComparer.ToInt(this.SelectLook), true); + specificDocument.SetBattleOptionValue(); + DlgBase.singleton.SetView(XSingleton.singleton.OperationMode); + XSingleton.singleton.CreateAndPlay("Effects/FX_Particle/UIfx/UI_BattleDlg_Clip01", DlgBase.singleton.uiBehaviour.m_canvas, Vector3.zero, Vector3.one, 1f, true, 9f, true); + this.SetVisibleWithAnimation(false, null); + } + + private bool OnSetView(IXUICheckBox box) + { + bool flag = !box.bChecked; + bool result; + if (flag) + { + result = false; + } + else + { + this.SelectLook = (XOperationMode)box.ID; + result = true; + } + return result; + } + } +} -- cgit v1.1-26-g67d0