diff options
author | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
commit | 6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch) | |
tree | 7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/UI/XDragonGuildApproveSettingView.cs |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/UI/XDragonGuildApproveSettingView.cs')
-rw-r--r-- | Client/Assets/Scripts/XMainClient/UI/XDragonGuildApproveSettingView.cs | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/UI/XDragonGuildApproveSettingView.cs b/Client/Assets/Scripts/XMainClient/UI/XDragonGuildApproveSettingView.cs new file mode 100644 index 00000000..d92134e1 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/XDragonGuildApproveSettingView.cs @@ -0,0 +1,63 @@ +using System;
+using UILib;
+
+namespace XMainClient.UI
+{
+ internal class XDragonGuildApproveSettingView : DlgHandlerBase
+ {
+ private IXUIInput m_PPTInput;
+
+ private IXUICheckBox m_AutoApprove;
+
+ private XDragonGuildApproveDocument _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<XDragonGuildApproveDocument>(XDragonGuildApproveDocument.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();
+ DragonGuildApproveSetting approveSetting = this._doc.ApproveSetting;
+ this.m_PPTInput.SetText(approveSetting.GetStrPPT());
+ this.m_AutoApprove.bChecked = approveSetting.autoApprove;
+ }
+
+ private bool _OnOKBtnClicked(IXUIButton btn)
+ {
+ DragonGuildApproveSetting dragonGuildApproveSetting = new DragonGuildApproveSetting();
+ string text = this.m_PPTInput.GetText();
+ bool flag = text.Length == 0;
+ if (flag)
+ {
+ dragonGuildApproveSetting.PPT = 0u;
+ }
+ else
+ {
+ dragonGuildApproveSetting.PPT = uint.Parse(text);
+ }
+ dragonGuildApproveSetting.autoApprove = this.m_AutoApprove.bChecked;
+ this._doc.ReqSetApprove(dragonGuildApproveSetting);
+ base.SetVisible(false);
+ return true;
+ }
+
+ private bool _OnCloseBtnClick(IXUIButton go)
+ {
+ base.SetVisible(false);
+ return true;
+ }
+ }
+}
|