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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
|
using System;
using System.Collections.Generic;
using UILib;
using UnityEngine;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient
{
internal class XDragonGuildApproveDlg : DlgBase<XDragonGuildApproveDlg, XDragonGuildApproveBehaviour>
{
public override string fileName
{
get
{
return "DungeonTroop/DungeonTroopApproveDlg";
}
}
public override int layer
{
get
{
return 1;
}
}
public override int group
{
get
{
return 1;
}
}
public override bool autoload
{
get
{
return true;
}
}
private XDragonGuildDocument _DragonGuildDoc;
private XDragonGuildApproveDocument _ApproveDoc;
private XDragonGuildApproveSettingView _SettingView;
private bool m_ApproveStatu = false;
protected override void Init()
{
this._ApproveDoc = XDocuments.GetSpecificDocument<XDragonGuildApproveDocument>(XDragonGuildApproveDocument.uuID);
this._ApproveDoc.DragonGuildApproveView = this;
this._DragonGuildDoc = XDragonGuildDocument.Doc;
DlgHandlerBase.EnsureCreate<XDragonGuildApproveSettingView>(ref this._SettingView, base.uiBehaviour.m_SettingPanel, null, true);
}
protected override void OnUnload()
{
this._ApproveDoc.DragonGuildApproveView = null;
DlgHandlerBase.EnsureUnload<XDragonGuildApproveSettingView>(ref this._SettingView);
base.OnUnload();
}
public override void RegisterEvent()
{
base.RegisterEvent();
base.uiBehaviour.m_Close.RegisterClickEventHandler(new ButtonClickEventHandler(this._OnCloseBtnClick));
base.uiBehaviour.m_BtnOneKeyCancel.RegisterClickEventHandler(new ButtonClickEventHandler(this._OnOneKeyCancelBtnClick));
base.uiBehaviour.m_BtnSetting.RegisterClickEventHandler(new ButtonClickEventHandler(this._OnSettingBtnClick));
base.uiBehaviour.m_BtnSendMessage.RegisterClickEventHandler(new ButtonClickEventHandler(this._OnSendMessageBtnClick));
base.uiBehaviour.m_WrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this._WrapContentItemUpdated));
base.uiBehaviour.m_WrapContent.RegisterItemInitEventHandler(new WrapItemInitEventHandler(this._WrapContentInit));
}
protected override void OnShow()
{
this._ApproveDoc.ReqApproveList();
this._SettingView.SetVisible(false);
this.RefreshSetting();
this.RefreshMember();
}
public void RefreshSetting()
{
DragonGuildApproveSetting approveSetting = this._ApproveDoc.ApproveSetting;
bool flag = approveSetting.PPT == 0u;
if (flag)
{
base.uiBehaviour.m_RequiredPPT.SetText(XStringDefineProxy.GetString("NONE"));
}
else
{
base.uiBehaviour.m_RequiredPPT.SetText(approveSetting.GetStrPPT());
}
base.uiBehaviour.m_NeedApprove.SetText(approveSetting.autoApprove ? XStringDefineProxy.GetString("GUILD_APPROVE_NEEDNT") : XStringDefineProxy.GetString("GUILD_APPROVE_NEED"));
}
public void RefreshMember()
{
this.m_ApproveStatu = false;
base.uiBehaviour.m_MemberCount.SetText(string.Format("{0}/{1}", this._DragonGuildDoc.BaseData.memberCount, this._DragonGuildDoc.BaseData.maxMemberCount));
}
public void RefreshList(bool bResetPosition)
{
List<XDragonGuildMember> approveList = this._ApproveDoc.ApproveList;
int count = approveList.Count;
base.uiBehaviour.m_WrapContent.SetContentCount(count, false);
if (bResetPosition)
{
base.uiBehaviour.m_ScrollView.ResetPosition();
}
}
private void _WrapContentInit(Transform t, int index)
{
IXUIButton ixuibutton = t.Find("BtnOK").GetComponent("XUIButton") as IXUIButton;
IXUIButton ixuibutton2 = t.Find("BtnCancel").GetComponent("XUIButton") as IXUIButton;
ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this._OnOKBtnClick));
ixuibutton2.RegisterClickEventHandler(new ButtonClickEventHandler(this._OnCancelBtnClick));
}
private void _WrapContentItemUpdated(Transform t, int index)
{
bool flag = index < 0 || index >= this._ApproveDoc.ApproveList.Count;
if (!flag)
{
XDragonGuildMember xdragonGuildMember = this._ApproveDoc.ApproveList[index];
IXUILabel ixuilabel = t.Find("Name").GetComponent("XUILabel") as IXUILabel;
IXUILabel ixuilabel2 = t.Find("Level").GetComponent("XUILabel") as IXUILabel;
IXUILabel ixuilabel3 = t.Find("PPT").GetComponent("XUILabel") as IXUILabel;
IXUILabel ixuilabel4 = t.Find("ApplyTime").GetComponent("XUILabel") as IXUILabel;
IXUISprite ixuisprite = t.Find("Portrait").GetComponent("XUISprite") as IXUISprite;
IXUIButton ixuibutton = t.Find("BtnOK").GetComponent("XUIButton") as IXUIButton;
IXUIButton ixuibutton2 = t.Find("BtnCancel").GetComponent("XUIButton") as IXUIButton;
IXUISprite ixuisprite2 = t.Find("Profession").GetComponent("XUISprite") as IXUISprite;
ixuilabel.SetText(xdragonGuildMember.name);
ixuilabel2.SetText("Lv." + xdragonGuildMember.level);
ixuilabel3.SetText(xdragonGuildMember.ppt.ToString());
ixuilabel4.SetText(XSingleton<UiUtility>.singleton.TimeAgoFormatString(xdragonGuildMember.time));
ixuisprite.SetSprite(XSingleton<XProfessionSkillMgr>.singleton.GetProfHeadIcon2(xdragonGuildMember.profession));
ixuisprite2.SetSprite(XSingleton<XProfessionSkillMgr>.singleton.GetProfIcon(xdragonGuildMember.profession));
ixuibutton.ID = (ulong)((long)index);
ixuibutton2.ID = (ulong)((long)index);
}
}
private bool _OnCloseBtnClick(IXUIButton go)
{
this.SetVisibleWithAnimation(false, null);
return true;
}
private bool _OnOneKeyCancelBtnClick(IXUIButton go)
{
bool flag = !this._DragonGuildDoc.IsInDragonGuild();
bool result;
if (flag)
{
result = true;
}
else
{
XSingleton<UiUtility>.singleton.ShowModalDialog(XStringDefineProxy.GetString("GUILD_APPROVE_REJECT_ALL_CONFIRM"), XStringDefineProxy.GetString("COMMON_OK"), XStringDefineProxy.GetString("COMMON_CANCEL"), new ButtonClickEventHandler(this._OnOneKeyCancel));
result = true;
}
return result;
}
private bool _OnOneKeyCancel(IXUIButton go)
{
this._ApproveDoc.ReqRejectAll();
XSingleton<UiUtility>.singleton.CloseModalDlg();
return true;
}
private bool _OnSettingBtnClick(IXUIButton btn)
{
this._SettingView.SetVisible(true);
return true;
}
private bool _OnSendMessageBtnClick(IXUIButton btn)
{
XInvitationDocument specificDocument = XDocuments.GetSpecificDocument<XInvitationDocument>(XInvitationDocument.uuID);
specificDocument.SendDragonGuildInvitation();
return true;
}
private bool _OnOKBtnClick(IXUIButton btn)
{
bool approveStatu = this.m_ApproveStatu;
bool result;
if (approveStatu)
{
result = false;
}
else
{
this.m_ApproveStatu = true;
this._ApproveDoc.ReqApprove(true, (int)btn.ID);
result = true;
}
return result;
}
private bool _OnCancelBtnClick(IXUIButton btn)
{
bool approveStatu = this.m_ApproveStatu;
bool result;
if (approveStatu)
{
result = false;
}
else
{
this.m_ApproveStatu = true;
this._ApproveDoc.ReqApprove(false, (int)btn.ID);
result = true;
}
return result;
}
}
}
|