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
|
using System;
using System.Collections.Generic;
using UILib;
using UnityEngine;
using XUtliPoolLib;
namespace XMainClient.UI
{
internal class ProfressionTrialsHandler : DlgHandlerBase
{
protected override string FileName
{
get
{
return "Battle/ProfTrialsDlg";
}
}
private List<int> _pro = new List<int>();
private int[] MI = new int[]
{
1,
10,
100,
1000,
10000
};
private static readonly bool IsShowAvengerProf = false;
private List<GameObject> _FxList = new List<GameObject>();
private List<GameObject> _ClickTips = new List<GameObject>();
private IXUICheckBox m_GeneralTab;
protected override void Init()
{
base.Init();
this.GetProfressional();
this._FxList.Clear();
this._ClickTips.Clear();
Transform transform = base.PanelObject.transform.Find("Bg/Tabs/Tab1");
bool flag = this._pro.Count > 0;
if (flag)
{
this.SetProSelect(transform, 0);
}
transform = base.PanelObject.transform.Find("Bg/Tabs/Tab2");
bool flag2 = this._pro.Count > 1;
if (flag2)
{
transform.gameObject.SetActive(true);
this.SetProSelect(transform, 1);
}
else
{
transform.gameObject.SetActive(false);
}
transform = base.PanelObject.transform.Find("Bg/Tabs/Tab3");
bool flag3 = this._pro.Count > 2;
if (flag3)
{
transform.gameObject.SetActive(true);
this.SetProSelect(transform, 2);
}
else
{
transform.gameObject.SetActive(false);
}
}
public override void RegisterEvent()
{
base.RegisterEvent();
}
public override void OnUnload()
{
base.OnUnload();
}
protected override void OnShow()
{
base.OnShow();
}
private void GetProfressional()
{
XProfessionChangeDocument specificDocument = XDocuments.GetSpecificDocument<XProfessionChangeDocument>(XProfessionChangeDocument.uuID);
bool flag = XSingleton<XScene>.singleton.SceneID != specificDocument.SceneID;
if (flag)
{
List<int> intList = XSingleton<XGlobalConfig>.singleton.GetIntList("ChangeProTaskIds");
int num = 0;
XTaskDocument specificDocument2 = XDocuments.GetSpecificDocument<XTaskDocument>(XTaskDocument.uuID);
for (int i = 0; i < intList.Count; i++)
{
bool flag2 = !specificDocument2.TaskRecord.IsTaskFinished((uint)intList[i]);
if (flag2)
{
num = i + 1;
break;
}
}
bool flag3 = num == 0;
if (flag3)
{
XSingleton<XDebug>.singleton.AddErrorLog("Profression trials task error. promote = 0", null, null, null, null, null);
}
int typeID = (int)XSingleton<XAttributeMgr>.singleton.XPlayerData.TypeID;
int num2 = typeID + this.MI[num];
int num3 = typeID + this.MI[num] * 2;
int num4 = typeID + this.MI[num] * 3;
this._pro.Clear();
bool flag4 = XSingleton<XProfessionSkillMgr>.singleton.IsExistProf(num2);
bool flag5 = XSingleton<XProfessionSkillMgr>.singleton.IsExistProf(num3);
bool flag6 = XSingleton<XProfessionSkillMgr>.singleton.IsExistProf(num4) && ProfressionTrialsHandler.IsShowAvengerProf;
bool profIsInLeft = XSingleton<XProfessionSkillMgr>.singleton.GetProfIsInLeft(num2);
if (profIsInLeft)
{
bool flag7 = flag4;
if (flag7)
{
this._pro.Add(num2);
}
bool flag8 = flag5;
if (flag8)
{
this._pro.Add(num3);
}
}
else
{
bool flag9 = flag5;
if (flag9)
{
this._pro.Add(num3);
}
bool flag10 = flag4;
if (flag10)
{
this._pro.Add(num2);
}
}
bool flag11 = flag6;
if (flag11)
{
flag6 = XSkillTreeDocument.IsAvengerTaskDone(num4);
bool flag12 = flag6;
if (flag12)
{
this._pro.Add(num4);
}
}
}
else
{
int selectProfession = specificDocument.SelectProfession;
int num5 = selectProfession + 10;
int item = selectProfession + 20;
int num6 = selectProfession + 30;
this._pro.Clear();
bool profIsInLeft2 = XSingleton<XProfessionSkillMgr>.singleton.GetProfIsInLeft(num5);
if (profIsInLeft2)
{
this._pro.Add(num5);
this._pro.Add(item);
}
else
{
this._pro.Add(item);
this._pro.Add(num5);
}
bool flag13 = XSingleton<XProfessionSkillMgr>.singleton.IsExistProf(num6) && ProfressionTrialsHandler.IsShowAvengerProf;
bool flag14 = flag13;
if (flag14)
{
flag13 = XSkillTreeDocument.IsAvengerTaskDone(num6);
bool flag15 = flag13;
if (flag15)
{
this._pro.Add(num6);
}
}
}
}
private void SetProSelect(Transform ts, int i)
{
IXUICheckBox ixuicheckBox = ts.GetComponent("XUICheckBox") as IXUICheckBox;
ixuicheckBox.ID = (ulong)((long)i);
ixuicheckBox.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnCheckBoxClick));
bool flag = i == 0;
if (flag)
{
this.m_GeneralTab = ixuicheckBox;
}
GameObject gameObject = ts.Find("Selected/FX").gameObject;
this._FxList.Add(gameObject);
GameObject gameObject2 = ts.Find("ClickText").gameObject;
this._ClickTips.Add(gameObject2);
IXUISprite ixuisprite = ts.Find("Icon").GetComponent("XUISprite") as IXUISprite;
ixuisprite.spriteName = XSingleton<XProfessionSkillMgr>.singleton.GetProfIcon(this._pro[i]);
IXUILabel ixuilabel = ts.Find("ProName").GetComponent("XUILabel") as IXUILabel;
ixuilabel.SetText(XSingleton<XProfessionSkillMgr>.singleton.GetProfName(this._pro[i]));
}
private bool OnCheckBoxClick(IXUICheckBox icb)
{
bool flag = !icb.bChecked;
bool result;
if (flag)
{
result = false;
}
else
{
int num = (int)icb.ID;
for (int i = 0; i < this._FxList.Count; i++)
{
this._FxList[i].SetActive(i == num);
}
for (int i = 0; i < this._ClickTips.Count; i++)
{
this._ClickTips[i].SetActive(i != num);
}
uint promoteExperienceID = XSingleton<XProfessionSkillMgr>.singleton.GetPromoteExperienceID(this._pro[num]);
XSingleton<XDebug>.singleton.AddLog("Change PromoteExperienceID to ", promoteExperienceID.ToString(), null, null, null, null, XDebugColor.XDebug_None);
XSingleton<XEntityMgr>.singleton.Player.OnTransform(promoteExperienceID);
result = true;
}
return result;
}
public void SetGeneralTab()
{
bool flag = this.m_GeneralTab != null;
if (flag)
{
this.m_GeneralTab.bChecked = true;
}
}
}
}
|