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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
|
using System;
using KKSG;
using UILib;
using UnityEngine;
using XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient.UI
{
internal class XBriefLevelupView : DlgBase<XBriefLevelupView, XBriefLevelupBehaviour>
{
public override string fileName
{
get
{
return "GameSystem/BriefLevelupDlg";
}
}
public override int group
{
get
{
return 1;
}
}
public override bool autoload
{
get
{
return true;
}
}
private XFPStrengthenDocument _doc = null;
private XDailyActivitiesDocument _activityDoc = null;
public XUIPool m_FpStrengthenPool = new XUIPool(XSingleton<XGameUI>.singleton.m_uiTool);
public XUIPool m_FpButtonPool = new XUIPool(XSingleton<XGameUI>.singleton.m_uiTool);
private XSysDefine[] _Funcs = new XSysDefine[]
{
XSysDefine.XSys_GuildDailyTask,
XSysDefine.XSys_Reward_Activity,
XSysDefine.XSys_Level_Elite,
XSysDefine.XSys_Activity_Nest
};
private XBriefLevelupView.DataItem[] DataArray;
private class DataItem
{
public int Index
{
get
{
return this.m_index;
}
}
private int m_index = 0;
public XSysDefine SysId = XSysDefine.XSys_None;
public bool IsOpen = false;
public bool IsRecommend = false;
public string RecommendTxt = "";
public string NameTxt = "";
public string TipsTxt = "";
public string IconTxt = "";
public DataItem(int index)
{
this.m_index = index;
}
}
protected override void Init()
{
this._doc = XDocuments.GetSpecificDocument<XFPStrengthenDocument>(XFPStrengthenDocument.uuID);
this._activityDoc = XDocuments.GetSpecificDocument<XDailyActivitiesDocument>(XDailyActivitiesDocument.uuID);
this.DataArray = new XBriefLevelupView.DataItem[this._Funcs.Length];
for (int i = 0; i < this.DataArray.Length; i++)
{
XBriefLevelupView.DataItem dataItem = new XBriefLevelupView.DataItem(i);
dataItem.SysId = this._Funcs[i];
this.DataArray[i] = dataItem;
this.SetRecommendInfo(this.DataArray[i].Index, ref this.DataArray[i].IsRecommend, ref this.DataArray[i].RecommendTxt);
this.SetBaseInfo(this.DataArray[i].SysId, ref this.DataArray[i].IconTxt, ref this.DataArray[i].NameTxt);
}
}
protected override void OnShow()
{
base.OnShow();
this._activityDoc.QueryDailyActivityData();
}
public override void RegisterEvent()
{
base.uiBehaviour.m_Close.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseClicked));
base.uiBehaviour.m_Close2.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnCloseClicked));
}
public void FillContent()
{
this.FillData();
base.uiBehaviour.m_FuncPool.ReturnAll(false);
Vector3 tplPos = base.uiBehaviour.m_FuncPool.TplPos;
for (int i = 0; i < this.DataArray.Length; i++)
{
XBriefLevelupView.DataItem dataItem = this.DataArray[i];
GameObject gameObject = base.uiBehaviour.m_FuncPool.FetchGameObject(false);
gameObject.transform.localPosition = new Vector3(tplPos.x + (float)(i * base.uiBehaviour.m_FuncPool.TplWidth), tplPos.y);
IXUISprite ixuisprite = gameObject.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite;
IXUILabel ixuilabel = gameObject.transform.Find("Name").GetComponent("XUILabel") as IXUILabel;
IXUISprite ixuisprite2 = gameObject.GetComponent("XUISprite") as IXUISprite;
GameObject gameObject2 = gameObject.transform.Find("Recommend").gameObject;
GameObject gameObject3 = gameObject.transform.Find("Noopen").gameObject;
IXUILabel ixuilabel2 = gameObject.transform.Find("Noopen/T").GetComponent("XUILabel") as IXUILabel;
IXUILabel ixuilabel3 = gameObject.transform.Find("Recommend/Exp").GetComponent("XUILabel") as IXUILabel;
gameObject2.SetActive(dataItem.IsRecommend);
ixuilabel3.SetText(dataItem.RecommendTxt);
gameObject3.SetActive(!dataItem.IsOpen);
ixuilabel2.SetText(dataItem.TipsTxt);
ixuisprite.SetSprite(dataItem.IconTxt);
ixuilabel.SetText(dataItem.NameTxt);
ixuisprite2.ID = (ulong)((long)XFastEnumIntEqualityComparer<XSysDefine>.ToInt(dataItem.SysId));
ixuisprite2.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.GoToStrengthSys));
}
}
private void FillData()
{
for (int i = 0; i < this.DataArray.Length; i++)
{
this.SysIsOpen(this.DataArray[i].SysId, ref this.DataArray[i].IsOpen, ref this.DataArray[i].TipsTxt);
}
for (int j = 0; j < this.DataArray.Length; j++)
{
for (int k = j + 1; k < this.DataArray.Length; k++)
{
bool flag = !this.DataArray[j].IsOpen && this.DataArray[k].IsOpen;
if (flag)
{
XBriefLevelupView.DataItem dataItem = this.DataArray[j];
this.DataArray[j] = this.DataArray[k];
this.DataArray[k] = dataItem;
}
}
}
}
private void SysIsOpen(XSysDefine define, ref bool isOpen, ref string tips)
{
bool flag = !XSingleton<XGameSysMgr>.singleton.IsSystemOpened(define);
if (flag)
{
isOpen = false;
tips = XSingleton<XStringTable>.singleton.GetString("NotOpen");
}
else
{
if (define <= XSysDefine.XSys_Reward_Activity)
{
if (define != XSysDefine.XSys_Level_Elite)
{
if (define == XSysDefine.XSys_Reward_Activity)
{
bool flag2 = this._activityDoc.IsFinishedAllActivity();
if (flag2)
{
isOpen = false;
tips = XSingleton<XStringTable>.singleton.GetString("LEVEL_CHALLENGE_FINISH");
return;
}
}
}
else
{
XExpeditionDocument specificDocument = XDocuments.GetSpecificDocument<XExpeditionDocument>(XExpeditionDocument.uuID);
int num = specificDocument.GetDayCount(TeamLevelType.TeamLevelAbyss, null);
bool flag3 = num <= 0;
if (flag3)
{
isOpen = false;
tips = XSingleton<XStringTable>.singleton.GetString("ERR_TEAM_TOWER_DAYCOUNT");
return;
}
num = (int)XSingleton<XGame>.singleton.Doc.XBagDoc.GetVirtualItemCount(ItemEnum.FATIGUE);
bool flag4 = num < XSingleton<XGlobalConfig>.singleton.GetInt("EliteNeedEnergy");
if (flag4)
{
isOpen = false;
tips = XSingleton<XStringTable>.singleton.GetString("ERR_SCENE_NOFATIGUE");
return;
}
}
}
else if (define != XSysDefine.XSys_Activity_Nest)
{
if (define == XSysDefine.XSys_GuildDailyTask)
{
XTaskDocument specificDocument2 = XDocuments.GetSpecificDocument<XTaskDocument>(XTaskDocument.uuID);
TaskStatus taskStatue = specificDocument2.GetTaskStatue();
bool flag5 = taskStatue == TaskStatus.TaskStatus_Over;
if (flag5)
{
isOpen = false;
tips = XSingleton<XStringTable>.singleton.GetString("LEVEL_CHALLENGE_FINISH");
return;
}
}
}
else
{
XExpeditionDocument specificDocument3 = XDocuments.GetSpecificDocument<XExpeditionDocument>(XExpeditionDocument.uuID);
int num2 = specificDocument3.GetDayCount(TeamLevelType.TeamLevelNest, null);
bool flag6 = num2 <= 0;
if (flag6)
{
isOpen = false;
tips = XSingleton<XStringTable>.singleton.GetString("ERR_TEAM_TOWER_DAYCOUNT");
return;
}
num2 = (int)XSingleton<XGame>.singleton.Doc.XBagDoc.GetVirtualItemCount(ItemEnum.FATIGUE);
bool flag7 = num2 < XSingleton<XGlobalConfig>.singleton.GetInt("NestNeedEnergy");
if (flag7)
{
isOpen = false;
tips = XSingleton<XStringTable>.singleton.GetString("ERR_SCENE_NOFATIGUE");
return;
}
}
isOpen = true;
}
}
private void SetRecommendInfo(int index, ref bool isRecommon, ref string recommonTxt)
{
string value = XSingleton<XGlobalConfig>.singleton.GetValue("LevelUpExpText");
bool flag = string.IsNullOrEmpty(value);
if (!flag)
{
string[] array = value.Split(XGlobalConfig.ListSeparator);
bool flag2 = array == null;
if (!flag2)
{
int num = 0;
while (num < array.Length && num < this.DataArray.Length)
{
bool flag3 = num != index;
if (!flag3)
{
string[] array2 = array[num].Split(XGlobalConfig.SequenceSeparator);
bool flag4 = array2 == null;
if (!flag4)
{
bool flag5 = array2.Length != 0;
if (flag5)
{
isRecommon = (array2[0] == "1");
}
bool flag6 = array2.Length > 1;
if (flag6)
{
recommonTxt = array2[1];
}
break;
}
}
num++;
}
}
}
}
private void SetBaseInfo(XSysDefine define, ref string iconTxt, ref string nameTxt)
{
FpStrengthenTable.RowData rowData = this._doc.SearchBySysID(define);
bool flag = rowData == null;
if (flag)
{
XSingleton<XDebug>.singleton.AddErrorLog("error,no this data in BQ", "---->", define.ToString(), null, null, null);
}
else
{
iconTxt = rowData.BQImageID;
nameTxt = rowData.BQName;
}
}
private XBriefLevelupView.DataItem GetDataBySystemId(XSysDefine systemId)
{
for (int i = 0; i < this.DataArray.Length; i++)
{
bool flag = this.DataArray[i].SysId == systemId;
if (flag)
{
return this.DataArray[i];
}
}
return null;
}
public bool OnCloseClicked(IXUIButton sp)
{
this.SetVisible(false, true);
return true;
}
public void OnCloseClicked(IXUISprite sp)
{
this.SetVisible(false, true);
}
public void GoToStrengthSys(IXUISprite sp)
{
this.SetVisible(false, true);
XBriefLevelupView.DataItem dataBySystemId = this.GetDataBySystemId((XSysDefine)sp.ID);
bool flag = dataBySystemId == null || !dataBySystemId.IsOpen;
if (!flag)
{
XSysDefine sysId = dataBySystemId.SysId;
if (sysId <= XSysDefine.XSys_Reward_Activity)
{
if (sysId != XSysDefine.XSys_Level_Elite)
{
if (sysId == XSysDefine.XSys_Reward_Activity)
{
DlgBase<RewardSystemDlg, TabDlgBehaviour>.singleton.ShowWorkGameSystem(XSysDefine.XSys_Reward_Activity);
}
}
else
{
DlgBase<DungeonSelect, DungeonSelectBehaviour>.singleton.AutoShowLastChapter(1u, false);
}
}
else if (sysId != XSysDefine.XSys_Activity_Nest)
{
if (sysId == XSysDefine.XSys_GuildDailyTask)
{
XSingleton<UIManager>.singleton.CloseAllUI();
XSingleton<XGameSysMgr>.singleton.OpenSystem(XSysDefine.XSys_GuildDailyTask, 0UL);
}
}
else
{
XSingleton<XGameSysMgr>.singleton.OpenSystem(dataBySystemId.SysId, 0UL);
}
}
}
}
}
|