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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
|
using System;
using System.Collections.Generic;
using KKSG;
using UILib;
using UnityEngine;
using XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient.UI
{
internal class XDragonRecordHandler : DlgHandlerBase
{
private XDragonPartnerDocument _doc = null;
private XExpeditionDocument _expDoc = null;
private XDragonNestDocument _dnDoc = null;
private List<DragonGroupRoleInfo> m_dragonGroupRoleInfoList;
private IXUIButton m_BtnDragonNest;
private IXUIButton m_BtnRecruit;
private IXUIScrollView m_ScrollView;
private IXUIWrapContent m_WrapContent;
private Transform _EmptyDetail;
protected override void Init()
{
base.Init();
this._doc = XDocuments.GetSpecificDocument<XDragonPartnerDocument>(XDragonPartnerDocument.uuID);
this._expDoc = XDocuments.GetSpecificDocument<XExpeditionDocument>(XExpeditionDocument.uuID);
this._dnDoc = XDocuments.GetSpecificDocument<XDragonNestDocument>(XDragonNestDocument.uuID);
this.m_BtnDragonNest = (base.PanelObject.transform.Find("Btn_DragonNest").GetComponent("XUIButton") as IXUIButton);
this.m_BtnRecruit = (base.PanelObject.transform.Find("Btn_Recruit").GetComponent("XUIButton") as IXUIButton);
this.m_ScrollView = (base.PanelObject.transform.Find("detail/detail").GetComponent("XUIScrollView") as IXUIScrollView);
this.m_WrapContent = (base.PanelObject.transform.Find("detail/detail/WrapContent").GetComponent("XUIWrapContent") as IXUIWrapContent);
this._EmptyDetail = base.PanelObject.transform.Find("detail/EmptyDetail");
}
protected override void OnShow()
{
base.OnShow();
this.RefreshData();
this._doc.ReqDragonGroupRoleInfo();
}
public override void RefreshData()
{
this.SetupPartnerInfo();
}
public override void RegisterEvent()
{
base.RegisterEvent();
this.m_BtnDragonNest.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickBtnDragonNest));
this.m_BtnRecruit.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickBtnRecruit));
this.m_WrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.PartnerWrapListUpdate));
}
public override void OnUnload()
{
this.m_dragonGroupRoleInfoList = null;
base.OnUnload();
}
private void PartnerWrapListUpdate(Transform item, int index)
{
bool flag = this.m_dragonGroupRoleInfoList == null || index >= this.m_dragonGroupRoleInfoList.Count;
if (!flag)
{
IXUISprite ixuisprite = item.GetComponent("XUISprite") as IXUISprite;
ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnClickItem));
IXUISprite ixuisprite2 = item.Find("Info/Profession").GetComponent("XUISprite") as IXUISprite;
IXUILabel ixuilabel = item.Find("Info/Name").GetComponent("XUILabel") as IXUILabel;
IXUILabel ixuilabel2 = item.Find("Info/Level").GetComponent("XUILabel") as IXUILabel;
IXUILabel ixuilabel3 = item.Find("Info/AvatarBG/BattlePointBG/Power").GetComponent("XUILabel") as IXUILabel;
IXUILabel ixuilabel4 = item.Find("Info/GuildName").GetComponent("XUILabel") as IXUILabel;
IXUISprite ixuisprite3 = item.Find("Info/AvatarBG/Avatar").GetComponent("XUISprite") as IXUISprite;
IXUISprite ixuisprite4 = item.Find("Info/AvatarBG/AvatarFrame").GetComponent("XUISprite") as IXUISprite;
IXUILabel ixuilabel5 = item.Find("Stage/Name").GetComponent("XUILabel") as IXUILabel;
IXUILabel ixuilabel6 = item.Find("Stage/date/Date").GetComponent("XUILabel") as IXUILabel;
IXUILabel ixuilabel7 = item.Find("Stage/date/Time").GetComponent("XUILabel") as IXUILabel;
IXUILabel ixuilabel8 = item.Find("Stage/Times/Num").GetComponent("XUILabel") as IXUILabel;
Transform transform = item.Find("add");
IXUIButton ixuibutton = item.Find("add").GetComponent("XUIButton") as IXUIButton;
ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickAddFriend));
Transform transform2 = item.Find("hgd");
IXUILabel ixuilabel9 = transform2.Find("Level").GetComponent("XUILabel") as IXUILabel;
IXUISprite ixuisprite5 = transform2.Find("Level/Mark").GetComponent("XUISprite") as IXUISprite;
ixuisprite5.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnClickDegreeHeart));
IXUIButton ixuibutton2 = item.Find("chat/btn").GetComponent("XUIButton") as IXUIButton;
ixuibutton2.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickChatBtn));
DragonGroupRoleInfo dragonGroupRoleInfo = this.m_dragonGroupRoleInfoList[index];
ixuibutton.ID = dragonGroupRoleInfo.roleid;
ixuibutton2.ID = (ulong)((long)index);
ixuisprite.ID = dragonGroupRoleInfo.roleid;
ixuisprite2.SetSprite(XSingleton<XProfessionSkillMgr>.singleton.GetProfIcon((int)dragonGroupRoleInfo.profession));
ixuilabel.SetText(dragonGroupRoleInfo.rolename);
ixuilabel2.SetText(dragonGroupRoleInfo.level.ToString());
ixuilabel3.SetText(dragonGroupRoleInfo.fighting.ToString());
ixuilabel4.SetText(string.IsNullOrEmpty(dragonGroupRoleInfo.guild) ? XStringDefineProxy.GetString("NONE") : dragonGroupRoleInfo.guild);
ixuisprite3.SetSprite(XSingleton<XProfessionSkillMgr>.singleton.GetProfHeadIcon2((int)dragonGroupRoleInfo.profession));
bool flag2 = dragonGroupRoleInfo.pre != null;
if (flag2)
{
XSingleton<UiUtility>.singleton.ParseHeadIcon(dragonGroupRoleInfo.pre.setid, ixuisprite4);
}
else
{
ixuisprite4.SetVisible(false);
}
ExpeditionTable.RowData expeditionDataByID = this._expDoc.GetExpeditionDataByID((int)dragonGroupRoleInfo.stageID);
bool flag3 = expeditionDataByID != null;
if (flag3)
{
ixuilabel5.SetText(XExpeditionDocument.GetFullName(expeditionDataByID));
DateTime dateTime = XSingleton<UiUtility>.singleton.TimeNow(dragonGroupRoleInfo.stageTime, true);
ixuilabel6.SetText(dateTime.ToString("yyyy.MM.dd"));
ixuilabel7.SetText(dateTime.ToString("HH:mm"));
ixuilabel8.SetText(dragonGroupRoleInfo.stageCount.ToString());
}
else
{
ixuilabel5.SetText("");
ixuilabel6.SetText("");
ixuilabel7.SetText("");
ixuilabel8.SetText("");
}
XFriendData friendDataById = DlgBase<XFriendsView, XFriendsBehaviour>.singleton.GetFriendDataById(dragonGroupRoleInfo.roleid);
bool flag4 = friendDataById != null;
if (flag4)
{
transform.gameObject.SetActive(false);
transform2.gameObject.SetActive(true);
bool flag5 = friendDataById.degreeAll < XSingleton<XFriendsStaticData>.singleton.MaxFriendlyEvaluation;
if (flag5)
{
ixuilabel9.SetText(friendDataById.degreeAll.ToString());
}
else
{
ixuilabel9.SetText("MAX");
}
float num = friendDataById.degreeAll;
num /= XSingleton<XFriendsStaticData>.singleton.MaxFriendlyEvaluation;
ixuisprite5.SetFillAmount(1f - num);
ixuisprite5.ID = (ulong)friendDataById.degreeAll;
}
else
{
transform.gameObject.SetActive(true);
transform2.gameObject.SetActive(false);
}
}
}
private void OnClickDegreeHeart(IXUISprite spr)
{
XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("FRIENDS_DEGREE_HINT_TEXT_FMT", new object[]
{
spr.ID
}), "fece00");
}
private void OnClickItem(IXUISprite sp)
{
ulong id = sp.ID;
XCharacterCommonMenuDocument.ReqCharacterMenuInfo(id, false);
}
private bool OnClickAddFriend(IXUIButton btn)
{
DlgBase<XFriendsView, XFriendsBehaviour>.singleton.AddFriendById(btn.ID);
return true;
}
private bool OnClickBtnDragonNest(IXUIButton btn)
{
DlgBase<XDragonNestView, XDragonNestBehaviour>.singleton.SetVisibleWithAnimation(true, null);
return true;
}
private bool OnClickBtnRecruit(IXUIButton btn)
{
XSingleton<XGameSysMgr>.singleton.OpenSystem(XSysDefine.XSys_GroupRecruit, 0UL);
return true;
}
private bool OnClickChatBtn(IXUIButton btn)
{
int num = (int)btn.ID;
bool flag = num < 0 || num >= this.m_dragonGroupRoleInfoList.Count;
bool result;
if (flag)
{
result = false;
}
else
{
DragonGroupRoleInfo dragonGroupRoleInfo = this.m_dragonGroupRoleInfoList[num];
bool flag2 = DlgBase<XFriendsView, XFriendsBehaviour>.singleton.IsBlock(dragonGroupRoleInfo.roleid);
if (flag2)
{
XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("CHAT_BLOCK_2"), "fece00");
}
else
{
ChatFriendData chatFriendData = new ChatFriendData();
chatFriendData.name = dragonGroupRoleInfo.rolename;
chatFriendData.roleid = dragonGroupRoleInfo.roleid;
chatFriendData.powerpoint = dragonGroupRoleInfo.fighting;
chatFriendData.profession = dragonGroupRoleInfo.profession;
chatFriendData.setid = ((dragonGroupRoleInfo.pre != null) ? dragonGroupRoleInfo.pre.setid : new List<uint>());
chatFriendData.isfriend = DlgBase<XFriendsView, XFriendsBehaviour>.singleton.IsMyFriend(dragonGroupRoleInfo.roleid);
chatFriendData.msgtime = DateTime.Now;
chatFriendData.viplevel = 0u;
XEntity entity = XSingleton<XEntityMgr>.singleton.GetEntity(dragonGroupRoleInfo.roleid);
bool flag3 = entity != null;
if (flag3)
{
XRoleAttributes xroleAttributes = (XRoleAttributes)entity.Attributes;
chatFriendData.profession = (uint)xroleAttributes.Profession;
}
DlgBase<XChatView, XChatBehaviour>.singleton.PrivateChatTo(chatFriendData);
}
result = true;
}
return result;
}
private void SetupPartnerInfo()
{
List<DragonGroupRoleInfo> dragonGroupRoleInfoLsit = this._doc.DragonGroupRoleInfoLsit;
bool flag = this.m_dragonGroupRoleInfoList == null;
if (flag)
{
this.m_dragonGroupRoleInfoList = new List<DragonGroupRoleInfo>();
}
this.m_dragonGroupRoleInfoList.Clear();
bool flag2 = dragonGroupRoleInfoLsit != null;
if (flag2)
{
for (int i = 0; i < dragonGroupRoleInfoLsit.Count; i++)
{
this.m_dragonGroupRoleInfoList.Add(dragonGroupRoleInfoLsit[i]);
}
}
this._EmptyDetail.gameObject.SetActive(this.m_dragonGroupRoleInfoList.Count == 0);
this.SortRoleInfoList();
bool flag3 = this.m_dragonGroupRoleInfoList.Count == 0;
if (flag3)
{
this.m_WrapContent.SetContentCount(0, false);
}
else
{
this.m_WrapContent.SetContentCount(this.m_dragonGroupRoleInfoList.Count, false);
}
this.m_ScrollView.ResetPosition();
}
private void SortRoleInfoList()
{
this.m_dragonGroupRoleInfoList.Sort(new Comparison<DragonGroupRoleInfo>(this.ComparePartner));
}
private int ComparePartner(DragonGroupRoleInfo a, DragonGroupRoleInfo b)
{
bool flag = a.stageTime != b.stageTime;
int result;
if (flag)
{
result = b.stageTime.CompareTo(a.stageTime);
}
else
{
result = b.stageCount.CompareTo(a.stageCount);
}
return result;
}
}
}
|