blob: 9964c90444f4a032e5b117338954a99cdc53bc95 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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;
}
}
}
|