From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/XDragonGuildApplyView.cs | 136 +++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/XDragonGuildApplyView.cs (limited to 'Client/Assets/Scripts/XMainClient/XDragonGuildApplyView.cs') diff --git a/Client/Assets/Scripts/XMainClient/XDragonGuildApplyView.cs b/Client/Assets/Scripts/XMainClient/XDragonGuildApplyView.cs new file mode 100644 index 00000000..22f92e71 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XDragonGuildApplyView.cs @@ -0,0 +1,136 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XDragonGuildApplyView : DlgBase + { + public override string fileName + { + get + { + return "DungeonTroop/DungeonTroopApplyDlg"; + } + } + + public override int layer + { + get + { + return 1; + } + } + + public override int group + { + get + { + return 1; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + private ulong m_UID; + + private string m_Name; + + private XDragonGuildListDocument _doc; + + private XFx m_xfx; + + protected override void Init() + { + this._doc = XDragonGuildListDocument.Doc; + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + base.uiBehaviour.m_Close.RegisterClickEventHandler(new ButtonClickEventHandler(this._OnCloseBtnClick)); + base.uiBehaviour.m_BtnApply.RegisterClickEventHandler(new ButtonClickEventHandler(this._OnApplyBtnClicked)); + base.uiBehaviour.m_BtnEnterGuild.RegisterClickEventHandler(new ButtonClickEventHandler(this._OnEnterSceneBtnClicked)); + } + + public void ShowApply(ulong uid, string name, uint ppt, bool bNeedApprove) + { + bool flag = !base.IsVisible(); + if (flag) + { + this.SetVisible(true, true); + } + this.m_UID = uid; + this.m_Name = name; + base.uiBehaviour.m_PPT.SetText(ppt.ToString()); + base.uiBehaviour.m_NeedApprove.SetText(bNeedApprove ? XStringDefineProxy.GetString("YES") : XStringDefineProxy.GetString("NO")); + base.uiBehaviour.m_ApplyMenu.SetActive(true); + base.uiBehaviour.m_ResultMenu.SetActive(false); + base.uiBehaviour.m_Close.SetVisible(true); + } + + public void Hide() + { + this.SetVisible(false, true); + this.DestroyFx(this.m_xfx); + } + + public void ShowResult(bool bCreate, string name) + { + bool flag = !base.IsVisible(); + if (flag) + { + this.SetVisible(true, true); + } + string text = bCreate ? XStringDefineProxy.GetString("CREATE") : XStringDefineProxy.GetString("JOIN"); + base.uiBehaviour.m_ResultNote.SetText(XStringDefineProxy.GetString("DRAGON_GUILD_APPLY_SUCCESS", new object[] + { + text, + name + })); + base.uiBehaviour.m_ApplyMenu.SetActive(false); + base.uiBehaviour.m_ResultMenu.SetActive(true); + base.uiBehaviour.m_Close.SetVisible(false); + this.DestroyFx(this.m_xfx); + this.m_xfx = XSingleton.singleton.CreateFx("Effects/FX_Particle/UIfx/UI_yh", null, true); + this.m_xfx.Play(DlgBase.singleton.uiBehaviour.m_FxFirework.transform, Vector3.zero, Vector3.one, 1f, true, false); + } + + public void DestroyFx(XFx fx) + { + bool flag = fx == null; + if (!flag) + { + XSingleton.singleton.DestroyFx(fx, true); + } + } + + private bool _OnApplyBtnClicked(IXUIButton btn) + { + this._doc.ReqApplyDragonGuild(this.m_UID, this.m_Name); + return true; + } + + private bool _OnEnterSceneBtnClicked(IXUIButton btn) + { + this.Hide(); + DlgBase.singleton.RefreshDragonGuildPage(); + return true; + } + + private bool _OnCloseBtnClick(IXUIButton go) + { + this.Hide(); + return true; + } + } +} -- cgit v1.1-26-g67d0