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 XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient
{
internal class XThemeActivityDocument : XDocComponent
{
public override uint ID
{
get
{
return XThemeActivityDocument.uuID;
}
}
public static ThemeActivity ThemeActivityTable
{
get
{
return XThemeActivityDocument.m_ThemeActivityTable;
}
}
public static XThemeActivityDocument Doc
{
get
{
return XSingleton<XGame>.singleton.Doc.GetXComponent(XThemeActivityDocument.uuID) as XThemeActivityDocument;
}
}
public XThemeActivityView View { get; set; }
public HashSet<uint> systemIds
{
get
{
bool flag = this.m_systemIds == null || this.m_systemIds.Count == 0;
if (flag)
{
this.m_systemIds = new HashSet<uint>();
for (int i = 0; i < XThemeActivityDocument.m_ThemeActivityTable.Table.Length; i++)
{
bool flag2 = XThemeActivityDocument.m_ThemeActivityTable.Table[i] != null;
if (flag2)
{
this.m_systemIds.Add(XThemeActivityDocument.m_ThemeActivityTable.Table[i].SysID);
}
}
}
return this.m_systemIds;
}
}
public new static readonly uint uuID = XSingleton<XCommon>.singleton.XHash("XThemeActivityDocument");
public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader();
private static ThemeActivity m_ThemeActivityTable = new ThemeActivity();
private HashSet<uint> m_systemIds;
private Dictionary<XSysDefine, bool> m_SysFirstRedPointDic = new Dictionary<XSysDefine, bool>();
public bool GetSysFirstRedPoint(XSysDefine sys)
{
bool flag2;
bool flag = this.m_SysFirstRedPointDic.TryGetValue(sys, out flag2);
bool result;
if (flag)
{
result = flag2;
}
else
{
SuperActivityTime.RowData dataBySystemID = XTempActivityDocument.Doc.GetDataBySystemID((uint)sys);
bool flag3 = dataBySystemID == null;
if (flag3)
{
result = false;
}
else
{
SpActivityOne activity = XTempActivityDocument.Doc.GetActivity(dataBySystemID.actid);
bool flag4 = activity == null || activity.theme == null;
if (flag4)
{
result = false;
}
else
{
this.m_SysFirstRedPointDic[sys] = activity.theme.ishint;
result = activity.theme.ishint;
}
}
}
return result;
}
public static void Execute(OnLoadedCallback callback = null)
{
XThemeActivityDocument.AsyncLoader.AddTask("Table/ThemeActivity", XThemeActivityDocument.m_ThemeActivityTable, false);
XThemeActivityDocument.AsyncLoader.Execute(callback);
}
protected override void OnReconnected(XReconnectedEventArgs arg)
{
}
public override void OnEnterSceneFinally()
{
base.OnEnterSceneFinally();
bool flag = XSingleton<XSceneMgr>.singleton.GetSceneType(XSingleton<XScene>.singleton.SceneID) == SceneType.SCENE_HALL;
if (flag)
{
this.RefreshRedPoints();
}
}
public bool SysIsOpen(XSysDefine sys)
{
return XSingleton<XGameSysMgr>.singleton.IsSystemOpened(sys);
}
public bool isHasHallIcon()
{
bool flag = !XSingleton<XGameSysMgr>.singleton.IsSystemOpened(XSysDefine.XSys_ThemeActivity);
bool result;
if (flag)
{
result = false;
}
else
{
for (int i = 0; i < XThemeActivityDocument.ThemeActivityTable.Table.Length; i++)
{
ThemeActivity.RowData rowData = XThemeActivityDocument.ThemeActivityTable.Table[i];
XSysDefine sysID = (XSysDefine)rowData.SysID;
bool flag2 = this.SysIsOpen(sysID);
if (flag2)
{
return true;
}
}
result = false;
}
return result;
}
public bool IsHadRedPoint()
{
for (int i = 0; i < XThemeActivityDocument.ThemeActivityTable.Table.Length; i++)
{
ThemeActivity.RowData rowData = XThemeActivityDocument.ThemeActivityTable.Table[i];
XSysDefine sysID = (XSysDefine)rowData.SysID;
bool flag = this.SysIsOpen(sysID);
if (flag)
{
bool tabRedPointState = this.GetTabRedPointState(sysID);
if (tabRedPointState)
{
XSingleton<XDebug>.singleton.AddGreenLog("ThemeActivity RedPoint:" + sysID.ToString(), null, null, null, null, null);
return true;
}
}
}
return false;
}
public void RefreshRedPoints()
{
XSingleton<XGameSysMgr>.singleton.RecalculateRedPointState(XSysDefine.XSys_ThemeActivity, true);
bool flag = DlgBase<XThemeActivityView, XThemeActivityBehaviour>.singleton.IsVisible();
if (flag)
{
DlgBase<XThemeActivityView, XThemeActivityBehaviour>.singleton.RefreshRedpoint();
}
}
public bool GetTabRedPointState(XSysDefine sys)
{
bool result;
if (sys != XSysDefine.XSys_ThemeActivity_HellDog)
{
if (sys != XSysDefine.XSys_ThemeActivity_MadDuck)
{
result = XSingleton<XGameSysMgr>.singleton.GetSysRedPointState(sys);
}
else
{
MadDuckSiegeDocument specificDocument = XDocuments.GetSpecificDocument<MadDuckSiegeDocument>(MadDuckSiegeDocument.uuID);
result = (this.GetSysFirstRedPoint(sys) | specificDocument.GetRedPoint());
}
}
else
{
BiochemicalHellDogDocument specificDocument2 = XDocuments.GetSpecificDocument<BiochemicalHellDogDocument>(BiochemicalHellDogDocument.uuID);
result = (this.GetSysFirstRedPoint(sys) | specificDocument2.GetRedPoint());
}
return result;
}
public void OnSystemChanged(List<uint> openIds, List<uint> closeIds)
{
bool flag = !DlgBase<XThemeActivityView, XThemeActivityBehaviour>.singleton.IsVisible();
if (!flag)
{
int num = 0;
bool flag2 = this.systemIds != null;
if (flag2)
{
for (int i = 0; i < openIds.Count; i++)
{
bool flag3 = this.systemIds.Contains(openIds[i]);
if (flag3)
{
num = 1;
break;
}
}
for (int j = 0; j < closeIds.Count; j++)
{
bool flag4 = this.systemIds.Contains(closeIds[j]);
if (flag4)
{
bool flag5 = num == 1;
if (flag5)
{
num = 3;
}
else
{
num = 2;
}
break;
}
}
}
bool flag6 = num == 0;
if (!flag6)
{
bool flag7 = num == 1;
if (flag7)
{
DlgBase<XThemeActivityView, XThemeActivityBehaviour>.singleton.RefreshChangeUI(null);
}
else
{
DlgBase<XThemeActivityView, XThemeActivityBehaviour>.singleton.RefreshChangeUI(closeIds);
}
}
}
}
public void SendJoinScene(uint actid, uint sceneid)
{
RpcC2G_TactEnterScene rpcC2G_TactEnterScene = new RpcC2G_TactEnterScene();
rpcC2G_TactEnterScene.oArg.actid = actid;
rpcC2G_TactEnterScene.oArg.sceneid = sceneid;
XSingleton<XClientNetwork>.singleton.Send(rpcC2G_TactEnterScene);
}
public void SendFirstHint(uint actid)
{
RpcC2G_ThemeActivityHint rpcC2G_ThemeActivityHint = new RpcC2G_ThemeActivityHint();
rpcC2G_ThemeActivityHint.oArg.actid = actid;
XSingleton<XClientNetwork>.singleton.Send(rpcC2G_ThemeActivityHint);
}
public void SetActivityChange(PtcG2C_ThemeActivityChangeNtf roPtc)
{
SuperActivityTime.RowData dataByActivityID = XTempActivityDocument.Doc.GetDataByActivityID(roPtc.Data.actid);
bool flag = dataByActivityID == null;
if (flag)
{
XSingleton<XDebug>.singleton.AddErrorLog("actid:" + roPtc.Data.actid + " No Find", null, null, null, null, null);
}
this.m_SysFirstRedPointDic[(XSysDefine)dataByActivityID.systemid] = roPtc.Data.ishint;
XTempActivityDocument.Doc.SetActivityCompleteScene(roPtc.Data.actid, roPtc.Data.scene);
this.RefreshRedPoints();
}
}
}
|