summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/UI/XGuildApproveSettingView.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-01-25 14:28:30 +0800
committerchai <chaifix@163.com>2021-01-25 14:28:30 +0800
commit6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch)
tree7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/UI/XGuildApproveSettingView.cs
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/UI/XGuildApproveSettingView.cs')
-rw-r--r--Client/Assets/Scripts/XMainClient/UI/XGuildApproveSettingView.cs63
1 files changed, 63 insertions, 0 deletions
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>(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;
+ }
+ }
+}