summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/UI/SpectateSceneView.cs
blob: f9bde1bbd5e55429956791d1561bcc881545d2cb (plain)
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
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
using System;
using System.Collections.Generic;
using KKSG;
using UILib;
using UnityEngine;
using XMainClient.UI.UICommon;
using XUpdater;
using XUtliPoolLib;

namespace XMainClient.UI
{
	internal class SpectateSceneView : DlgBase<SpectateSceneView, SpectateSceneBehaviour>
	{
		public XSpectateTeamMonitorHandler SpectateTeamMonitor
		{
			get
			{
				return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_SpectateTeamMonitor;
			}
		}

		public BattleIndicateHandler IndicateHandler
		{
			get
			{
				return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_IndicateHandler;
			}
		}

		public XBattleEnemyInfoHandler EnemyInfoHandler
		{
			get
			{
				return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_EnemyInfoHandler;
			}
		}

		public BattleTargetHandler BattleTargetHandler
		{
			get
			{
				return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_BattleTargetHandler;
			}
		}

		public SpectateHandler SpectateHandler
		{
			get
			{
				return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_SpectateHandler;
			}
		}

		public IXUILabel LeftTime
		{
			get
			{
				return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_LeftTime;
			}
		}

		private float _strength_preseved_precent
		{
			get
			{
				bool flag = this._current_strength_preseved > this._total_strength_preseved;
				if (flag)
				{
					this._total_strength_preseved = this._current_strength_preseved;
				}
				return this._current_strength_preseved / this._total_strength_preseved;
			}
		}

		public override string fileName
		{
			get
			{
				return "Battle/BattleViewDlg";
			}
		}

		public override int layer
		{
			get
			{
				return 1;
			}
		}

		public override bool isMainUI
		{
			get
			{
				return true;
			}
		}

		public static uint _pool_size = 5u;

		private XPlayerAttributes _attrComp = null;

		private float NoticeTime = 0f;

		private Color32 _hp_green = new Color32(46, 203, 0, byte.MaxValue);

		private Color32 _hp_yellow = new Color32(byte.MaxValue, 249, 32, byte.MaxValue);

		private Color32 _hp_red = new Color32(byte.MaxValue, 39, 39, byte.MaxValue);

		private Vector2 m_DragDistance = Vector2.zero;

		private bool m_CancelRecord = false;

		private bool m_IsRecording = false;

		private uint m_ChatLabelCd = 0u;

		public XOptionsBattleHandler m_XOptionBattleHandler = null;

		private BattleCaptainPVPHandler m_BattleCaptainPVPHandler = null;

		public HeroBattleHandler _HeroBattleHandler = null;

		private SceneType sceneType;

		private XLeftTimeCounter leftTimeCounter;

		private XLeftTimeCounter timeConnter;

		private float _last_check_time = 0f;

		private IPlatform _platform = null;

		private List<string> _notice_collection = new List<string>();

		private float _notice_duration = 0f;

		private float _notice_pertime = 1f;

		private List<ComboBuff> _combo_buff_list = new List<ComboBuff>();

		private Vector2 _yuyin_init_pos = Vector2.zero;

		private Vector2 _yuyin_offset = new Vector2(65f, 0f);

		private XSpectateSceneDocument _doc;

		private uint time_token = 0u;

		private XEntity _strength_preseved_entity = null;

		private float _total_strength_preseved = 1f;

		private float _current_strength_preseved = 0f;

		private XTimerMgr.ElapsedEventHandler _showSingleNoticeCb = null;

		private XTimerMgr.ElapsedEventHandler _endBigNoticeCb = null;

		private XTimerMgr.ElapsedEventHandler _onSwitchToTeamChatCb = null;

		private XTimerMgr.ElapsedEventHandler _hideBattleChatUICb = null;

		private float _fYellow = 0f;

		private float _fRed = 0f;

		private XSwitchSight m_SwitchSight;

		public XYuyinView _yuyinHandler;

		private float lastPingTime = -60f;

		private GameObject _big_notice = null;

		public SpectateSceneView()
		{
			this._showSingleNoticeCb = new XTimerMgr.ElapsedEventHandler(this.ShowSingleNotice);
			this._endBigNoticeCb = new XTimerMgr.ElapsedEventHandler(this.EndBigNotice);
			this._onSwitchToTeamChatCb = new XTimerMgr.ElapsedEventHandler(this.OnSwitchToTeamChat);
			this._hideBattleChatUICb = new XTimerMgr.ElapsedEventHandler(this.HideBattleChatUI);
			this._fYellow = float.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("HP_Yellow"));
			this._fRed = float.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("HP_Red"));
		}

		protected override void Init()
		{
			this._platform = XSingleton<XUpdater.XUpdater>.singleton.XPlatform;
			this._doc = XDocuments.GetSpecificDocument<XSpectateSceneDocument>(XSpectateSceneDocument.uuID);
			this._doc._SpectateSceneView = this;
			this._doc.LeftTeamMonitorData.Clear();
			this._doc.RightTeamMonitorData.Clear();
			this._attrComp = (XSingleton<XEntityMgr>.singleton.Player.Attributes as XPlayerAttributes);
			this.leftTimeCounter = new XLeftTimeCounter(base.uiBehaviour.m_LeftTime, true);
			this.timeConnter = new XLeftTimeCounter(base.uiBehaviour.m_WarTime, false);
			string value = XSingleton<XGlobalConfig>.singleton.GetValue("ComboBuff");
			string[] array = value.Split(XGlobalConfig.AllSeparators);
			for (int i = 0; i < array.Length; i += 3)
			{
				ComboBuff comboBuff = new ComboBuff();
				comboBuff.combo = int.Parse(array[i]);
				comboBuff.buffID = int.Parse(array[i + 1]);
				comboBuff.buffLevel = int.Parse(array[i + 2]);
				BuffTable.RowData buffData = XSingleton<XBuffTemplateManager>.singleton.GetBuffData(comboBuff.buffID, comboBuff.buffLevel);
				bool flag = buffData != null;
				if (flag)
				{
					comboBuff.buffName = buffData.BuffName;
				}
				else
				{
					XSingleton<XDebug>.singleton.AddErrorLog(string.Format("ComboBuff: Buff data not found: [{0} {1}]", comboBuff.buffID, comboBuff.buffLevel), null, null, null, null, null);
				}
				this._combo_buff_list.Add(comboBuff);
			}
			this.SetupHandler();
		}

		private void SetupHandler()
		{
			SceneType sceneType = XSingleton<XScene>.singleton.SceneType;
			if (sceneType != SceneType.SCENE_PVP)
			{
				if (sceneType == SceneType.SCENE_HEROBATTLE)
				{
					DlgHandlerBase.EnsureCreate<HeroBattleHandler>(ref this._HeroBattleHandler, base.uiBehaviour.m_canvas, true, this);
				}
			}
			else
			{
				DlgHandlerBase.EnsureCreate<BattleCaptainPVPHandler>(ref this.m_BattleCaptainPVPHandler, base.uiBehaviour.m_canvas, true, this);
			}
		}

		public override void RegisterEvent()
		{
			base.uiBehaviour.m_pause.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnPauseClick));
			this.m_SwitchSight = new XSwitchSight(new ButtonClickEventHandler(this.OnViewClick), base.uiBehaviour.m_25D, base.uiBehaviour.m_3D, base.uiBehaviour.m_3DFree);
			base.uiBehaviour.m_Sight.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnSightClick));
			base.uiBehaviour.m_barrageOpen.ID = 1UL;
			base.uiBehaviour.m_barrageOpen.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnBarrageClick));
			base.uiBehaviour.m_barrageClose.ID = 0UL;
			base.uiBehaviour.m_barrageClose.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnBarrageClick));
			base.uiBehaviour.m_btnShare.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnShareClick));
		}

		protected override void OnLoad()
		{
			base.OnLoad();
			DlgHandlerBase.EnsureCreate<XYuyinView>(ref this._yuyinHandler, base.uiBehaviour.transform, true, this);
		}

		protected override void OnShow()
		{
			this.lastPingTime = -60f;
			XPlayerAttributes xplayerAttributes = XSingleton<XEntityMgr>.singleton.Player.Attributes as XPlayerAttributes;
			DlgBase<BroadMiniDlg, BroadcastMiniBehaviour>.singleton.Show(true);
			DlgBase<RadioDlg, RadioBehaviour>.singleton.Show(true);
			base.uiBehaviour.m_SightSelect.gameObject.SetActive(false);
			int num = XFastEnumIntEqualityComparer<RoleType>.ToInt(XSingleton<XEntityMgr>.singleton.Player.PlayerAttributes.Profession);
			base.uiBehaviour.m_IndicateHandler.SetVisible(true);
			base.uiBehaviour.m_SceneName.SetText(XSingleton<XScene>.singleton.SceneData.Comment);
			this.SetTimeRecord();
			SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(XSingleton<XScene>.singleton.SceneID);
			this.sceneType = (SceneType)sceneData.type;
			SceneType sceneType = this.sceneType;
			if (sceneType <= SceneType.SCENE_ABYSSS)
			{
				if (sceneType != SceneType.SCENE_BATTLE)
				{
					switch (sceneType)
					{
					case SceneType.SCENE_PK:
					{
						XQualifyingDocument specificDocument = XDocuments.GetSpecificDocument<XQualifyingDocument>(XQualifyingDocument.uuID);
						bool flag = specificDocument.PkInfoList.Count > 0;
						if (flag)
						{
							this.SetEnemyRoleInfo(specificDocument.PkInfoList[0].brief.roleName, specificDocument.PkInfoList[0].brief.roleLevel);
						}
						break;
					}
					}
				}
			}
			else if (sceneType != SceneType.SCENE_TOWER)
			{
				if (sceneType != SceneType.SCENE_LEAGUE_BATTLE)
				{
				}
			}
			SceneType sceneType2 = this.sceneType;
			if (sceneType2 != SceneType.SCENE_ARENA && sceneType2 != SceneType.SCENE_PK)
			{
				this.EnemyInfoHandler.InitBoss();
			}
			else
			{
				this.EnemyInfoHandler.InitRole();
			}
			this.SpectateTeamMonitor.InitWhenShowMainUI();
			bool flag2 = XSingleton<XScene>.singleton.SceneID != 100u && XSingleton<XAttributeMgr>.singleton.XPlayerData.Level >= 10u;
			if (flag2)
			{
				ShowSettingArgs showSettingArgs = new ShowSettingArgs();
				showSettingArgs.position = 3;
				showSettingArgs.showsettings = false;
				showSettingArgs.enablebackclick = true;
				DlgBase<XChatSmallView, XChatSmallBehaviour>.singleton.ShowChatMiniUI(showSettingArgs);
			}
			base.uiBehaviour.m_StrengthPresevedBar.SetVisible(this._doc.ShowStrengthPresevedBar);
			this.LoadYuyin();
			this.InitView();
			this.ShowBarrge();
		}

		private void ShowBarrge()
		{
			bool openBarrage = DlgBase<BarrageDlg, BarrageBehaviour>.singleton.openBarrage;
			DlgBase<BarrageDlg, BarrageBehaviour>.singleton.SetVisible(openBarrage, true);
			base.uiBehaviour.m_barrageClose.SetVisible(openBarrage);
			base.uiBehaviour.m_barrageOpen.SetVisible(!openBarrage);
		}

		private void InitView()
		{
			this.SetView(XSingleton<XOperationData>.singleton.OperationMode);
		}

		public void SetView(XOperationMode mode)
		{
			switch (mode)
			{
			case XOperationMode.X25D:
				base.uiBehaviour.m_SightPic.SetSprite("l_zdicon_1_1");
				base.uiBehaviour.m_SelectPic.SetSprite("l_zdicon_1_1");
				break;
			case XOperationMode.X3D:
				base.uiBehaviour.m_SightPic.SetSprite("l_zdicon_1_0");
				base.uiBehaviour.m_SelectPic.SetSprite("l_zdicon_1_0");
				break;
			case XOperationMode.X3D_Free:
				base.uiBehaviour.m_SightPic.SetSprite("l_zdicon_1_2");
				base.uiBehaviour.m_SelectPic.SetSprite("l_zdicon_1_2");
				break;
			}
			base.uiBehaviour.m_SightPic.MakePixelPerfect();
			base.uiBehaviour.m_SelectPic.MakePixelPerfect();
			base.uiBehaviour.m_SightSelect.gameObject.SetActive(false);
		}

		public bool OnSightClick(IXUIButton sp)
		{
			bool activeSelf = base.uiBehaviour.m_SightSelect.gameObject.activeSelf;
			if (activeSelf)
			{
				base.uiBehaviour.m_SightSelect.gameObject.SetActive(false);
			}
			else
			{
				base.uiBehaviour.m_SightSelect.gameObject.SetActive(true);
			}
			return true;
		}

		protected override void OnHide()
		{
			DlgBase<BroadMiniDlg, BroadcastMiniBehaviour>.singleton.Show(false);
			DlgBase<RadioDlg, RadioBehaviour>.singleton.Show(false);
			DlgBase<XChatSmallView, XChatSmallBehaviour>.singleton.SetVisible(false, true);
		}

		protected override void OnUnload()
		{
			DlgHandlerBase.EnsureUnload<XOptionsBattleHandler>(ref this.m_XOptionBattleHandler);
			DlgHandlerBase.EnsureUnload<BattleCaptainPVPHandler>(ref this.m_BattleCaptainPVPHandler);
			DlgHandlerBase.EnsureUnload<HeroBattleHandler>(ref this._HeroBattleHandler);
			base.uiBehaviour.m_IndicateHandler.OnUnload();
			base.uiBehaviour.m_SpectateTeamMonitor.OnUnload();
			base.uiBehaviour.m_SpectateHandler.OnUnload();
			base.uiBehaviour.m_EnemyInfoHandler.OnUnload();
			DlgHandlerBase.EnsureUnload<XYuyinView>(ref this._yuyinHandler);
			this._doc._SpectateSceneView = null;
			base.OnUnload();
		}

		private void LoadYuyin()
		{
			YuyinIconType type = YuyinIconType.SPECTATE;
			bool flag = this._yuyinHandler != null;
			if (flag)
			{
				this._yuyinHandler.Refresh(type);
			}
		}

		private void SetEnemyRoleInfo(string name, uint level)
		{
		}

		public void RefreshYuyin(ulong uid)
		{
			bool flag = this._yuyinHandler != null;
			if (flag)
			{
				this._yuyinHandler.Refresh(YuyinIconType.SPECTATE);
			}
		}

		private bool OnPauseClick(IXUIButton go)
		{
			bool flag = !base.IsLoaded();
			bool result;
			if (flag)
			{
				result = true;
			}
			else
			{
				SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(XSingleton<XScene>.singleton.SceneID);
				bool flag2 = sceneData != null;
				if (flag2)
				{
					bool canPause = sceneData.CanPause;
					if (canPause)
					{
						XSingleton<XShell>.singleton.Pause = true;
					}
				}
				bool flag3 = this.m_XOptionBattleHandler == null;
				if (flag3)
				{
					bool flag4 = base.uiBehaviour != null;
					if (flag4)
					{
						DlgHandlerBase.EnsureCreate<XOptionsBattleHandler>(ref this.m_XOptionBattleHandler, base.uiBehaviour.m_canvas, true, DlgBase<BattleMain, BattleMainBehaviour>.singleton);
					}
				}
				bool flag5 = this.m_XOptionBattleHandler != null && !this.m_XOptionBattleHandler.IsVisible();
				if (flag5)
				{
					this.m_XOptionBattleHandler.ShowUI();
				}
				this.sceneType = XSingleton<XScene>.singleton.SceneType;
				result = true;
			}
			return result;
		}

		public override void OnUpdate()
		{
			bool flag = !XSingleton<XTimerMgr>.singleton.NeedFixedUpdate;
			if (!flag)
			{
				base.OnUpdate();
				this.UpdateFPS();
				this.UpdateWifi();
				base.uiBehaviour.m_IndicateHandler.OnUpdate();
				bool flag2 = Time.time - this._last_check_time > 5f;
				if (flag2)
				{
					this._last_check_time = Time.time;
					this._doc.SendCheckTime();
				}
				this.UpdateTime();
				this.UpdateLeftTime();
				bool flag3 = Time.unscaledTime - this.lastPingTime > 60f || this.lastPingTime < 0f;
				if (flag3)
				{
					this.RefreshPing();
					this.lastPingTime = Time.unscaledTime;
				}
				bool flag4 = this.NoticeTime > 0f;
				if (flag4)
				{
					bool flag5 = Time.time - this.NoticeTime > this._notice_duration;
					if (flag5)
					{
						base.uiBehaviour.m_NoticeFrame.transform.localPosition = XGameUI.Far_Far_Away;
						this.NoticeTime = 0f;
					}
				}
				this.SpectateTeamMonitor.OnUpdate();
				this.EnemyInfoHandler.OnUpdate();
				bool flag6 = base.uiBehaviour.m_StrengthPresevedBar.IsVisible();
				if (flag6)
				{
					this.RefreshStrengthPresevedBar();
				}
			}
		}

		private void UpdateWifi()
		{
			XSingleton<UiUtility>.singleton.UpdateWifi(null, this.m_uiBehaviour.m_sprwifi);
		}

		private void RefreshPing()
		{
			XSingleton<UiUtility>.singleton.RefreshPing(base.uiBehaviour.m_lblTime, base.uiBehaviour.m_sliderBattery, base.uiBehaviour.m_lblFree);
		}

		public void UpdateFPS()
		{
			bool flag = !this._platform.IsPublish();
			if (flag)
			{
				bool showBuildLog = XSingleton<XGame>.singleton.ShowBuildLog;
				if (showBuildLog)
				{
					string syncModeString = XSingleton<XGame>.singleton.GetSyncModeString();
					base.uiBehaviour.m_fps.SetText(string.Concat(new object[]
					{
						"Build:",
						XLinkTimeStamp.BuildDateTime.ToString(),
						"\n",
						XSingleton<XGame>.singleton.Fps.ToString("F1"),
						syncModeString,
						XSingleton<XClientNetwork>.singleton.ServerIP,
						"\nSend:",
						XSingleton<XClientNetwork>.singleton.SendBytes,
						" Recv:",
						XSingleton<XClientNetwork>.singleton.RecvBytes,
						" delay:",
						XSingleton<XServerTimeMgr>.singleton.GetDelay()
					}));
				}
				else
				{
					base.uiBehaviour.m_fps.SetText("");
				}
			}
		}

		public void ShowNotice(string text, float duration, float pertime = 1f)
		{
			this._notice_collection.Clear();
			bool flag = string.IsNullOrEmpty(text);
			if (!flag)
			{
				string[] array = text.Split(XGlobalConfig.ListSeparator);
				for (int i = 0; i < array.Length; i++)
				{
					this._notice_collection.Add(array[i]);
				}
				this._notice_duration = duration;
				this._notice_pertime = pertime;
				bool flag2 = this.time_token > 0u;
				if (flag2)
				{
					XSingleton<XTimerMgr>.singleton.KillTimer(this.time_token);
					this.time_token = 0u;
				}
				bool flag3 = this._notice_collection.Count > 0;
				if (flag3)
				{
					this.ShowSingleNotice(0);
				}
			}
		}

		protected void ShowSingleNotice(object o)
		{
			int num = (int)o;
			bool flag = num < this._notice_collection.Count;
			if (flag)
			{
				string text = this._notice_collection[num];
				base.uiBehaviour.m_Notice.SetText(text);
				base.uiBehaviour.m_NoticeFrame.transform.localPosition = base.uiBehaviour.m_NoticePos;
				this.NoticeTime = Time.time;
				this.time_token = XSingleton<XTimerMgr>.singleton.SetTimer(this._notice_pertime, this._showSingleNoticeCb, num + 1);
				bool flag2 = num == this._notice_collection.Count - 1;
				if (flag2)
				{
					XSingleton<XLevelScriptMgr>.singleton.ExecuteNextCmd();
					this._notice_collection.Clear();
				}
			}
		}

		public void StopNotice()
		{
			bool flag = this.time_token > 0u;
			if (flag)
			{
				XSingleton<XTimerMgr>.singleton.KillTimer(this.time_token);
				this.time_token = 0u;
			}
			base.uiBehaviour.m_NoticeFrame.transform.localPosition = XGameUI.Far_Far_Away;
		}

		public void ShowBigNotice(string text)
		{
			this._big_notice = (XSingleton<XResourceLoaderMgr>.singleton.CreateFromPrefab("UI/Common/TutorialButtomText", true, false) as GameObject);
			this._big_notice.transform.parent = XSingleton<XGameUI>.singleton.UIRoot;
			this._big_notice.transform.localPosition = Vector3.zero;
			this._big_notice.transform.localScale = Vector3.one;
			IXUILabel ixuilabel = this._big_notice.transform.Find("TutorialText").GetComponent("XUILabel") as IXUILabel;
			ixuilabel.SetText(text);
			IXUITweenTool ixuitweenTool = this._big_notice.GetComponent("XUIPlayTween") as IXUITweenTool;
			ixuitweenTool.PlayTween(true, -1f);
			XSingleton<XTimerMgr>.singleton.SetTimer(5f, this._endBigNoticeCb, null);
		}

		protected void EndBigNotice(object o)
		{
			bool flag = this._big_notice != null;
			if (flag)
			{
				XResourceLoaderMgr.SafeDestroy(ref this._big_notice, true);
				XSingleton<XLevelScriptMgr>.singleton.ExecuteNextCmd();
			}
		}

		public void SetLeftTime(uint seconds)
		{
			base.uiBehaviour.m_LeftTime.SetVisible(true);
			this.leftTimeCounter.SetLeftTime(seconds, -1);
			base.uiBehaviour.m_WarTime.SetVisible(false);
		}

		public void SetTimeRecord()
		{
			base.uiBehaviour.m_WarTime.SetVisible(true);
			this.timeConnter.SetForward(1);
			this.timeConnter.SetLeftTime(0.01f, -1);
		}

		public void ResetLeftTime(int seconds)
		{
			SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(XSingleton<XScene>.singleton.SceneID);
			bool flag = sceneData.TimeCounter == null || sceneData.TimeCounter.Length < 1;
			if (flag)
			{
				this.timeConnter.SetLeftTime((float)seconds, -1);
			}
			else
			{
				bool flag2 = sceneData.TimeCounter[0] == 1;
				if (flag2)
				{
					this.leftTimeCounter.SetLeftTime((float)((int)sceneData.TimeCounter[1] - seconds), -1);
				}
			}
		}

		private void UpdateLeftTime()
		{
			this.leftTimeCounter.Update();
		}

		private void UpdateTime()
		{
			this.timeConnter.Update();
		}

		public bool OnShowChatDlg(IXUIButton sp)
		{
			DlgBase<XChatView, XChatBehaviour>.singleton.SetVisibleWithAnimation(true, null);
			XSingleton<XTimerMgr>.singleton.SetTimer(0.5f, this._onSwitchToTeamChatCb, null);
			return true;
		}

		public void OnSwitchToTeamChat(object obj)
		{
			DlgBase<XChatView, XChatBehaviour>.singleton.SelectChatTeam();
		}

		public void OnVoiceButtonDrag(IXUIButton sp, Vector2 delta)
		{
			this.m_DragDistance += delta;
			bool flag = this.m_DragDistance.magnitude >= 100f;
			if (flag)
			{
				this.m_CancelRecord = true;
			}
			else
			{
				this.m_CancelRecord = false;
			}
		}

		public void OnVoiceButton(IXUIButton sp, bool state)
		{
			if (state)
			{
				XSingleton<XDebug>.singleton.AddLog("Press down", null, null, null, null, null, XDebugColor.XDebug_None);
				this.m_DragDistance = Vector2.zero;
				this.m_IsRecording = true;
				bool useApollo = XChatDocument.UseApollo;
				if (useApollo)
				{
					XSingleton<XChatApolloMgr>.singleton.StartRecord(VoiceUsage.CHAT, null);
				}
				else
				{
					XSingleton<XChatIFlyMgr>.singleton.StartRecord(VoiceUsage.CHAT, null);
				}
			}
			else
			{
				XSingleton<XDebug>.singleton.AddLog("Press up", null, null, null, null, null, XDebugColor.XDebug_None);
				this.m_IsRecording = false;
				DlgBase<XChatView, XChatBehaviour>.singleton.SetActiveChannel(ChatChannelType.Team);
				bool useApollo2 = XChatDocument.UseApollo;
				if (useApollo2)
				{
					XSingleton<XChatApolloMgr>.singleton.StopRecord(this.m_CancelRecord);
				}
				else
				{
					XSingleton<XChatIFlyMgr>.singleton.StopRecord(this.m_CancelRecord);
				}
			}
		}

		public void OnStopVoiceRecord()
		{
			bool isRecording = this.m_IsRecording;
			if (isRecording)
			{
				DlgBase<XChatView, XChatBehaviour>.singleton.SetActiveChannel(ChatChannelType.Team);
				bool useApollo = XChatDocument.UseApollo;
				if (useApollo)
				{
					XSingleton<XChatApolloMgr>.singleton.StopRecord(this.m_CancelRecord);
				}
				else
				{
					XSingleton<XChatIFlyMgr>.singleton.StopRecord(this.m_CancelRecord);
				}
				this.m_IsRecording = false;
			}
		}

		public bool OnCommandBtnClick(IXUIButton btn)
		{
			return true;
		}

		private void OnAutoPlayTip(IXUISprite go)
		{
			bool flag = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_ARENA;
			if (flag)
			{
				XSingleton<UiUtility>.singleton.ShowSystemNoticeTip(XStringDefineProxy.GetString("ArenaAutoFight"));
			}
			else
			{
				XSingleton<UiUtility>.singleton.ShowSystemNoticeTip(string.Format(XStringDefineProxy.GetString("AutoFightOpenLevel"), XSingleton<XGlobalConfig>.singleton.GetValue("AutoPlayUnlockLevel")));
			}
		}

		public void ShowBattleVoice(ChatVoiceInfo info)
		{
			bool flag = !base.IsVisible();
			if (!flag)
			{
				this.m_ChatLabelCd = XSingleton<XTimerMgr>.singleton.SetTimer((float)info.voiceTime + 2f, this._hideBattleChatUICb, info);
			}
		}

		public void HideBattleChatUI(object info)
		{
			this.m_ChatLabelCd = 0u;
		}

		public void ShowCountDownFrame(bool status)
		{
			bool flag = !base.IsVisible();
			if (!flag)
			{
				base.uiBehaviour.m_CountDownFrame.gameObject.SetActive(true);
				base.uiBehaviour.m_CountDownTimeFrame.gameObject.SetActive(status);
				base.uiBehaviour.m_CountDownBeginFrame.gameObject.SetActive(!status);
				(base.uiBehaviour.m_CountDownTimeFrame.gameObject.GetComponent("XUIPlayTween") as IXUITweenTool).PlayTween(status, -1f);
				(base.uiBehaviour.m_CountDownBeginFrame.gameObject.GetComponent("XUIPlayTween") as IXUITweenTool).PlayTween(!status, -1f);
			}
		}

		public void OnPlaySuperarmorFx(XEntity enemy, bool bBroken)
		{
			for (int i = 0; i < this.EnemyInfoHandler.EnemyList.Count; i++)
			{
				bool flag = this.EnemyInfoHandler.EnemyList[i].Entity == enemy;
				if (flag)
				{
					this.EnemyInfoHandler.EnemyList[i].SetSuperArmorState(bBroken);
					break;
				}
			}
		}

		public void OnStopSuperarmorFx(XEntity enemy)
		{
			for (int i = 0; i < this.EnemyInfoHandler.EnemyList.Count; i++)
			{
				bool flag = this.EnemyInfoHandler.EnemyList[i].Entity == enemy;
				if (flag)
				{
					this.EnemyInfoHandler.EnemyList[i].StopSuperArmorFx();
					break;
				}
			}
		}

		public void OnProjectDamage(ProjectDamageResult damage, XEntity entity)
		{
			for (int i = 0; i < this.EnemyInfoHandler.EnemyList.Count; i++)
			{
				bool flag = this.EnemyInfoHandler.EnemyList[i].Entity == entity;
				if (flag)
				{
					bool flag2 = XSingleton<XEntityMgr>.singleton.Player != null && XSingleton<XEntityMgr>.singleton.Player.WatchTo != null && damage.Caster == XSingleton<XEntityMgr>.singleton.Player.WatchTo.ID;
					if (flag2)
					{
						this.EnemyInfoHandler.EnemyList[i].OnBeHit(damage);
					}
					break;
				}
			}
		}

		public void SetupSpeedFx(XEntity enemy, bool enable, Color c)
		{
			for (int i = 0; i < this.EnemyInfoHandler.EnemyList.Count; i++)
			{
				bool flag = this.EnemyInfoHandler.EnemyList[i].Entity == enemy;
				if (flag)
				{
					IXUISprite uiSuperArmorSpeedFx = this.EnemyInfoHandler.EnemyList[i].m_uiSuperArmorSpeedFx;
					uiSuperArmorSpeedFx.gameObject.SetActive(enable);
					uiSuperArmorSpeedFx.SetColor(c);
					break;
				}
			}
		}

		public void ShowStrengthPresevedBar(XEntity entity)
		{
			base.uiBehaviour.m_StrengthPresevedBar.SetVisible(true);
			this._strength_preseved_entity = entity;
			this._total_strength_preseved = (float)this._strength_preseved_entity.Attributes.GetAttr(XAttributeDefine.XAttr_CurrentXULI_Basic);
			this._current_strength_preseved = this._total_strength_preseved;
			this.RefreshStrengthPresevedBar();
		}

		public void HideStrengthPresevedBar()
		{
			base.uiBehaviour.m_StrengthPresevedBar.SetVisible(false);
			this._strength_preseved_entity = null;
			this._total_strength_preseved = 1f;
			this._current_strength_preseved = 0f;
		}

		public void RefreshStrengthPresevedBar()
		{
			this._current_strength_preseved = (float)this._strength_preseved_entity.Attributes.GetAttr(XAttributeDefine.XAttr_CurrentXULI_Basic);
			base.uiBehaviour.m_StrengthPresevedBar.value = this._strength_preseved_precent;
		}

		public bool OnViewClick(IXUIButton sp)
		{
			this.SetView((XOperationMode)sp.ID);
			return true;
		}

		public bool OnBarrageClick(IXUIButton btn)
		{
			int num = (int)btn.ID;
			bool flag = num == 1;
			base.uiBehaviour.m_barrageOpen.SetVisible(!flag);
			base.uiBehaviour.m_barrageClose.SetVisible(flag);
			DlgBase<BarrageDlg, BarrageBehaviour>.singleton.openBarrage = flag;
			bool flag2 = !flag;
			if (flag2)
			{
				DlgBase<BarrageDlg, BarrageBehaviour>.singleton.ClearAll();
			}
			DlgBase<BarrageDlg, BarrageBehaviour>.singleton.SetVisible(flag, true);
			return true;
		}

		public bool OnShareClick(IXUIButton btn)
		{
			XSpectateDocument specificDocument = XDocuments.GetSpecificDocument<XSpectateDocument>(XSpectateDocument.uuID);
			LiveType liveTypeBySceneType = XSpectateDocument.GetLiveTypeBySceneType(XSingleton<XScene>.singleton.SceneType);
			XSingleton<XDebug>.singleton.AddLog("Share btn click, live type is: " + liveTypeBySceneType, null, null, null, null, null, XDebugColor.XDebug_None);
			uint num = (uint)XFastEnumIntEqualityComparer<ChatChannelType>.ToInt(ChatChannelType.World);
			XInvitationDocument specificDocument2 = XDocuments.GetSpecificDocument<XInvitationDocument>(XInvitationDocument.uuID);
			XSpectateSceneDocument specificDocument3 = XDocuments.GetSpecificDocument<XSpectateSceneDocument>(XSpectateSceneDocument.uuID);
			uint liveID = specificDocument3.liveRecordInfo.liveID;
			DlgBase<XChatSmallView, XChatSmallBehaviour>.singleton.DoOpenChatWindow(null);
			bool flag = liveTypeBySceneType == LiveType.LIVE_PVP;
			if (flag)
			{
				int tianTiLevel = specificDocument3.liveRecordInfo.tianTiLevel;
				string name = specificDocument3.liveRecordInfo.nameInfos[0].roleInfo.name;
				string name2 = specificDocument3.liveRecordInfo.nameInfos[1].roleInfo.name;
				DlgBase<XChatView, XChatBehaviour>.singleton.RegistLinkSend(specificDocument2.GetSpectateLinkString(100002u, new object[]
				{
					tianTiLevel,
					name,
					name2
				}), new Action(this.OnChatSend));
			}
			else
			{
				bool flag2 = liveTypeBySceneType == LiveType.LIVE_NEST;
				if (flag2)
				{
					string title = specificDocument.GetTitle(specificDocument3.liveRecordInfo);
					DlgBase<XChatView, XChatBehaviour>.singleton.RegistLinkSend(specificDocument2.GetSpectateLinkString(100003u, new object[]
					{
						title
					}), new Action(this.OnChatSend));
				}
				else
				{
					bool flag3 = liveTypeBySceneType == LiveType.LIVE_PROTECTCAPTAIN;
					if (flag3)
					{
						List<LiveNameInfo> nameInfos = specificDocument3.liveRecordInfo.nameInfos;
						string teamLeaderName = nameInfos[0].teamLeaderName;
						string teamLeaderName2 = nameInfos[1].teamLeaderName;
						for (int i = 0; i < nameInfos.Count; i++)
						{
							bool isLeft = nameInfos[i].isLeft;
							if (isLeft)
							{
								bool flag4 = nameInfos[i].teamLeaderName != "";
								if (flag4)
								{
									teamLeaderName = nameInfos[i].teamLeaderName;
								}
							}
							else
							{
								bool flag5 = nameInfos[i].teamLeaderName != "";
								if (flag5)
								{
									teamLeaderName2 = nameInfos[i].teamLeaderName;
								}
							}
						}
						DlgBase<XChatView, XChatBehaviour>.singleton.RegistLinkSend(specificDocument2.GetSpectateLinkString(100004u, new object[]
						{
							teamLeaderName,
							teamLeaderName2
						}), new Action(this.OnChatSend));
					}
					else
					{
						bool flag6 = liveTypeBySceneType == LiveType.LIVE_GUILDBATTLE;
						if (flag6)
						{
							string guildName = specificDocument3.liveRecordInfo.nameInfos[0].guildName;
							string guildName2 = specificDocument3.liveRecordInfo.nameInfos[1].guildName;
							DlgBase<XChatView, XChatBehaviour>.singleton.RegistLinkSend(specificDocument2.GetSpectateLinkString(100005u, new object[]
							{
								guildName,
								guildName2
							}), new Action(this.OnChatSend));
						}
						else
						{
							bool flag7 = liveTypeBySceneType == LiveType.LIVE_DRAGON;
							if (flag7)
							{
								string title2 = specificDocument.GetTitle(specificDocument3.liveRecordInfo);
								DlgBase<XChatView, XChatBehaviour>.singleton.RegistLinkSend(specificDocument2.GetSpectateLinkString(100006u, new object[]
								{
									title2
								}), new Action(this.OnChatSend));
							}
							else
							{
								bool flag8 = liveTypeBySceneType == LiveType.LIVE_HEROBATTLE;
								if (flag8)
								{
									string title3 = specificDocument.GetTitle(specificDocument3.liveRecordInfo);
									DlgBase<XChatView, XChatBehaviour>.singleton.RegistLinkSend(specificDocument2.GetSpectateLinkString(100008u, new object[]
									{
										title3
									}), new Action(this.OnChatSend));
								}
								else
								{
									bool flag9 = liveTypeBySceneType == LiveType.LIVE_LEAGUEBATTLE;
									if (flag9)
									{
										string teamName = specificDocument3.liveRecordInfo.nameInfos[0].teamName;
										string teamName2 = specificDocument3.liveRecordInfo.nameInfos[1].teamName;
										DlgBase<XChatView, XChatBehaviour>.singleton.RegistLinkSend(specificDocument2.GetSpectateLinkString(100009u, new object[]
										{
											teamName,
											teamName2
										}), new Action(this.OnChatSend));
									}
									else
									{
										bool flag10 = liveTypeBySceneType == LiveType.LIVE_PVP2;
										if (flag10)
										{
											string text = "";
											string text2 = "";
											for (int j = 0; j < specificDocument3.liveRecordInfo.nameInfos.Count; j++)
											{
												bool flag11 = specificDocument3.liveRecordInfo.nameInfos[j].teamLeaderName != "";
												if (flag11)
												{
													bool isLeft2 = specificDocument3.liveRecordInfo.nameInfos[j].isLeft;
													if (isLeft2)
													{
														text = specificDocument3.liveRecordInfo.nameInfos[j].teamLeaderName;
													}
													else
													{
														text2 = specificDocument3.liveRecordInfo.nameInfos[j].teamLeaderName;
													}
												}
											}
											DlgBase<XChatView, XChatBehaviour>.singleton.RegistLinkSend(specificDocument2.GetSpectateLinkString(100010u, new object[]
											{
												text,
												text2
											}), new Action(this.OnChatSend));
										}
										else
										{
											bool flag12 = liveTypeBySceneType == LiveType.LIVE_CUSTOMPK;
											if (flag12)
											{
												string name3 = specificDocument3.liveRecordInfo.nameInfos[0].roleInfo.name;
												string name4 = specificDocument3.liveRecordInfo.nameInfos[1].roleInfo.name;
												DlgBase<XChatView, XChatBehaviour>.singleton.RegistLinkSend(specificDocument2.GetSpectateLinkString(100011u, new object[]
												{
													name3,
													name4
												}), new Action(this.OnChatSend));
											}
											else
											{
												bool flag13 = liveTypeBySceneType == LiveType.LIVE_CROSSGVG;
												if (flag13)
												{
													string guildName3 = specificDocument3.liveRecordInfo.nameInfos[0].guildName;
													string guildName4 = specificDocument3.liveRecordInfo.nameInfos[1].guildName;
													DlgBase<XChatView, XChatBehaviour>.singleton.RegistLinkSend(specificDocument2.GetSpectateLinkString(100013u, new object[]
													{
														guildName3,
														guildName4
													}), new Action(this.OnChatSend));
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
			return true;
		}

		private void OnChatSend()
		{
			XSpectateDocument specificDocument = XDocuments.GetSpecificDocument<XSpectateDocument>(XSpectateDocument.uuID);
			LiveType liveTypeBySceneType = XSpectateDocument.GetLiveTypeBySceneType(XSingleton<XScene>.singleton.SceneType);
			XSingleton<XDebug>.singleton.AddLog("Share btn click, live type is:" + liveTypeBySceneType, null, null, null, null, null, XDebugColor.XDebug_None);
			uint num = (uint)XFastEnumIntEqualityComparer<ChatChannelType>.ToInt(ChatChannelType.World);
			XInvitationDocument specificDocument2 = XDocuments.GetSpecificDocument<XInvitationDocument>(XInvitationDocument.uuID);
			XSpectateSceneDocument specificDocument3 = XDocuments.GetSpecificDocument<XSpectateSceneDocument>(XSpectateSceneDocument.uuID);
			uint liveID = specificDocument3.liveRecordInfo.liveID;
			bool flag = liveTypeBySceneType == LiveType.LIVE_PVP;
			if (flag)
			{
				int tianTiLevel = specificDocument3.liveRecordInfo.tianTiLevel;
				string name = specificDocument3.liveRecordInfo.nameInfos[0].roleInfo.name;
				string name2 = specificDocument3.liveRecordInfo.nameInfos[1].roleInfo.name;
				specificDocument2.SendSpectateInvitation(100002u, liveID, liveTypeBySceneType, new object[]
				{
					tianTiLevel,
					name,
					name2
				});
			}
			else
			{
				bool flag2 = liveTypeBySceneType == LiveType.LIVE_NEST;
				if (flag2)
				{
					string title = specificDocument.GetTitle(specificDocument3.liveRecordInfo);
					specificDocument2.SendSpectateInvitation(100003u, liveID, liveTypeBySceneType, new object[]
					{
						title
					});
				}
				else
				{
					bool flag3 = liveTypeBySceneType == LiveType.LIVE_PROTECTCAPTAIN;
					if (flag3)
					{
						List<LiveNameInfo> nameInfos = specificDocument3.liveRecordInfo.nameInfos;
						string teamLeaderName = nameInfos[0].teamLeaderName;
						string teamLeaderName2 = nameInfos[1].teamLeaderName;
						for (int i = 0; i < nameInfos.Count; i++)
						{
							bool isLeft = nameInfos[i].isLeft;
							if (isLeft)
							{
								bool flag4 = nameInfos[i].teamLeaderName != "";
								if (flag4)
								{
									teamLeaderName = nameInfos[i].teamLeaderName;
								}
							}
							else
							{
								bool flag5 = nameInfos[i].teamLeaderName != "";
								if (flag5)
								{
									teamLeaderName2 = nameInfos[i].teamLeaderName;
								}
							}
						}
						specificDocument2.SendSpectateInvitation(100004u, liveID, liveTypeBySceneType, new object[]
						{
							teamLeaderName,
							teamLeaderName2
						});
					}
					else
					{
						bool flag6 = liveTypeBySceneType == LiveType.LIVE_GUILDBATTLE;
						if (flag6)
						{
							string guildName = specificDocument3.liveRecordInfo.nameInfos[0].guildName;
							string guildName2 = specificDocument3.liveRecordInfo.nameInfos[1].guildName;
							specificDocument2.SendSpectateInvitation(100005u, liveID, liveTypeBySceneType, new object[]
							{
								guildName,
								guildName2
							});
						}
						else
						{
							bool flag7 = liveTypeBySceneType == LiveType.LIVE_DRAGON;
							if (flag7)
							{
								string title2 = specificDocument.GetTitle(specificDocument3.liveRecordInfo);
								specificDocument2.SendSpectateInvitation(100006u, liveID, liveTypeBySceneType, new object[]
								{
									title2
								});
							}
							else
							{
								bool flag8 = liveTypeBySceneType == LiveType.LIVE_HEROBATTLE;
								if (flag8)
								{
									string title3 = specificDocument.GetTitle(specificDocument3.liveRecordInfo);
									specificDocument2.SendSpectateInvitation(100008u, liveID, liveTypeBySceneType, new object[]
									{
										title3
									});
								}
								else
								{
									bool flag9 = liveTypeBySceneType == LiveType.LIVE_LEAGUEBATTLE;
									if (flag9)
									{
										string teamName = specificDocument3.liveRecordInfo.nameInfos[0].teamName;
										string teamName2 = specificDocument3.liveRecordInfo.nameInfos[1].teamName;
										specificDocument2.SendSpectateInvitation(100009u, liveID, liveTypeBySceneType, new object[]
										{
											teamName,
											teamName2
										});
									}
									else
									{
										bool flag10 = liveTypeBySceneType == LiveType.LIVE_PVP2;
										if (flag10)
										{
											string text = "";
											string text2 = "";
											for (int j = 0; j < specificDocument3.liveRecordInfo.nameInfos.Count; j++)
											{
												bool flag11 = specificDocument3.liveRecordInfo.nameInfos[j].teamLeaderName != "";
												if (flag11)
												{
													bool isLeft2 = specificDocument3.liveRecordInfo.nameInfos[j].isLeft;
													if (isLeft2)
													{
														text = specificDocument3.liveRecordInfo.nameInfos[j].teamLeaderName;
													}
													else
													{
														text2 = specificDocument3.liveRecordInfo.nameInfos[j].teamLeaderName;
													}
												}
											}
											specificDocument2.SendSpectateInvitation(100010u, liveID, liveTypeBySceneType, new object[]
											{
												text,
												text2
											});
										}
										else
										{
											bool flag12 = liveTypeBySceneType == LiveType.LIVE_CUSTOMPK;
											if (flag12)
											{
												string name3 = specificDocument3.liveRecordInfo.nameInfos[0].roleInfo.name;
												string name4 = specificDocument3.liveRecordInfo.nameInfos[1].roleInfo.name;
												specificDocument2.SendSpectateInvitation(100011u, liveID, liveTypeBySceneType, new object[]
												{
													name3,
													name4
												});
											}
											else
											{
												bool flag13 = liveTypeBySceneType == LiveType.LIVE_CROSSGVG;
												if (flag13)
												{
													string guildName3 = specificDocument3.liveRecordInfo.nameInfos[0].guildName;
													string guildName4 = specificDocument3.liveRecordInfo.nameInfos[1].guildName;
													specificDocument2.SendSpectateInvitation(100013u, liveID, liveTypeBySceneType, new object[]
													{
														guildName3,
														guildName4
													});
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}

		public void ShowBackToMainCityTips()
		{
			string @string = XStringDefineProxy.GetString("ERR_WATCH_LIVEISOVER");
			string string2 = XStringDefineProxy.GetString("Spectate_Goon");
			string string3 = XStringDefineProxy.GetString("LEVEL_REWARD_RETURN");
			XSingleton<UiUtility>.singleton.ShowModalDialog(@string, string2, string3, new ButtonClickEventHandler(this.OnGoOnBtnClick), new ButtonClickEventHandler(this.OnBackToMainCityBtnClick), false, XTempTipDefine.OD_START, 251);
		}

		private bool OnBackToMainCityBtnClick(IXUIButton btn)
		{
			DlgBase<ModalDlg, ModalDlgBehaviour>.singleton.SetVisible(false, true);
			this._doc.LevelScene();
			return true;
		}

		private bool OnGoOnBtnClick(IXUIButton btn)
		{
			DlgBase<ModalDlg, ModalDlgBehaviour>.singleton.SetVisible(false, true);
			DlgBase<SpectateView, SpectateBehaviour>.singleton.SetVisible(true, true);
			return true;
		}

		public float GetLeftTime()
		{
			return this.leftTimeCounter.GetFloatLeftTime();
		}
	}
}