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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
|
using System;
using System.Collections.Generic;
using UILib;
using UnityEngine;
using XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient
{
internal class ChatGroupList : DlgBase<ChatGroupList, ChatGroupBehaviour>
{
public override string fileName
{
get
{
return "GameSystem/ChatGroupList";
}
}
public override bool autoload
{
get
{
return true;
}
}
public override bool isHideChat
{
get
{
return false;
}
}
public ChatGroupList.State state = ChatGroupList.State.Add;
private List<CGroupPlayerInfo> players;
public enum State
{
Add,
Rm
}
protected override void Init()
{
base.Init();
}
public override void RegisterEvent()
{
base.uiBehaviour.m_wrap.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.WrapContentItemUpdated));
base.uiBehaviour.m_sprClose.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnCloseClick));
base.uiBehaviour.m_add.ID = 1UL;
base.uiBehaviour.m_add.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnTabSelectionChanged));
base.uiBehaviour.m_rm.ID = 2UL;
base.uiBehaviour.m_rm.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnTabSelectionChanged));
}
protected override void OnShow()
{
base.OnShow();
GroupChatDocument specificDocument = XDocuments.GetSpecificDocument<GroupChatDocument>(GroupChatDocument.uuID);
specificDocument.ReqGetGroupInfo(DlgBase<XChatView, XChatBehaviour>.singleton.ChatGroupId);
}
protected override void OnHide()
{
DlgBase<XChatView, XChatBehaviour>.singleton.OnFocus();
base.OnHide();
}
public void SetCB()
{
this.state = ChatGroupList.State.Add;
base.uiBehaviour.m_add.ForceSetFlag(true);
this.Refresh();
}
public void Refresh()
{
GroupChatDocument specificDocument = XDocuments.GetSpecificDocument<GroupChatDocument>(GroupChatDocument.uuID);
bool flag = specificDocument.players != null;
if (flag)
{
CGroupPlayerInfo[] array = new CGroupPlayerInfo[specificDocument.players.Count];
specificDocument.players.CopyTo(array);
this.SelectByState(array);
base.uiBehaviour.m_wrap.SetContentCount(this.players.Count, false);
}
}
private bool OnTabSelectionChanged(IXUICheckBox ckb)
{
bool bChecked = ckb.bChecked;
if (bChecked)
{
ulong id = ckb.ID;
bool flag = id == 1UL;
if (flag)
{
this.state = ChatGroupList.State.Add;
}
else
{
this.state = ChatGroupList.State.Rm;
}
this.Refresh();
}
return true;
}
private void SelectByState(CGroupPlayerInfo[] pp)
{
bool flag = this.players == null;
if (flag)
{
this.players = new List<CGroupPlayerInfo>();
}
else
{
this.players.Clear();
}
int i = 0;
int num = pp.Length;
while (i < num)
{
bool flag2 = this.state == ChatGroupList.State.Add;
if (flag2)
{
bool flag3 = pp[i].degree >= 0;
if (flag3)
{
this.players.Add(pp[i]);
}
}
else
{
bool flag4 = pp[i].degree < 0;
if (flag4)
{
bool flag5 = pp[i].roleid != XSingleton<XAttributeMgr>.singleton.XPlayerData.RoleID;
if (flag5)
{
this.players.Add(pp[i]);
}
}
}
i++;
}
bool flag6 = this.state == ChatGroupList.State.Add;
if (flag6)
{
this.players.Sort(new Comparison<CGroupPlayerInfo>(this.Sort));
}
}
private int Sort(CGroupPlayerInfo x, CGroupPlayerInfo y)
{
return y.degree - x.degree;
}
private void OnCloseClick(IXUISprite spr)
{
this.SetVisible(false, true);
}
private void WrapContentItemUpdated(Transform t, int index)
{
bool flag = this.players == null || this.players[index] == null;
if (!flag)
{
IXUISprite ixuisprite = t.Find("head").GetComponent("XUISprite") as IXUISprite;
IXUILabel ixuilabel = t.Find("level").GetComponent("XUILabel") as IXUILabel;
IXUILabel ixuilabel2 = t.Find("UID").GetComponent("XUILabel") as IXUILabel;
IXUILabel ixuilabel3 = t.Find("PPT").GetComponent("XUILabel") as IXUILabel;
IXUILabelSymbol ixuilabelSymbol = t.Find("name").GetComponent("XUILabelSymbol") as IXUILabelSymbol;
IXUISprite ixuisprite2 = t.Find("agree").GetComponent("XUISprite") as IXUISprite;
IXUILabel ixuilabel4 = t.Find("agree/T").GetComponent("XUILabel") as IXUILabel;
IXUILabel ixuilabel5 = t.Find("guild").GetComponent("XUILabel") as IXUILabel;
IXUISprite ixuisprite3 = t.Find("ProfIcon").GetComponent("XUISprite") as IXUISprite;
int profession = (int)this.players[index].profession;
ixuisprite3.spriteName = XSingleton<XProfessionSkillMgr>.singleton.GetProfIcon(profession);
ixuisprite.spriteName = XSingleton<XProfessionSkillMgr>.singleton.GetProfHeadIcon2(profession);
string text = (this.state == ChatGroupList.State.Add) ? XStringDefineProxy.GetString("CHAT_GROUP_PUSH") : XStringDefineProxy.GetString("CHAT_GROUP_TICKOUT");
ixuilabel4.SetText(text);
ixuisprite2.ID = this.players[index].roleid;
string text2 = this.players[index].guild;
bool flag2 = string.IsNullOrEmpty(text2);
if (flag2)
{
text2 = XStringDefineProxy.GetString("NONE");
}
ixuilabel5.SetText(text2);
ixuisprite2.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OpItemClick));
ixuilabel.SetText(this.players[index].level.ToString());
ixuilabel3.SetText(this.players[index].ppt.ToString());
ixuilabelSymbol.InputText = this.players[index].rolename;
ixuilabel2.SetText(this.players[index].uid.ToString());
}
}
private void OpItemClick(IXUISprite spr)
{
GroupChatDocument specificDocument = XDocuments.GetSpecificDocument<GroupChatDocument>(GroupChatDocument.uuID);
CGroupPlayerInfo cgroupPlayerInfo = null;
bool flag = false;
for (int i = 0; i < this.players.Count; i++)
{
bool flag2 = this.players[i].roleid == spr.ID;
if (flag2)
{
cgroupPlayerInfo = this.players[i];
}
}
List<ulong> list = new List<ulong>();
List<ulong> list2 = new List<ulong>();
bool flag3 = cgroupPlayerInfo.degree == -1;
if (flag3)
{
CBrifGroupInfo currGroup = specificDocument.currGroup;
bool flag4 = currGroup != null && currGroup.leaderid == cgroupPlayerInfo.roleid;
if (flag4)
{
flag = true;
}
else
{
list2.Add(cgroupPlayerInfo.roleid);
}
}
else
{
list.Add(cgroupPlayerInfo.roleid);
}
bool flag5 = flag;
if (flag5)
{
DlgBase<XChatView, XChatBehaviour>.singleton.OnGroupQuitClick(null);
}
else
{
bool flag6 = DlgBase<XChatView, XChatBehaviour>.singleton.ChatGroupId > 0UL;
if (flag6)
{
specificDocument.ReqChangePlayer(DlgBase<XChatView, XChatBehaviour>.singleton.ChatGroupId, list, list2);
}
}
}
}
}
|