-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
key code.txt
851 lines (792 loc) · 22.2 KB
/
key code.txt
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
void CGame::OnSysKeyDown(WPARAM wParam)
{
switch (wParam)
{
case VK_SHIFT:
m_bShiftPressed = true;
break;
case VK_CONTROL:
m_bCtrlPressed = true;
break;
case VK_RETURN:
/*if (m_altPressed)
{
for (int i = 0; i < MAXSPRITES; ++i)
{
delete m_pSprite[i];
m_pSprite[i] = 0;
}
for (int i = 0; i < MAXTILES; ++i)
{
delete m_pTileSpr[i];
m_pTileSpr[i] = 0;
}
for (int i = 0; i < MAXEFFECTSPR; ++i)
{
delete m_pEffectSpr[i];
m_pEffectSpr[i] = 0;
}
//fullscreen swap?
driver->endScene();
device->closeDevice();
if (fullscreen)
{
this->screenwidth = 800;
this->screenheight = 600;
}
else
{
this->screenwidth = 1920;
this->screenheight = 1080;
}
oldmode = m_cGameMode;
CreateRenderer(!fullscreen);
m_hWnd = G_hWnd;
//m_cGameMode = GAMEMODE_ONLOADING;
ChangeGameMode(GAMEMODE_ONLOADING);
fullscreenswap = true;
driver->beginScene();
m_pSprite[SPRID_INTERFACE_ND_LOADING] = CSprite::CreateSprite(L"New-Dialog", 0, false);
m_pSprite[SPRID_INTERFACE_ADDINTERFACE] = CSprite::CreateSprite(L"interface2", 0, false);
m_pSprite[SPRID_INTERFACE_CRAFTING] = CSprite::CreateSprite(L"interface2", 3, false);
m_pSprite[SPRID_INTERFACE_SPRFONTS2] = CSprite::CreateSprite(L"interface2", 1, false);
m_pSprite[SPRID_INTERFACE_F1HELPWINDOWS] = CSprite::CreateSprite(L"interface2", 2, false);
m_pSprite[SPRID_INTERFACE_FONT1] = CSprite::CreateSprite(L"sprfonts", 0, false);
m_pSprite[SPRID_INTERFACE_FONT2] = CSprite::CreateSprite(L"sprfonts", 1, false);
m_cLoading = 0;
}*/
m_bEnterPressed = true;
break;
case VK_MENU:
m_altPressed = true;
break;
case VK_F10:
if (!m_bIsDialogEnabled[57] && m_iGuildRank != GUILDRANK_NONE)
EnableDialogBox(57, 0, 0, 0);
else
DisableDialogBox(57);
break;
}
}
void CGame::OnSysKeyUp(WPARAM wParam)
{
switch (wParam)
{
case VK_SHIFT:
m_bShiftPressed = false;
break;
case VK_CONTROL:
m_bCtrlPressed = false;
break;
case VK_RETURN:
m_bEnterPressed = false;
if (m_bToggleScreen == true)
{
m_bIsRedrawPDBGS = true;
////DIRECTX m_DDraw.ChangeDisplayMode(G_hWnd);
}
break;
case VK_ESCAPE:
m_bEscPressed = false;
case VK_MENU:
m_altPressed = false;
break;
}
}
void CGame::OnKeyUp(WPARAM wParam)
{
int i = 0;
uint32_t dwTime = unixtime();
static uint32_t dwPrevTabTime = 0;
switch (wParam) {
case VK_ADD:
foregroundfpstarget++;
backgroundfpstarget++;
break;
case VK_SUBTRACT:
foregroundfpstarget--;
backgroundfpstarget--;
break;
case VK_MENU:
m_altPressed = false;
break;
case VK_SHIFT:
case 160://temporary (irrlicht shift code)
m_bShiftPressed = false;
break;
case VK_CONTROL:
case 162://temporary
m_bCtrlPressed = false;
break;
case 65://'A'
if (m_bCtrlPressed && m_cGameMode == GAMEMODE_ONMAINGAME && (!m_bInputStatus))
{
if (m_bForceAttack)
{
m_bForceAttack = false;
AddEventList(MSG_FORCEATTACK_OFF, 10);
}
else
{
m_bForceAttack = true;
AddEventList(MSG_FORCEATTACK_ON, 10);
}
}
break;
case 67://'C' // Crit Command / CTRL + C xRisenx
if (m_bCtrlPressed && m_cGameMode == GAMEMODE_ONMAINGAME && (!m_bInputStatus))
{
bSendCommand(MSGID_REQUEST_CRITICALS, 0, 0, 0, 0, 0, 0, 0);
}
break;
case 68://'D'
if (m_bCtrlPressed == true && m_cGameMode == GAMEMODE_ONMAINGAME && (!m_bInputStatus))
{
m_cDetailLevel++;
if (m_cDetailLevel > 2) m_cDetailLevel = 0;
switch (m_cDetailLevel) {
case 0:
AddEventList(NOTIFY_MSG_DETAIL_LEVEL_LOW, 10);
break;
case 1:
AddEventList(NOTIFY_MSG_DETAIL_LEVEL_MEDIUM, 10);
break;
case 2:
AddEventList(NOTIFY_MSG_DETAIL_LEVEL_HIGH, 10);
break;
}
}
break;
case 70: //'F'
if (m_bCtrlPressed)
{
LoadFriendList();
UpdateFriendsStatus();
EnableDialogBox(43, 0, 0, 0);
}
break;
case 72: // 'H' // Snoopy: Mimics VK_F1
if (m_bCtrlPressed && m_cGameMode == GAMEMODE_ONMAINGAME && (!m_bInputStatus))
{
if (m_bIsDialogEnabled[35] == false)
EnableDialogBox(35, 0, 0, 0);
else
{
DisableDialogBox(35);
DisableDialogBox(18);
}
}
break;
case 87: // 'W' // Snoopy: mimics VK_F11 Togles transparency
if (m_bCtrlPressed && m_cGameMode == GAMEMODE_ONMAINGAME && (!m_bInputStatus))
{
m_bDialogTrans = !m_bDialogTrans;
}
break;
case 88: // 'X' // Snoopy: mimics VK_F12 Logout Window
if (m_bCtrlPressed && m_cGameMode == GAMEMODE_ONMAINGAME && (!m_bInputStatus))
{
if (m_bIsDialogEnabled[19] == false)
EnableDialogBox(19, 0, 0, 0);
else DisableDialogBox(19);
}
break;
case 77://'M'
if (m_cGameMode == GAMEMODE_ONMAINGAME)
{
if (m_bCtrlPressed)
{
if (m_bIsDialogEnabled[9] == true) DisableDialogBox(9);
else EnableDialogBox(9, 0, 0, 0, 0);
}
}
break;
case 78://'N'
if (m_bCtrlPressed && m_cGameMode == GAMEMODE_ONMAINGAME && !m_bInputStatus) {
if (m_targetNeutral) {
m_targetNeutral = false;
AddEventList(MSG_TARGETNEUTRAL_OFF, 10);
}
else {
m_targetNeutral = true;
AddEventList(MSG_TARGETNEUTRAL_ON, 10);
}
}
break;
case 80://'P'
if ((m_bCtrlPressed == true) && (m_cGameMode == GAMEMODE_ONMAINGAME) && (!m_bInputStatus))
{
if (_tmp_sOwnerType < 7 && (strlen(_tmp_cName) > 0) && (m_iIlusionOwnerH == 0)
&& (strcmp(m_cMCName, m_cPlayerName) != 0) && m_cMCName[0] != '_') {
m_dialogBoxes[32].SetMode(3);
PlaySound('E', 14, 5);
ZeroMemory(m_dialogBoxes[32].cStr, sizeof(m_dialogBoxes[32].cStr));
strcpy(m_dialogBoxes[32].cStr, _tmp_cName);
bSendCommand(MSGID_COMMAND_COMMON, COMMONTYPE_REQUEST_JOINPARTY, 0, 1, 0, 0, _tmp_cName);
}
else {
m_dialogBoxes[32].SetMode(0);
PlaySound('E', 14, 5);
AddEventList(POINT_COMMAND_HANDLER1, 10);
}
}
break;
case 82://'R'
if (m_bCtrlPressed == true && m_cGameMode == GAMEMODE_ONMAINGAME && (!m_bInputStatus))
{
if (m_bRunningMode)
{
m_bRunningMode = false;
AddEventList(NOTIFY_MSG_CONVERT_WALKING_MODE, 10);
}
else
{
m_bRunningMode = true;
AddEventList(NOTIFY_MSG_CONVERT_RUNNING_MODE, 10);
}
}
break;
case 83://'S'
if (m_bCtrlPressed == true && m_cGameMode == GAMEMODE_ONMAINGAME && (!m_bInputStatus))
{
if (m_bMusicStat == true) // Music Off
{
m_bMusicStat = false;
if (m_bSoundFlag)
{
// if (m_pBGM != NULL)
// {
// m_pBGM->bStop();
// delete m_pBGM;
// m_pBGM = NULL;
// }//DIRECTX
}
AddEventList(NOTIFY_MSG_MUSIC_OFF, 10);
break;
}
else if (m_bSoundStat == true)
{
//DIRECTX m_pESound[38]->bStop();
m_bSoundStat = false;
AddEventList(NOTIFY_MSG_SOUND_OFF, 10);
break;
}
else // Music On
{
if (m_bSoundFlag)
{
m_bMusicStat = true;
AddEventList(NOTIFY_MSG_MUSIC_ON, 10);
}
if (m_bSoundFlag)
{
m_bSoundStat = true;
AddEventList(NOTIFY_MSG_SOUND_ON, 10);
}
StartBGM();
}
}
break;
case 84: //'T'
if (m_bCtrlPressed && m_cGameMode == GAMEMODE_ONMAINGAME && (!m_bInputStatus))
{
char tempid[100];
uint8_t onButton = m_dialogBoxes[DIALOG_CHAT].OnButton();
ZeroMemory(tempid, sizeof(tempid));
if (m_bIsDialogEnabled[10] == true && onButton >= 10 && onButton <= 17)
{
CStrTok* pStrTok;
char* token, cBuff[128];
char seps[] = "]: ";
int i = abs(onButton - 17);
if (i + m_dialogBoxes[10].sView >= m_chatDisplay->size()) return;
CMsg* msg = *(m_chatDisplay->rbegin() + m_dialogBoxes[10].sView + i);
if (msg->m_pMsg[0] == ' ') i++;
strcpy(cBuff, msg->m_pMsg);
pStrTok = new CStrTok(cBuff, seps);
token = pStrTok->pGet();
if (cBuff[0] == '[') // Time stamped msg
{
token = pStrTok->pGet();
token = pStrTok->pGet();
token = pStrTok->pGet();
}
if (token != 0) {
wsprintfA(tempid, "/to %s", token);
bSendCommand(MSGID_COMMAND_CHATMSG, 0, 0, 0, 0, 0, tempid);
}
delete pStrTok;
}
else if (_tmp_sOwnerType < 7 && (strlen(_tmp_cName) > 0) && (m_iIlusionOwnerH == 0)
&& ((m_bIsCrusadeMode == false) || _iGetFOE(_tmp_iStatus) >= 0))
{
wsprintfA(tempid, "/to %s", _tmp_cName);
bSendCommand(MSGID_COMMAND_CHATMSG, 0, 0, 0, 0, 0, tempid);
}
else
{
EndInputString();
wsprintfA(m_cChatMsg, "/to ");
//StartInputString(10, 414, sizeof(m_cChatMsg), m_cChatMsg);
StartInputString(10, 530, sizeof(m_cChatMsg), m_cChatMsg); // 800x600 Resolution xRisenx 534 is right / 530 fits?
}
}
break;
// case 107: //'+'
// if(m_bInputStatus == FALSE) m_bZoomMap = TRUE;
// break;
// case 109: //'-'
// if(m_bInputStatus == FALSE) m_bZoomMap = FALSE;
// break;
case VK_F2:
UseShortCut(1);
break;
case VK_F3:
UseShortCut(2);
break;
case VK_INSERT:
if (m_iHP <= 0) return;
if (m_bItemUsingStatus == true)
{
AddEventList(USE_RED_POTION1, 10);
return;
}
if (m_bIsDialogEnabled[27] == true)
{
AddEventList(USE_RED_POTION2, 10);
return;
}
for (i = 0; i < MAXITEMS; i++)
if ((m_pItemList[i] != 0) && (m_bIsItemDisabled[i] != true) &&
(m_pItemList[i]->m_sSprite == 6) && (m_pItemList[i]->m_sSpriteFrame == 1))
{
bSendCommand(MSGID_COMMAND_COMMON, COMMONTYPE_REQ_USEITEM, 0, i, 0, 0, 0);
m_bIsItemDisabled[i] = true;
m_bItemUsingStatus = true;
return;
}
for (i = 0; i < MAXITEMS; i++)
if ((m_pItemList[i] != 0) && (m_bIsItemDisabled[i] != true) &&
(m_pItemList[i]->m_sSprite == 6) && (m_pItemList[i]->m_sSpriteFrame == 2))
{
bSendCommand(MSGID_COMMAND_COMMON, COMMONTYPE_REQ_USEITEM, 0, i, 0, 0, 0);
m_bIsItemDisabled[i] = true;
m_bItemUsingStatus = true;
return;
}
break;
case VK_DELETE:
if (m_iHP <= 0) return;
if (m_bItemUsingStatus == true)
{
AddEventList(USE_BLUE_POTION1, 10);
return;
}
if (m_bIsDialogEnabled[27] == true)
{
AddEventList(USE_BLUE_POTION2, 10);
return;
}
for (i = 0; i < MAXITEMS; i++)
if ((m_pItemList[i] != 0) && (m_bIsItemDisabled[i] != true) &&
(m_pItemList[i]->m_sSprite == 6) && (m_pItemList[i]->m_sSpriteFrame == 3))
{
bSendCommand(MSGID_COMMAND_COMMON, COMMONTYPE_REQ_USEITEM, 0, i, 0, 0, 0);
m_bIsItemDisabled[i] = true;
m_bItemUsingStatus = true;
return;
}
for (i = 0; i < MAXITEMS; i++)
if ((m_pItemList[i] != 0) && (m_bIsItemDisabled[i] != true) &&
(m_pItemList[i]->m_sSprite == 6) && (m_pItemList[i]->m_sSpriteFrame == 4))
{
bSendCommand(MSGID_COMMAND_COMMON, COMMONTYPE_REQ_USEITEM, 0, i, 0, 0, 0);
m_bIsItemDisabled[i] = true;
m_bItemUsingStatus = true;
return;
}
break;
case VK_END:
if (!(m_bIsDialogEnabled[7] && m_dialogBoxes[7].GetMode() == 1 && iGetTopDialogBoxIndex() == 7) &&
!(m_bIsDialogEnabled[17] && m_dialogBoxes[17].GetMode() == 1 && iGetTopDialogBoxIndex() == 17) &&
!(m_bIsDialogEnabled[58] && m_dialogBoxes[58].GetMode() == 1 && iGetTopDialogBoxIndex() == 58) &&
!(m_bIsDialogEnabled[62] && m_dialogBoxes[62].GetMode() == 1 && iGetTopDialogBoxIndex() == 62) &&
!m_bInputStatus && m_cBackupChatMsg[0] != '!' && m_cBackupChatMsg[0] != '~' &&
m_cBackupChatMsg[0] != '^' && m_cBackupChatMsg[0] != '@')
{
ZeroMemory(m_cChatMsg, sizeof(m_cChatMsg));
strcpy(m_cChatMsg, m_cBackupChatMsg);
//StartInputString(10, 414, sizeof(m_cChatMsg), m_cChatMsg);
StartInputString(10, 530, sizeof(m_cChatMsg), m_cChatMsg); // 800x600 Resolution xRisenx 534 is right / 530 fits?
}
break;
case VK_F4:
if (m_cGameMode != GAMEMODE_ONMAINGAME) return;
UseMagic(m_sMagicShortCut);
break;
case VK_F5:
if (m_bIsDialogEnabled[1] == false)
EnableDialogBox(1, 0, 0, 0);
else DisableDialogBox(1);
break;
case VK_F6:
if (m_bIsDialogEnabled[2] == false)
EnableDialogBox(2, 0, 0, 0);
else DisableDialogBox(2);
break;
case VK_F7:
if (m_bIsDialogEnabled[3] == false)
EnableDialogBox(3, 0, 0, 0);
else DisableDialogBox(3);
break;
//#ifdef TitleClient
/*case VK_F8:
if (m_bIsDialogEnabled[63] == FALSE)
EnableDialogBox(63, NULL, NULL, NULL);
else DisableDialogBox(63);
break;*/
//#else
case VK_F8:
if (m_bIsDialogEnabled[15] == false)
EnableDialogBox(15, 0, 0, 0);
else DisableDialogBox(15);
break;
//#endif
case VK_F9:
if (m_bIsDialogEnabled[10] == false)
EnableDialogBox(10, 0, 0, 0);
else DisableDialogBox(10);
break;
case VK_F11:
m_bDialogTrans = !m_bDialogTrans;
break;
case VK_F12:
if (m_bInputStatus) return;
if (m_bIsDialogEnabled[19] == false)
EnableDialogBox(19, 0, 0, 0);
else DisableDialogBox(19);
CreateScreenShot();
break;
case VK_F1:
if (m_bInputStatus) return;
if (m_bIsDialogEnabled[35] == false) // 35 CLEROTH
EnableDialogBox(35, 0, 0, 0);
else
{
DisableDialogBox(35);
DisableDialogBox(18);
}
break;
case VK_UP:
m_cArrowPressed = 1;
if (m_cGameMode == GAMEMODE_ONMAINGAME)
{
int iTotalMsg = 0;
for (int i = MAXWHISPERMSG - 1; i >= 0; i--)
{
if (m_pWhisperMsg[i] != 0)
{
iTotalMsg = i;
break;
}
}
m_cWhisperIndex++;
if (m_cWhisperIndex > iTotalMsg) m_cWhisperIndex = 0;
if (m_cWhisperIndex < 0) m_cWhisperIndex = iTotalMsg;
if (m_pWhisperMsg[m_cWhisperIndex] != 0) {
EndInputString();
wsprintfA(m_cChatMsg, "/to %s", m_pWhisperMsg[m_cWhisperIndex]->m_pMsg);
//StartInputString(10, 414, sizeof(m_cChatMsg), m_cChatMsg);
StartInputString(10, 530, sizeof(m_cChatMsg), m_cChatMsg); // 800x600 Resolution xRisenx 534 is right / 530 fits?
}
}
break;
case VK_RIGHT:
m_cArrowPressed = 2;
break;
case VK_DOWN:
m_cArrowPressed = 3;
if (m_cGameMode == GAMEMODE_ONMAINGAME)
{
int iTotalMsg = 0;
for (int i = MAXWHISPERMSG - 1; i >= 0; i--)
{
if (m_pWhisperMsg[i] != 0)
{
iTotalMsg = i;
break;
}
}
m_cWhisperIndex--;
if (m_cWhisperIndex < 0) m_cWhisperIndex = iTotalMsg;
if (m_cWhisperIndex > iTotalMsg) m_cWhisperIndex = 0;
if (m_pWhisperMsg[m_cWhisperIndex] != 0) {
EndInputString();
wsprintfA(m_cChatMsg, "/to %s", m_pWhisperMsg[m_cWhisperIndex]->m_pMsg);
//StartInputString(10, 414, sizeof(m_cChatMsg), m_cChatMsg);
StartInputString(10, 530, sizeof(m_cChatMsg), m_cChatMsg); // 800x600 Resolution xRisenx 534 is right / 530 fits?
}
}
break;
case VK_LEFT:
m_cArrowPressed = 4;
break;
case VK_SNAPSHOT:
CreateScreenShot();
break;
#ifndef USING_WIN_IME
case VK_TAB:
if (m_bShiftPressed)
{
m_cCurFocus--;
if (m_cCurFocus < 1) m_cCurFocus = m_cMaxFocus;
}
else
{
m_cCurFocus++;
if (m_cCurFocus > m_cMaxFocus) m_cCurFocus = 1;
}
if ((dwTime - dwPrevTabTime) > 500 && m_cGameMode == GAMEMODE_ONMAINGAME)
{
dwPrevTabTime = dwTime;
bSendCommand(MSGID_COMMAND_COMMON, COMMONTYPE_TOGGLECOMBATMODE, 0, 0, 0, 0, 0);
}
break;
case VK_RETURN:
m_bEnterPressed = true;
//if (m_altPressed)
//change screen mode
break;
#endif
case VK_HOME:
if (m_cGameMode == GAMEMODE_ONMAINGAME) {
bSendCommand(MSGID_COMMAND_COMMON, COMMONTYPE_TOGGLESAFEATTACKMODE, 0, 0, 0, 0, 0);
}
break;
case VK_ESCAPE:
m_bEscPressed = true;
if (m_cGameMode == GAMEMODE_ONMAINGAME)
{
if ((m_bIsObserverMode == true) && (m_bShiftPressed))
{ //ObserverMode Shift+Esc
// Log Out
if (m_cLogOutCount == -1) m_cLogOutCount = 1;
DisableDialogBox(19);
PlaySound('E', 14, 5);
}
else if (m_cLogOutCount != -1)
{
if (m_bForceDisconn == false)
{ //Esc
m_cLogOutCount = -1;
AddEventList(DLGBOX_CLICK_SYSMENU2, 10);
}
}
if (m_bIsGetPointingMode == true)
{
m_bIsGetPointingMode = false;
AddEventList(COMMAND_PROCESSOR1, 10);
}
m_bIsF1HelpWindowEnabled = false;
}
if (!clipmousewindow)
{
RECT trect;
GetWindowRect(*(HWND*)&G_hWnd, &trect);
ClipCursor(&trect);
clipmousegame = true;
clipmousewindow = true;
}
else
{
clipmousewindow = clipmousegame = false;
ClipCursor(0);
}
break;
case 33:
if (m_cGameMode != GAMEMODE_ONMAINGAME) return;
if (m_bInputStatus) return;
if (m_bIsSpecialAbilityEnabled == true)
{
if (m_iSpecialAbilityType != 0) {
bSendCommand(MSGID_COMMAND_COMMON, COMMONTYPE_REQUEST_ACTIVATESPECABLTY, 0, 0, 0, 0, 0);
m_bIsSpecialAbilityEnabled = false;
}
else AddEventList(ON_KEY_UP26, 10);
}
else {
if (m_iSpecialAbilityType == 0) AddEventList(ON_KEY_UP26, 10);
else {
if ((m_sPlayerAppr4 & 0x00F0) != 0) {
AddEventList(ON_KEY_UP28, 10);
return;
}
i = (dwTime - m_dwSpecialAbilitySettingTime) / 1000;
i = m_iSpecialAbilityTimeLeftSec - i;
if (i < 0) i = 0;
ZeroMemory(G_cTxt, sizeof(G_cTxt));
if (i < 60) {
switch (m_iSpecialAbilityType) {
case 1: wsprintfA(G_cTxt, ON_KEY_UP29, i); break;//"
case 2: wsprintfA(G_cTxt, ON_KEY_UP30, i); break;//"
case 3: wsprintfA(G_cTxt, ON_KEY_UP31, i); break;//"
case 4: wsprintfA(G_cTxt, ON_KEY_UP32, i); break;//"
case 5: wsprintfA(G_cTxt, ON_KEY_UP33, i); break;//"
case 50:wsprintfA(G_cTxt, ON_KEY_UP34, i); break;//"
case 51:wsprintfA(G_cTxt, ON_KEY_UP35, i); break;//"
case 52:wsprintfA(G_cTxt, ON_KEY_UP36, i); break;//"
}
}
else {
switch (m_iSpecialAbilityType) {
case 1: wsprintfA(G_cTxt, ON_KEY_UP37, i / 60); break;//"
case 2: wsprintfA(G_cTxt, ON_KEY_UP38, i / 60); break;//"
case 3: wsprintfA(G_cTxt, ON_KEY_UP39, i / 60); break;//"
case 4: wsprintfA(G_cTxt, ON_KEY_UP40, i / 60); break;//"
case 5: wsprintfA(G_cTxt, ON_KEY_UP41, i / 60); break;//"
case 50:wsprintfA(G_cTxt, ON_KEY_UP42, i / 60); break;//"
case 51:wsprintfA(G_cTxt, ON_KEY_UP43, i / 60); break;//"
case 52:wsprintfA(G_cTxt, ON_KEY_UP44, i / 60); break;//"
}
}
AddEventList(G_cTxt, 10);
}
}
break;
}
}
void CGame::OnKeyDown(WPARAM wParam)
{
switch (wParam) {
case VK_CONTROL:
case 162://temporary
m_bCtrlPressed = true;
break;
case VK_SHIFT:
case 160://temporary (irrlicht shift code)
m_bShiftPressed = true;
break;
case VK_INSERT:
case VK_DELETE:
break;
case VK_TAB:
{
/*if (m_cGameMode == GAMEMODE_ONMAINMENU)
{
WindowManager& wmgr = WindowManager::getSingleton();
Window* myRoot;
myRoot = System::getSingleton().getDefaultGUIContext().getRootWindow();
Window* login = myRoot->getChild("login")->getChild("loginchild");
Window* active = login->getActiveChild();
if (active)
{
if (active->getName() == CEGUI::String("username"))
login->getChild("password")->activate();
else if (active->getName() == CEGUI::String("password"))
login->getChild("username")->activate();
}
}*/
}
break;
case VK_RETURN:
case VK_ESCAPE:
case VK_END:
case VK_HOME:
break;
case VK_F1:
{
/*WindowManager& wmgr = WindowManager::getSingleton();
Window* myRoot;
myRoot = System::getSingleton().getDefaultGUIContext().getRootWindow();
if (ui.testchat == nullptr)
{
ui.testchat = wmgr.loadLayoutFromFile("testchat.layout");
myRoot->addChild(ui.testchat);
Window* enter = ui.testchat->getChild("enter");
enter->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::SubscriberSlot(&CGame::UITestChat, this));
}*/
//myRoot->destroyChild("selectcharacter");
//ui.selectcharacter = wmgr.loadLayoutFromFile("selectcharacter.layout");
//myRoot->addChild(ui.selectcharacter);
//Window * entergame = ui.selectcharacter->getChild("entergame");
//entergame->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::SubscriberSlot(&CGame::UIEnterGame, this));
}
break;
case VK_F2:
case VK_F3:
case VK_F4:
case VK_F5:
case VK_F6:
case VK_F7:
case VK_F8:
case VK_F9:
case VK_F10:
case VK_F11:
case VK_F12:
case VK_PRIOR: // Page-Up
case VK_NEXT: // Page-Down
case VK_LWIN:
case VK_RWIN:
case VK_MULTIPLY:
case VK_ADD: //'+'
case VK_SEPARATOR:
case VK_SUBTRACT: //'-'
case VK_DECIMAL:
case VK_DIVIDE:
case VK_NUMLOCK:
case VK_SCROLL:
break;
default:
if (m_cGameMode == GAMEMODE_ONMAINGAME)
{
if (m_bCtrlPressed)
{
switch (wParam) {
case 48: EnableDialogBox(3, 0, 0, 0); m_dialogBoxes[3].sView = 9; break; // 0
case 49: EnableDialogBox(3, 0, 0, 0); m_dialogBoxes[3].sView = 0; break; // 1
case 50: EnableDialogBox(3, 0, 0, 0); m_dialogBoxes[3].sView = 1; break; // 2
case 51: EnableDialogBox(3, 0, 0, 0); m_dialogBoxes[3].sView = 2; break; // 3
case 52: EnableDialogBox(3, 0, 0, 0); m_dialogBoxes[3].sView = 3; break; // 4
case 53: EnableDialogBox(3, 0, 0, 0); m_dialogBoxes[3].sView = 4; break; // 5
case 54: EnableDialogBox(3, 0, 0, 0); m_dialogBoxes[3].sView = 5; break; // 6
case 55: EnableDialogBox(3, 0, 0, 0); m_dialogBoxes[3].sView = 6; break; // 7
case 56: EnableDialogBox(3, 0, 0, 0); m_dialogBoxes[3].sView = 7; break; // 8
case 57: EnableDialogBox(3, 0, 0, 0); m_dialogBoxes[3].sView = 8; break; // 9
}
}
else if ((m_bInputStatus == false) && (GetAsyncKeyState(VK_MENU) >> 15 == false))
{ //StartInputString(10, 414, sizeof(m_cChatMsg), m_cChatMsg);
StartInputString(10, 530, sizeof(m_cChatMsg), m_cChatMsg); // 800x600 Resolution xRisenx 534 is right / 530 fits?
ClearInputString();
}
}
break;
}
// if (m_pInputBuffer == NULL) return;
// if(wParam == 8)
// {
// if(strlen(m_pInputBuffer) > 0)
// {
// int len = strlen(m_pInputBuffer);
//
// switch (GetCharKind(m_pInputBuffer, len-1))
// {
// case 1:
// m_pInputBuffer[len-1] = NULL;
// break;
// case 2:
// case 3:
// m_pInputBuffer[len-2] = NULL;
// m_pInputBuffer[len-1] = NULL;
// break;
// }
// ZeroMemory(m_cEdit, sizeof(m_cEdit));
// }
// }
// else if ((wParam != 9) && (wParam != 13) && (wParam != 27)) {
// int len = strlen(m_pInputBuffer);
// if (len >= m_inputMaxLen-1) return;
// m_pInputBuffer[len] = wParam & 0xff;
// m_pInputBuffer[len+1] = 0;
// }
}