From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/UI/XGuildApproveSettingView.cs | 63 ++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/XGuildApproveSettingView.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/XGuildApproveSettingView.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/XGuildApproveSettingView.cs b/Client/Assets/Scripts/XMainClient/UI/XGuildApproveSettingView.cs new file mode 100644 index 00000000..9964c904 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/XGuildApproveSettingView.cs @@ -0,0 +1,63 @@ +using System; +using UILib; + +namespace XMainClient.UI +{ + internal class XGuildApproveSettingView : DlgHandlerBase + { + private IXUIInput m_PPTInput; + + private IXUICheckBox m_AutoApprove; + + private XGuildApproveDocument _doc; + + protected override void Init() + { + this.m_PPTInput = (base.PanelObject.transform.Find("SettingMenu/PPTInput").GetComponent("XUIInput") as IXUIInput); + this.m_AutoApprove = (base.PanelObject.transform.Find("SettingMenu/AutoApprove").GetComponent("XUICheckBox") as IXUICheckBox); + this._doc = XDocuments.GetSpecificDocument(XGuildApproveDocument.uuID); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + IXUIButton ixuibutton = base.PanelObject.transform.Find("Close").GetComponent("XUIButton") as IXUIButton; + ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this._OnCloseBtnClick)); + IXUIButton ixuibutton2 = base.PanelObject.transform.Find("SettingMenu/OK").GetComponent("XUIButton") as IXUIButton; + ixuibutton2.RegisterClickEventHandler(new ButtonClickEventHandler(this._OnOKBtnClicked)); + } + + protected override void OnShow() + { + base.OnShow(); + GuildApproveSetting approveSetting = this._doc.ApproveSetting; + this.m_PPTInput.SetText(approveSetting.GetStrPPT()); + this.m_AutoApprove.bChecked = approveSetting.autoApprove; + } + + private bool _OnOKBtnClicked(IXUIButton btn) + { + GuildApproveSetting guildApproveSetting = new GuildApproveSetting(); + string text = this.m_PPTInput.GetText(); + bool flag = text.Length == 0; + if (flag) + { + guildApproveSetting.PPT = 0; + } + else + { + guildApproveSetting.PPT = int.Parse(text); + } + guildApproveSetting.autoApprove = this.m_AutoApprove.bChecked; + this._doc.ReqSetApprove(guildApproveSetting); + base.SetVisible(false); + return true; + } + + private bool _OnCloseBtnClick(IXUIButton go) + { + base.SetVisible(false); + return true; + } + } +} -- cgit v1.1-26-g67d0