-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameCanvas.cs
More file actions
2843 lines (2586 loc) · 72.2 KB
/
Copy pathGameCanvas.cs
File metadata and controls
2843 lines (2586 loc) · 72.2 KB
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
using System;
using System.IO;
using System.Threading;
using Assets.src.g;
using UnityEngine;
// Token: 0x020000B7 RID: 183
public class GameCanvas : IActionListener
{
// Token: 0x060008DD RID: 2269 RVA: 0x0008022C File Offset: 0x0007E42C
public GameCanvas()
{
this.g = new mGraphics();
this.count = 1;
int num = Rms.loadRMSInt("languageVersion");
if (num == -1)
{
Rms.saveRMSInt("languageVersion", 2);
}
else if (num != 2)
{
Main.main.doClearRMS();
Rms.saveRMSInt("languageVersion", 2);
}
GameCanvas.clearOldData = Rms.loadRMSInt(GameMidlet.VERSION);
if (GameCanvas.clearOldData != 1)
{
Main.main.doClearRMS();
Rms.saveRMSInt(GameMidlet.VERSION, 1);
}
this.initGame();
}
// Token: 0x060008DF RID: 2271 RVA: 0x00007360 File Offset: 0x00005560
public static string getPlatformName()
{
return "iphone platform xxx";
}
// Token: 0x060008E0 RID: 2272 RVA: 0x000803C4 File Offset: 0x0007E5C4
public void initGame()
{
MotherCanvas.instance.setChildCanvas(this);
GameCanvas.w = MotherCanvas.instance.getWidthz();
GameCanvas.h = MotherCanvas.instance.getHeightz();
GameCanvas.hw = GameCanvas.w / 2;
GameCanvas.hh = GameCanvas.h / 2;
GameCanvas.isTouch = true;
if (GameCanvas.w >= 240)
{
GameCanvas.isTouchControl = true;
}
if (GameCanvas.w < 320)
{
GameCanvas.isTouchControlSmallScreen = true;
}
if (GameCanvas.w >= 320)
{
GameCanvas.isTouchControlLargeScreen = true;
}
GameCanvas.msgdlg = new MsgDlg();
if (GameCanvas.h <= 160)
{
Paint.hTab = 15;
mScreen.cmdH = 17;
}
GameScr.d = ((GameCanvas.w <= GameCanvas.h) ? GameCanvas.h : GameCanvas.w) + 20;
GameCanvas.instance = this;
mFont.init();
mScreen.ITEM_HEIGHT = mFont.tahoma_8b.getHeight() + 8;
this.initPaint();
this.loadDust();
this.loadWaterSplash();
GameCanvas.panel = new Panel();
GameCanvas.imgShuriken = GameCanvas.loadImage("/mainImage/myTexture2df.png");
int num = Rms.loadRMSInt("clienttype");
if (num != -1)
{
if (num > 7)
{
Rms.saveRMSInt("clienttype", mSystem.clientType);
}
else
{
mSystem.clientType = num;
}
}
if (mSystem.clientType == 7 && (Rms.loadRMSString("fake") == null || Rms.loadRMSString("fake") == string.Empty))
{
GameCanvas.imgShuriken = GameCanvas.loadImage("/mainImage/wait.png");
}
GameCanvas.imgClear = GameCanvas.loadImage("/mainImage/myTexture2der.png");
GameCanvas.img12 = GameCanvas.loadImage("/mainImage/12+.png");
GameCanvas.debugUpdate = new MyVector();
GameCanvas.debugPaint = new MyVector();
GameCanvas.debugSession = new MyVector();
for (int i = 0; i < 3; i++)
{
GameCanvas.imgBorder[i] = GameCanvas.loadImage("/mainImage/myTexture2dbd" + i + ".png");
}
GameCanvas.borderConnerW = mGraphics.getImageWidth(GameCanvas.imgBorder[0]);
GameCanvas.borderConnerH = mGraphics.getImageHeight(GameCanvas.imgBorder[0]);
GameCanvas.borderCenterW = mGraphics.getImageWidth(GameCanvas.imgBorder[1]);
GameCanvas.borderCenterH = mGraphics.getImageHeight(GameCanvas.imgBorder[1]);
Panel.graphics = 1;
GameCanvas.lowGraphic = true;
GameScr.isPaintChatVip = (Rms.loadRMSInt("serverchat") != 1);
Res.init();
SmallImage.loadBigImage();
Panel.WIDTH_PANEL = 176;
if (Panel.WIDTH_PANEL > GameCanvas.w)
{
Panel.WIDTH_PANEL = GameCanvas.w;
}
InfoMe.gI().loadCharId();
Command.btn0left = GameCanvas.loadImage("/mainImage/btn0left.png");
Command.btn0mid = GameCanvas.loadImage("/mainImage/btn0mid.png");
Command.btn0right = GameCanvas.loadImage("/mainImage/btn0right.png");
Command.btn1left = GameCanvas.loadImage("/mainImage/btn1left.png");
Command.btn1mid = GameCanvas.loadImage("/mainImage/btn1mid.png");
Command.btn1right = GameCanvas.loadImage("/mainImage/btn1right.png");
GameCanvas.serverScreen = new ServerListScreen();
GameCanvas.img12 = GameCanvas.loadImage("/mainImage/12+.png");
for (int j = 0; j < 7; j++)
{
GameCanvas.imgBlue[j] = GameCanvas.loadImage("/effectdata/blue/" + j + ".png");
GameCanvas.imgViolet[j] = GameCanvas.loadImage("/effectdata/violet/" + j + ".png");
}
ServerListScreen.createDeleteRMS();
}
// Token: 0x060008E1 RID: 2273 RVA: 0x00007367 File Offset: 0x00005567
public static GameCanvas gI()
{
return GameCanvas.instance;
}
// Token: 0x060008E2 RID: 2274 RVA: 0x0000736E File Offset: 0x0000556E
public void initPaint()
{
GameCanvas.paintz = new Paint();
}
// Token: 0x060008E3 RID: 2275 RVA: 0x0000737A File Offset: 0x0000557A
public static void closeKeyBoard()
{
mGraphics.addYWhenOpenKeyBoard = 0;
GameCanvas.timeOpenKeyBoard = 0;
Main.closeKeyBoard();
}
// Token: 0x060008E4 RID: 2276 RVA: 0x00080704 File Offset: 0x0007E904
public void update()
{
if (GameCanvas.gameTick % 5 == 0)
{
GameCanvas.timeNow = mSystem.currentTimeMillis();
}
Res.updateOnScreenDebug();
try
{
if (global::TouchScreenKeyboard.visible)
{
GameCanvas.timeOpenKeyBoard++;
if (GameCanvas.timeOpenKeyBoard > ((!Main.isWindowsPhone) ? 10 : 5))
{
mGraphics.addYWhenOpenKeyBoard = 94;
}
}
else
{
mGraphics.addYWhenOpenKeyBoard = 0;
GameCanvas.timeOpenKeyBoard = 0;
}
GameCanvas.debugUpdate.removeAllElements();
long num = mSystem.currentTimeMillis();
if (num - GameCanvas.timeTickEff1 >= 780L && !GameCanvas.isEff1)
{
GameCanvas.timeTickEff1 = num;
GameCanvas.isEff1 = true;
}
else
{
GameCanvas.isEff1 = false;
}
if (num - GameCanvas.timeTickEff2 >= 7800L && !GameCanvas.isEff2)
{
GameCanvas.timeTickEff2 = num;
GameCanvas.isEff2 = true;
}
else
{
GameCanvas.isEff2 = false;
}
if (GameCanvas.taskTick > 0)
{
GameCanvas.taskTick--;
}
GameCanvas.gameTick++;
if (GameCanvas.gameTick > 10000)
{
GameCanvas.gameTick = 0;
}
if (GameCanvas.currentScreen != null)
{
if (!this.isLoadData)
{
this.data = this.loadData();
Rms.saveRMSString("acc", this.data[1]);
Rms.saveRMSString("pass", this.data[2]);
Rms.saveRMSInt("svselect", int.Parse(this.data[3]) - 1);
if (this.data[5] == "creat")
{
this.isCreat = true;
}
this.isLoadData = true;
}
if (GameCanvas.currentScreen == GameCanvas.serverScreen && GameCanvas.gameTick % 20 == 0)
{
if (GameCanvas.loginScr == null)
{
GameCanvas.loginScr = new LoginScr();
}
GameCanvas.currentScreen = GameCanvas.loginScr;
}
if (GameCanvas.currentScreen == GameCanvas.loginScr && !this.isLogin)
{
if (!this.isCreat)
{
Rms.saveRMSString("acc", this.data[1]);
Rms.saveRMSString("pass", this.data[2]);
Rms.saveRMSInt("svselect", int.Parse(this.data[3]) - 1);
GameCanvas.loginScr.doLogin();
}
else
{
Service.gI().login2(string.Empty);
}
this.isLogin = true;
}
if (GameCanvas.currentScreen == CreateCharScr.instance && this.isCreat)
{
Service.gI().createChar(GameCanvas.GetRandomString(), int.Parse(this.data[4]), 0);
this.userAo = Rms.loadRMSString("userAo" + ServerListScreen.ipSelect);
this.passAo = Rms.loadRMSString("passAo" + ServerListScreen.ipSelect);
this.isCreat = false;
}
if (GameCanvas.currentScreen == GameCanvas.loginScr && GameCanvas.loginScr.isRes && !this.isRegis)
{
GameCanvas.loginScr.isFAQ = false;
GameCanvas.startWaitDlg(mResources.CONNECTING);
GameCanvas.connect();
GameCanvas.startWaitDlg(mResources.REGISTERING);
Service.gI().requestRegister(this.data[1], this.data[2], this.userAo, this.passAo, GameMidlet.VERSION);
Rms.saveRMSString("acc", this.data[1]);
Rms.saveRMSString("pass", this.data[2]);
Rms.saveRMSInt("svselect", int.Parse(this.data[3]) - 1);
this.timeRegis = mSystem.currentTimeMillis() + 30000L;
this.isRegis = true;
}
if (GameCanvas.currentScreen == GameCanvas.loginScr && this.timeRegis != 0L && this.timeRegis - mSystem.currentTimeMillis() < 1000L)
{
this.isLogin = false;
this.timeRegis = 0L;
}
if (ChatPopup.serverChatPopUp != null)
{
ChatPopup.serverChatPopUp.update();
ChatPopup.serverChatPopUp.updateKey();
}
else if (ChatPopup.currChatPopup != null)
{
ChatPopup.currChatPopup.update();
ChatPopup.currChatPopup.updateKey();
}
else if (GameCanvas.currentDialog != null)
{
GameCanvas.debug("B", 0);
GameCanvas.currentDialog.update();
}
else if (GameCanvas.menu.showMenu)
{
GameCanvas.debug("C", 0);
GameCanvas.menu.updateMenu();
GameCanvas.debug("D", 0);
GameCanvas.menu.updateMenuKey();
}
else if (GameCanvas.panel.isShow)
{
GameCanvas.panel.update();
if (GameCanvas.panel2 != null)
{
if (GameCanvas.isFocusPanel2)
{
GameCanvas.panel2.updateKey();
}
else
{
GameCanvas.panel.updateKey();
}
if (GameCanvas.panel2.isShow)
{
GameCanvas.panel2.update();
if (GameCanvas.isPointer(GameCanvas.panel2.X, GameCanvas.panel2.Y, GameCanvas.panel2.W, GameCanvas.panel2.H))
{
GameCanvas.panel2.updateKey();
}
}
}
else
{
GameCanvas.panel.updateKey();
}
if (GameCanvas.panel.chatTField != null && GameCanvas.panel.chatTField.isShow)
{
GameCanvas.panel.chatTFUpdateKey();
}
else if (GameCanvas.panel2 != null && GameCanvas.panel2.chatTField != null && GameCanvas.panel2.chatTField.isShow)
{
GameCanvas.panel2.chatTFUpdateKey();
}
if (GameCanvas.isPointer(GameCanvas.panel.X + GameCanvas.panel.W, GameCanvas.panel.Y, GameCanvas.w - GameCanvas.panel.W * 2, GameCanvas.panel.H) && GameCanvas.isPointerJustRelease && GameCanvas.panel.isDoneCombine)
{
GameCanvas.panel.hide();
}
}
GameCanvas.debug("E", 0);
if (!GameCanvas.isLoading)
{
GameCanvas.currentScreen.update();
}
GameCanvas.debug("F", 0);
if (!GameCanvas.panel.isShow && ChatPopup.serverChatPopUp == null)
{
GameCanvas.currentScreen.updateKey();
}
Hint.update();
SoundMn.gI().update();
}
GameCanvas.debug("Ix", 0);
global::Timer.update();
GameCanvas.debug("Hx", 0);
InfoDlg.update();
GameCanvas.debug("G", 0);
if (this.resetToLoginScr)
{
this.resetToLoginScr = false;
this.doResetToLoginScr(GameCanvas.serverScreen);
}
GameCanvas.debug("Zzz", 0);
if (Controller.isConnectOK)
{
if (Controller.isMain)
{
GameMidlet.IP = ServerListScreen.address[ServerListScreen.ipSelect];
GameMidlet.PORT = (int)ServerListScreen.port[ServerListScreen.ipSelect];
Cout.println("Connect ok");
ServerListScreen.testConnect = 2;
Rms.saveRMSInt("svselect", ServerListScreen.ipSelect);
Rms.saveIP(GameMidlet.IP + ":" + GameMidlet.PORT);
Service.gI().setClientType();
Service.gI().androidPack();
}
else
{
Service.gI().setClientType2();
Service.gI().androidPack2();
}
Controller.isConnectOK = false;
}
if (Controller.isDisconnected)
{
Debug.Log("disconnect");
if (!Controller.isMain)
{
if (GameCanvas.currentScreen == GameCanvas.serverScreen && !Service.reciveFromMainSession)
{
GameCanvas.serverScreen.cancel();
}
if (GameCanvas.currentScreen == GameCanvas.loginScr && !Service.reciveFromMainSession)
{
this.onDisconnected();
}
}
else
{
this.onDisconnected();
}
Controller.isDisconnected = false;
}
if (Controller.isConnectionFail)
{
Debug.Log("connect fail");
if (!Controller.isMain)
{
if (GameCanvas.currentScreen == GameCanvas.serverScreen && ServerListScreen.isGetData && !Service.reciveFromMainSession)
{
GameCanvas.serverScreen.cancel();
}
if (GameCanvas.currentScreen == GameCanvas.loginScr && !Service.reciveFromMainSession)
{
this.onConnectionFail();
}
}
else
{
this.onConnectionFail();
}
Controller.isConnectionFail = false;
}
if (Main.isResume)
{
Main.isResume = false;
if (GameCanvas.currentDialog != null && GameCanvas.currentDialog.left != null && GameCanvas.currentDialog.left.actionListener != null)
{
GameCanvas.currentDialog.left.performAction();
}
}
}
catch (Exception)
{
}
}
// Token: 0x060008E5 RID: 2277 RVA: 0x00080EEC File Offset: 0x0007F0EC
public void onDisconnected()
{
if (Controller.isConnectionFail)
{
Controller.isConnectionFail = false;
}
GameCanvas.isResume = true;
Session_ME.gI().clearSendingMessage();
Session_ME2.gI().clearSendingMessage();
if (Controller.isLoadingData)
{
GameCanvas.instance.resetToLoginScrz();
GameCanvas.startOK(mResources.pls_restart_game_error, 8885, null);
Controller.isDisconnected = false;
return;
}
global::Char.isLoadingMap = false;
if (Controller.isMain)
{
ServerListScreen.testConnect = 0;
}
GameCanvas.instance.resetToLoginScrz();
if (Main.typeClient == 6)
{
if (GameCanvas.currentScreen != GameCanvas.serverScreen && GameCanvas.currentScreen != GameCanvas.loginScr)
{
GameCanvas.startOKDlg(mResources.maychutathoacmatsong);
new Thread(new ThreadStart(this.loginAgain)).Start();
}
}
else
{
GameCanvas.startOKDlg(mResources.maychutathoacmatsong);
new Thread(new ThreadStart(this.loginAgain)).Start();
}
mSystem.endKey();
}
// Token: 0x060008E6 RID: 2278 RVA: 0x00080FCC File Offset: 0x0007F1CC
public void onConnectionFail()
{
if (GameCanvas.currentScreen.Equals(SplashScr.instance))
{
if (ServerListScreen.hasConnected == null)
{
GameCanvas.startOK(mResources.pls_restart_game_error, 8885, null);
return;
}
if (!ServerListScreen.hasConnected[0])
{
ServerListScreen.hasConnected[0] = true;
ServerListScreen.ipSelect = 0;
GameMidlet.IP = ServerListScreen.address[ServerListScreen.ipSelect];
Rms.saveRMSInt("svselect", ServerListScreen.ipSelect);
GameCanvas.connect();
return;
}
if (!ServerListScreen.hasConnected[2])
{
ServerListScreen.hasConnected[2] = true;
ServerListScreen.ipSelect = 2;
GameMidlet.IP = ServerListScreen.address[ServerListScreen.ipSelect];
Rms.saveRMSInt("svselect", ServerListScreen.ipSelect);
GameCanvas.connect();
return;
}
GameCanvas.startOK(mResources.pls_restart_game_error, 8885, null);
return;
}
else
{
Session_ME.gI().clearSendingMessage();
Session_ME2.gI().clearSendingMessage();
ServerListScreen.isWait = false;
if (Controller.isLoadingData)
{
GameCanvas.startOK(mResources.pls_restart_game_error, 8885, null);
Controller.isConnectionFail = false;
return;
}
GameCanvas.isResume = true;
LoginScr.isContinueToLogin = false;
if (GameCanvas.loginScr != null)
{
GameCanvas.instance.resetToLoginScrz();
}
else
{
GameCanvas.loginScr = new LoginScr();
}
LoginScr.serverName = ServerListScreen.nameServer[ServerListScreen.ipSelect];
if (GameCanvas.currentScreen != GameCanvas.serverScreen)
{
GameCanvas.startOK(mResources.lost_connection + LoginScr.serverName, 888395, null);
}
else
{
GameCanvas.endDlg();
}
global::Char.isLoadingMap = false;
if (Controller.isMain)
{
ServerListScreen.testConnect = 0;
}
mSystem.endKey();
return;
}
}
// Token: 0x060008E7 RID: 2279 RVA: 0x0000738D File Offset: 0x0000558D
public static bool isWaiting()
{
return InfoDlg.isShow || (GameCanvas.msgdlg != null && GameCanvas.msgdlg.info.Equals(mResources.PLEASEWAIT)) || global::Char.isLoadingMap || LoginScr.isContinueToLogin;
}
// Token: 0x060008E8 RID: 2280 RVA: 0x000073C1 File Offset: 0x000055C1
public static void connect()
{
if (!Session_ME.gI().isConnected())
{
Session_ME.gI().connect(GameMidlet.IP, GameMidlet.PORT);
}
}
// Token: 0x060008E9 RID: 2281 RVA: 0x00081144 File Offset: 0x0007F344
public static void connect2()
{
if (!Session_ME2.gI().isConnected())
{
Res.outz(string.Concat(new object[]
{
"IP2= ",
GameMidlet.IP2,
" PORT 2= ",
GameMidlet.PORT2
}));
Session_ME2.gI().connect(GameMidlet.IP2, GameMidlet.PORT2);
}
}
// Token: 0x060008EA RID: 2282 RVA: 0x000073E3 File Offset: 0x000055E3
public static void resetTrans(mGraphics g)
{
g.translate(-g.getTranslateX(), -g.getTranslateY());
g.setClip(0, 0, GameCanvas.w, GameCanvas.h);
}
// Token: 0x060008EB RID: 2283 RVA: 0x000811A8 File Offset: 0x0007F3A8
public void initGameCanvas()
{
GameCanvas.debug("SP2i1", 0);
GameCanvas.w = MotherCanvas.instance.getWidthz();
GameCanvas.h = MotherCanvas.instance.getHeightz();
GameCanvas.debug("SP2i2", 0);
GameCanvas.hw = GameCanvas.w / 2;
GameCanvas.hh = GameCanvas.h / 2;
GameCanvas.wd3 = GameCanvas.w / 3;
GameCanvas.hd3 = GameCanvas.h / 3;
GameCanvas.w2d3 = 2 * GameCanvas.w / 3;
GameCanvas.h2d3 = 2 * GameCanvas.h / 3;
GameCanvas.w3d4 = 3 * GameCanvas.w / 4;
GameCanvas.h3d4 = 3 * GameCanvas.h / 4;
GameCanvas.wd6 = GameCanvas.w / 6;
GameCanvas.hd6 = GameCanvas.h / 6;
GameCanvas.debug("SP2i3", 0);
mScreen.initPos();
GameCanvas.debug("SP2i4", 0);
GameCanvas.debug("SP2i5", 0);
GameCanvas.inputDlg = new InputDlg();
GameCanvas.debug("SP2i6", 0);
GameCanvas.listPoint = new MyVector();
GameCanvas.debug("SP2i7", 0);
}
// Token: 0x060008EC RID: 2284 RVA: 0x00003584 File Offset: 0x00001784
public void start()
{
}
// Token: 0x060008ED RID: 2285 RVA: 0x0000740B File Offset: 0x0000560B
public int getWidth()
{
return (int)ScaleGUI.WIDTH;
}
// Token: 0x060008EE RID: 2286 RVA: 0x00007413 File Offset: 0x00005613
public int getHeight()
{
return (int)ScaleGUI.HEIGHT;
}
// Token: 0x060008EF RID: 2287 RVA: 0x00003584 File Offset: 0x00001784
public static void debug(string s, int type)
{
}
// Token: 0x060008F0 RID: 2288 RVA: 0x000812BC File Offset: 0x0007F4BC
public void doResetToLoginScr(mScreen screen)
{
try
{
SoundMn.gI().stopAll();
LoginScr.isContinueToLogin = false;
TileMap.lastType = (TileMap.bgType = 0);
global::Char.clearMyChar();
GameScr.clearGameScr();
GameScr.resetAllvector();
InfoDlg.hide();
GameScr.info1.hide();
GameScr.info2.hide();
GameScr.info2.cmdChat = null;
Hint.isShow = false;
ChatPopup.currChatPopup = null;
Controller.isStopReadMessage = false;
GameScr.loadCamera(true, -1, -1);
GameScr.cmx = 100;
GameCanvas.panel.currentTabIndex = 0;
GameCanvas.panel.selected = ((!GameCanvas.isTouch) ? 0 : -1);
GameCanvas.panel.init();
GameCanvas.panel2 = null;
GameScr.isPaint = true;
ClanMessage.vMessage.removeAllElements();
GameScr.textTime.removeAllElements();
GameScr.vClan.removeAllElements();
GameScr.vFriend.removeAllElements();
GameScr.vEnemies.removeAllElements();
TileMap.vCurrItem.removeAllElements();
BackgroudEffect.vBgEffect.removeAllElements();
EffecMn.vEff.removeAllElements();
Effect.newEff.removeAllElements();
GameCanvas.menu.showMenu = false;
GameCanvas.panel.vItemCombine.removeAllElements();
GameCanvas.panel.isShow = false;
if (GameCanvas.panel.tabIcon != null)
{
GameCanvas.panel.tabIcon.isShow = false;
}
if (mGraphics.zoomLevel == 1)
{
SmallImage.clearHastable();
}
Session_ME.gI().close();
Session_ME2.gI().close();
screen.switchToMe();
}
catch (Exception ex)
{
Cout.println("Loi tai doResetToLoginScr " + ex.ToString());
}
}
// Token: 0x060008F1 RID: 2289 RVA: 0x00003584 File Offset: 0x00001784
public static void showErrorForm(int type, string moreInfo)
{
}
// Token: 0x060008F2 RID: 2290 RVA: 0x00003584 File Offset: 0x00001784
public static void paintCloud(mGraphics g)
{
}
// Token: 0x060008F3 RID: 2291 RVA: 0x00003584 File Offset: 0x00001784
public static void updateBG()
{
}
// Token: 0x060008F4 RID: 2292 RVA: 0x00081468 File Offset: 0x0007F668
public static void fillRect(mGraphics g, int color, int x, int y, int w, int h, int detalY)
{
g.setColor(color);
int cmy = GameScr.cmy;
if (cmy > GameCanvas.h)
{
cmy = GameCanvas.h;
}
g.fillRect(x, y - ((detalY == 0) ? 0 : (cmy >> detalY)), w, h + ((detalY == 0) ? 0 : (cmy >> detalY)));
}
// Token: 0x060008F5 RID: 2293 RVA: 0x000814BC File Offset: 0x0007F6BC
public static void paintBackgroundtLayer(mGraphics g, int layer, int deltaY, int color1, int color2)
{
try
{
int num = layer - 1;
if (num == GameCanvas.imgBG.Length - 1 && (GameScr.gI().isRongThanXuatHien || GameScr.gI().isFireWorks))
{
g.setColor(GameScr.gI().mautroi);
g.fillRect(0, 0, GameCanvas.w, GameCanvas.h);
if (GameCanvas.typeBg == 2 || GameCanvas.typeBg == 4 || GameCanvas.typeBg == 7)
{
GameCanvas.drawSun1(g);
GameCanvas.drawSun2(g);
}
if (GameScr.gI().isFireWorks && !GameCanvas.lowGraphic)
{
FireWorkEff.paint(g);
}
}
else if (GameCanvas.imgBG != null && GameCanvas.imgBG[num] != null)
{
if (GameCanvas.moveX[num] != 0)
{
GameCanvas.moveX[num] += GameCanvas.moveXSpeed[num];
}
int cmy = GameScr.cmy;
if (cmy > GameCanvas.h)
{
cmy = GameCanvas.h;
}
if (GameCanvas.layerSpeed[num] != 0)
{
for (int i = -((GameScr.cmx + GameCanvas.moveX[num] >> GameCanvas.layerSpeed[num]) % GameCanvas.bgW[num]); i < GameScr.gW; i += GameCanvas.bgW[num])
{
g.drawImage(GameCanvas.imgBG[num], i, GameCanvas.yb[num] - ((deltaY <= 0) ? 0 : (cmy >> deltaY)), 0);
}
}
else
{
for (int j = 0; j < GameScr.gW; j += GameCanvas.bgW[num])
{
g.drawImage(GameCanvas.imgBG[num], j, GameCanvas.yb[num] - ((deltaY <= 0) ? 0 : (cmy >> deltaY)), 0);
}
}
if (color1 != -1)
{
if (num == GameCanvas.nBg - 1)
{
GameCanvas.fillRect(g, color1, 0, -(cmy >> deltaY), GameScr.gW, GameCanvas.yb[num], deltaY);
}
else
{
GameCanvas.fillRect(g, color1, 0, GameCanvas.yb[num - 1] + GameCanvas.bgH[num - 1], GameScr.gW, GameCanvas.yb[num] - (GameCanvas.yb[num - 1] + GameCanvas.bgH[num - 1]), deltaY);
}
}
if (color2 != -1)
{
if (num == 0)
{
GameCanvas.fillRect(g, color2, 0, GameCanvas.yb[num] + GameCanvas.bgH[num], GameScr.gW, GameScr.gH - (GameCanvas.yb[num] + GameCanvas.bgH[num]), deltaY);
}
else
{
GameCanvas.fillRect(g, color2, 0, GameCanvas.yb[num] + GameCanvas.bgH[num], GameScr.gW, GameCanvas.yb[num - 1] - (GameCanvas.yb[num] + GameCanvas.bgH[num]) + 80, deltaY);
}
}
if (GameCanvas.currentScreen == GameScr.instance)
{
if (layer == 1 && GameCanvas.typeBg == 11)
{
g.drawImage(GameCanvas.imgSun2, -(GameScr.cmx >> GameCanvas.layerSpeed[0]) + 400, GameCanvas.yb[0] + 30 - (cmy >> 2), StaticObj.BOTTOM_HCENTER);
}
if (layer == 1 && GameCanvas.typeBg == 13)
{
g.drawImage(GameCanvas.imgBG[1], -(GameScr.cmx >> GameCanvas.layerSpeed[0]) + 200, GameCanvas.yb[0] - (cmy >> 3) + 30, 0);
g.drawRegion(GameCanvas.imgBG[1], 0, 0, GameCanvas.bgW[1], GameCanvas.bgH[1], 2, -(GameScr.cmx >> GameCanvas.layerSpeed[0]) + 200 + GameCanvas.bgW[1], GameCanvas.yb[0] - (cmy >> 3) + 30, 0);
}
if (layer == 3 && TileMap.mapID == 1)
{
for (int k = 0; k < TileMap.pxh / mGraphics.getImageHeight(GameCanvas.imgCaycot); k++)
{
g.drawImage(GameCanvas.imgCaycot, -(GameScr.cmx >> GameCanvas.layerSpeed[2]) + 300, k * mGraphics.getImageHeight(GameCanvas.imgCaycot) - (cmy >> 3), 0);
}
}
}
int x = -(GameScr.cmx + GameCanvas.moveX[num] >> GameCanvas.layerSpeed[num]);
EffecMn.paintBackGroundUnderLayer(g, x, GameCanvas.yb[num] + GameCanvas.bgH[num] - (cmy >> deltaY), num);
}
}
catch (Exception ex)
{
Cout.LogError("Loi ham paint bground: " + ex.ToString());
}
}
// Token: 0x060008F6 RID: 2294 RVA: 0x000818DC File Offset: 0x0007FADC
public static void drawSun1(mGraphics g)
{
if (GameCanvas.imgSun != null)
{
g.drawImage(GameCanvas.imgSun, GameCanvas.sunX, GameCanvas.sunY, 0);
}
if (GameCanvas.isBoltEff)
{
if (GameCanvas.gameTick % 200 == 0)
{
GameCanvas.boltActive = true;
}
if (GameCanvas.boltActive)
{
GameCanvas.tBolt++;
if (GameCanvas.tBolt == 10)
{
GameCanvas.tBolt = 0;
GameCanvas.boltActive = false;
}
if (GameCanvas.tBolt % 2 == 0)
{
g.setColor(16777215);
g.fillRect(0, 0, GameCanvas.w, GameCanvas.h);
}
}
}
}
// Token: 0x060008F7 RID: 2295 RVA: 0x00003584 File Offset: 0x00001784
public static void drawSun2(mGraphics g)
{
}
// Token: 0x060008F8 RID: 2296 RVA: 0x0000741B File Offset: 0x0000561B
public static bool isHDVersion()
{
return mGraphics.zoomLevel > 1;
}
// Token: 0x060008F9 RID: 2297 RVA: 0x00081970 File Offset: 0x0007FB70
public static void paintBGGameScr(mGraphics g)
{
if (!GameCanvas.isLoadBGok)
{
g.setColor(0);
g.fillRect(0, 0, GameCanvas.w, GameCanvas.h);
}
if (global::Char.isLoadingMap)
{
return;
}
int gW = GameScr.gW;
int gH = GameScr.gH;
g.translate(-g.getTranslateX(), -g.getTranslateY());
g.setColor(13238271);
g.fillRect(0, 0, GameCanvas.w, GameCanvas.h);
}
// Token: 0x060008FA RID: 2298 RVA: 0x00003584 File Offset: 0x00001784
public static void resetBg()
{
}
// Token: 0x060008FB RID: 2299 RVA: 0x000819E4 File Offset: 0x0007FBE4
public static void getYBackground(int typeBg)
{
int gH = GameScr.gH23;
switch (typeBg)
{
case 0:
GameCanvas.yb[0] = gH - GameCanvas.bgH[0] + 70;
GameCanvas.yb[1] = GameCanvas.yb[0] - GameCanvas.bgH[1] + 20;
GameCanvas.yb[2] = GameCanvas.yb[1] - GameCanvas.bgH[2] + 30;
GameCanvas.yb[3] = GameCanvas.yb[2] - GameCanvas.bgH[3] + 50;
return;
case 1:
GameCanvas.yb[0] = gH - GameCanvas.bgH[0] + 120;
GameCanvas.yb[1] = GameCanvas.yb[0] - GameCanvas.bgH[1] + 40;
GameCanvas.yb[2] = GameCanvas.yb[1] - 90;
GameCanvas.yb[3] = GameCanvas.yb[2] - 25;
return;
case 2:
GameCanvas.yb[0] = gH - GameCanvas.bgH[0] + 150;
GameCanvas.yb[1] = GameCanvas.yb[0] - GameCanvas.bgH[1] - 60;
GameCanvas.yb[2] = GameCanvas.yb[1] - GameCanvas.bgH[2] - 40;
GameCanvas.yb[3] = GameCanvas.yb[2] - GameCanvas.bgH[3] - 10;
GameCanvas.yb[4] = GameCanvas.yb[3] - GameCanvas.bgH[4];
return;
case 3:
GameCanvas.yb[0] = gH - GameCanvas.bgH[0] + 10;
GameCanvas.yb[1] = GameCanvas.yb[0] + 80;
GameCanvas.yb[2] = GameCanvas.yb[1] - GameCanvas.bgH[2] - 10;
return;
case 4:
GameCanvas.yb[0] = gH - GameCanvas.bgH[0] + 130;
GameCanvas.yb[1] = GameCanvas.yb[0] - GameCanvas.bgH[1];
GameCanvas.yb[2] = GameCanvas.yb[1] - GameCanvas.bgH[2] - 20;
GameCanvas.yb[3] = GameCanvas.yb[1] - GameCanvas.bgH[2] - 80;
return;
case 5:
GameCanvas.yb[0] = gH - GameCanvas.bgH[0] + 40;
GameCanvas.yb[1] = GameCanvas.yb[0] - GameCanvas.bgH[1] + 10;
GameCanvas.yb[2] = GameCanvas.yb[1] - GameCanvas.bgH[2] + 15;
GameCanvas.yb[3] = GameCanvas.yb[2] - GameCanvas.bgH[3] + 50;
return;
case 6:
GameCanvas.yb[0] = gH - GameCanvas.bgH[0] + 100;
GameCanvas.yb[1] = GameCanvas.yb[0] - GameCanvas.bgH[1] - 30;
GameCanvas.yb[2] = GameCanvas.yb[1] - GameCanvas.bgH[2] + 10;
GameCanvas.yb[3] = GameCanvas.yb[2] - GameCanvas.bgH[3] + 15;
GameCanvas.yb[4] = GameCanvas.yb[3] - GameCanvas.bgH[4] + 15;
return;
case 7:
GameCanvas.yb[0] = gH - GameCanvas.bgH[0] + 20;
GameCanvas.yb[1] = GameCanvas.yb[0] - GameCanvas.bgH[1] + 15;
GameCanvas.yb[2] = GameCanvas.yb[1] - GameCanvas.bgH[2] + 20;
GameCanvas.yb[3] = GameCanvas.yb[1] - GameCanvas.bgH[2] - 10;
return;
case 8:
GameCanvas.yb[0] = gH - 103 + 150;
if (TileMap.mapID == 103)
{
GameCanvas.yb[0] -= 100;
}
GameCanvas.yb[1] = GameCanvas.yb[0] - GameCanvas.bgH[1] - 10;
GameCanvas.yb[2] = GameCanvas.yb[1] - GameCanvas.bgH[2] + 40;
GameCanvas.yb[3] = GameCanvas.yb[2] - GameCanvas.bgH[3] + 10;
return;
case 9:
GameCanvas.yb[0] = gH - GameCanvas.bgH[0] + 100;
GameCanvas.yb[1] = GameCanvas.yb[0] - GameCanvas.bgH[1] + 22;
GameCanvas.yb[2] = GameCanvas.yb[1] - GameCanvas.bgH[2] + 50;
GameCanvas.yb[3] = GameCanvas.yb[2] - GameCanvas.bgH[3];
return;
case 10:
GameCanvas.yb[0] = gH - GameCanvas.bgH[0] - 45;
GameCanvas.yb[1] = GameCanvas.yb[0] - GameCanvas.bgH[1] - 10;
return;
case 11:
GameCanvas.yb[0] = gH - GameCanvas.bgH[0] + 60;
GameCanvas.yb[1] = GameCanvas.yb[0] - GameCanvas.bgH[1] + 5;
GameCanvas.yb[2] = GameCanvas.yb[1] - GameCanvas.bgH[2] - 15;
return;
case 12:
GameCanvas.yb[0] = gH + 40;
GameCanvas.yb[1] = GameCanvas.yb[0] - 40;
GameCanvas.yb[2] = GameCanvas.yb[1] - 40;
return;
case 13:
GameCanvas.yb[0] = gH - 80;
GameCanvas.yb[1] = GameCanvas.yb[0];
return;
case 14:
return;
case 15:
GameCanvas.yb[0] = gH - 20;
GameCanvas.yb[1] = GameCanvas.yb[0] - 80;
return;
default:
return;
}
}
// Token: 0x060008FC RID: 2300 RVA: 0x00081EE4 File Offset: 0x000800E4
public static void loadBG(int typeBG)
{
try
{
GameCanvas.isLoadBGok = true;
}
catch (Exception)
{
GameCanvas.isLoadBGok = false;
}
}
// Token: 0x060008FD RID: 2301 RVA: 0x00003584 File Offset: 0x00001784
private static void randomRaintEff(int typeBG)
{
}
// Token: 0x060008FE RID: 2302 RVA: 0x00081F14 File Offset: 0x00080114
public void keyPressedz(int keyCode)
{
GameCanvas.lastTimePress = mSystem.currentTimeMillis();
if ((keyCode >= 48 && keyCode <= 57) || (keyCode >= 65 && keyCode <= 122) || keyCode == 10 || keyCode == 8 || keyCode == 13 || keyCode == 32 || keyCode == 31)
{
GameCanvas.keyAsciiPress = keyCode;
}
this.mapKeyPress(keyCode);
}
// Token: 0x060008FF RID: 2303 RVA: 0x00081F64 File Offset: 0x00080164
public void mapKeyPress(int keyCode)
{
if (GameCanvas.currentDialog != null)
{
GameCanvas.currentDialog.keyPress(keyCode);
GameCanvas.keyAsciiPress = 0;