/
hu_menu.c
4085 lines (3588 loc) · 107 KB
/
hu_menu.c
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
/**\file
*\section License
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
*
*\author Copyright © 2005-2010 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2005-2010 Daniel Swanson <danij@dengine.net>
*\author Copyright © 2006 Jamie Jones <jamie_jones_au@yahoo.com.au>
*\author Copyright © 1993-1996 by id Software, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
/**
* hu_menu.c: Common selection menu, options, episode etc.
* Sliders and icons. Kinda widget stuff.
*/
// HEADER FILES ------------------------------------------------------------
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#if __JDOOM__
# include "jdoom.h"
#elif __JDOOM64__
# include "jdoom64.h"
#elif __JHERETIC__
# include "jheretic.h"
#elif __JHEXEN__
# include "jhexen.h"
#endif
#include "m_argv.h"
#include "hu_log.h"
#include "hu_msg.h"
#include "hu_stuff.h"
#include "f_infine.h"
#include "am_map.h"
#include "x_hair.h"
#include "p_player.h"
#include "g_controls.h"
#include "p_saveg.h"
#include "g_common.h"
#include "hu_menu.h"
#include "r_common.h"
// MACROS ------------------------------------------------------------------
// TYPES -------------------------------------------------------------------
typedef struct rgba_s {
float *r, *g, *b, *a;
} rgba_t;
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
extern void Ed_MakeCursorVisible(void);
void M_InitControlsMenu(void);
void M_ControlGrabDrawer(void);
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
void M_NewGame(int option, void* context);
void M_Episode(int option, void* context); // Does nothing in jHEXEN
void M_ChooseClass(int option, void* context); // Does something only in jHEXEN
void M_ChooseSkill(int option, void* context);
void M_LoadGame(int option, void* context);
void M_SaveGame(int option, void* context);
void M_GameFiles(int option, void* context); // Does nothing in jDOOM
void M_EndGame(int option, void* context);
#if __JDOOM__ || __JHERETIC__ || __JHEXEN__
void M_ReadThis(int option, void* context);
#endif
void M_QuitDOOM(int option, void* context);
void M_OpenDCP(int option, void* context);
void M_ChangeMessages(int option, void* context);
void M_SizeMessages(int option, void* context);
void M_HUDHideTime(int option, void* context);
void M_MessageUptime(int option, void* context);
#if __JHERETIC__ || __JHEXEN__
void M_InventoryHideTime(int option, void* context);
void M_InventorySlotMaxVis(int option, void* context);
#endif
void M_WeaponAutoSwitch(int option, void* context);
void M_AmmoAutoSwitch(int option, void* context);
void M_HUDInfo(int option, void* context);
void M_HUDScale(int option, void* context);
void M_HUDInOffsetScale(int option, void* context);
void M_HUDCheatCounterScale(int option, void* context);
void M_SfxVol(int option, void* context);
void M_WeaponOrder(int option, void* context);
void M_MusicVol(int option, void* context);
void M_SizeDisplay(int option, void* context);
#if !__JDOOM64__
void M_SizeStatusBar(int option, void* context);
void M_StatusBarOpacity(int option, void* context);
#endif
void M_HUDRed(int option, void* context);
void M_HUDGreen(int option, void* context);
void M_HUDBlue(int option, void* context);
void M_LoadSelect(int option, void* context);
void M_SaveSelect(int option, void* context);
void M_Xhair(int option, void* context);
void M_XhairSize(int option, void* context);
void M_XhairOpacity(int option, void* context);
#if __JDOOM__ || __JDOOM64__ || __JHERETIC__
void M_KillCounter(int option, void* data);
void M_ItemCounter(int option, void* data);
void M_SecretCounter(int option, void* data);
#endif
static void M_QuickSave(void);
static void M_QuickLoad(void);
#if __JDOOM64__
void M_WeaponRecoil(int option, void* context);
#endif
void M_DrawMainMenu(void);
void M_DrawNewGameMenu(void);
void M_DrawSkillMenu(void);
void M_DrawClassMenu(void); // Does something only in jHEXEN
void M_DrawEpisode(void); // Does nothing in jHEXEN
void M_DrawOptions(void);
void M_DrawOptions2(void);
void M_DrawGameplay(void);
void M_DrawHUDMenu(void);
#if __JHERETIC__ || __JHEXEN__
void M_DrawInventoryMenu(void);
#endif
void M_DrawMapMenu(void);
void M_DrawWeaponMenu(void);
void M_DrawLoad(void);
void M_DrawSave(void);
void M_DrawFilesMenu(void);
// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
// EXTERNAL DATA DECLARATIONS ----------------------------------------------
extern editfield_t* ActiveEdit;
extern char* weaponNames[];
extern menu_t ControlsDef;
// PUBLIC DATA DEFINITIONS -------------------------------------------------
#if __JDOOM__ || __JDOOM64__
/// The end message strings will be initialized in Hu_MenuInit().
char* endmsg[NUM_QUITMESSAGES + 1];
#endif
menu_t* currentMenu;
// -1 = no quicksave slot picked!
int quickSaveSlot;
char tempstring[80];
// Old save description before edit.
char saveOldString[HU_SAVESTRINGSIZE+1];
char savegamestrings[10][HU_SAVESTRINGSIZE+1];
// We are going to be entering a savegame string.
int saveStringEnter;
int saveSlot; // Which slot to save in.
int saveCharIndex; // Which char we're editing.
char endstring[160];
static char* yesno[2] = {"NO", "YES"};
#if __JDOOM__ || __JHERETIC__
int epi;
#endif
int menu_color = 0;
float skull_angle = 0;
int frame; // Used by any graphic animations that need to be pumped.
int menuTime;
short itemOn; // Menu item skull is on.
short previtemOn; // Menu item skull was last on (for restoring when leaving widget control).
short skullAnimCounter; // Skull animation counter.
short whichSkull; // Which skull to draw.
// PRIVATE DATA DEFINITIONS ------------------------------------------------
static boolean menuActive = false;
static float menuAlpha = 0; // Alpha level for the entire menu.
static float menuTargetAlpha = 0; // Target alpha for the entire UI.
#if __JHERETIC__
static patchinfo_t dpRotatingSkull[18];
#elif __JHEXEN__
static patchinfo_t dpBullWithFire[8];
#endif
static int cursors = NUMCURSORS;
static patchinfo_t cursorst[NUMCURSORS];
#if __JHEXEN__
static int MenuPClass;
#endif
static rgba_t widgetcolors[] = { // Ptrs to colors editable with the colour widget
{ &cfg.automapL0[0], &cfg.automapL0[1], &cfg.automapL0[2], NULL },
{ &cfg.automapL1[0], &cfg.automapL1[1], &cfg.automapL1[2], NULL },
{ &cfg.automapL2[0], &cfg.automapL2[1], &cfg.automapL2[2], NULL },
{ &cfg.automapL3[0], &cfg.automapL3[1], &cfg.automapL3[2], NULL },
{ &cfg.automapBack[0], &cfg.automapBack[1], &cfg.automapBack[2], NULL },
{ &cfg.hudColor[0], &cfg.hudColor[1], &cfg.hudColor[2], &cfg.hudColor[3] },
{ &cfg.automapMobj[0], &cfg.automapMobj[1], &cfg.automapMobj[2], NULL },
{ &cfg.xhairColor[0], &cfg.xhairColor[1], &cfg.xhairColor[2], NULL }
};
static boolean widgetEdit = false; // No active widget by default.
static boolean rgba = false; // Used to swap between rgb / rgba modes for the color widget.
static int editcolorindex = 0; // The index of the widgetcolors array of the item being currently edited.
static float currentcolor[4] = {0, 0, 0, 0}; // Used by the widget as temporay values.
// Used to fade out the background a little when a widget is active.
static float menu_calpha = 0;
static int quicksave;
static int quickload;
static char notDesignedForMessage[80];
#if __JDOOM__ || __JDOOM64__
static patchinfo_t m_doom;
static patchinfo_t m_newg;
static patchinfo_t m_skill;
static patchinfo_t m_episod;
static patchinfo_t m_ngame;
static patchinfo_t m_option;
static patchinfo_t m_loadg;
static patchinfo_t m_saveg;
static patchinfo_t m_rdthis;
static patchinfo_t m_quitg;
static patchinfo_t m_optttl;
static patchinfo_t dpLSLeft;
static patchinfo_t dpLSRight;
static patchinfo_t dpLSCntr;
#endif
#if __JHERETIC__ || __JHEXEN__
static patchinfo_t m_htic;
static patchinfo_t dpFSlot;
#endif
#if __JHEXEN__
static patchinfo_t dpPlayerClassBG[3];
#endif
#if __JHERETIC__ || __JHEXEN__
# define READTHISID 3
#elif !__JDOOM64__
# define READTHISID 4
#endif
menuitem_t MainItems[] = {
#if __JDOOM__
{ITT_SETMENU, 0, "{case}New Game", NULL, MENU_NEWGAME, &m_ngame.id},
{ITT_SETMENU, 0, "{case}Options", NULL, MENU_OPTIONS, &m_option.id},
{ITT_EFUNC, 0, "{case}Load game", M_LoadGame, 0, &m_loadg.id},
{ITT_EFUNC, 0, "{case}Save game", M_SaveGame, 0, &m_saveg.id},
{ITT_EFUNC, 0, "{case}Read This!", M_ReadThis, 0, &m_rdthis.id},
{ITT_EFUNC, 0, "{case}Quit Game", M_QuitDOOM, 0, &m_quitg.id}
#elif __JDOOM64__
{ITT_SETMENU, 0, "{case}New Game", NULL, MENU_NEWGAME},
{ITT_SETMENU, 0, "{case}Options", NULL, MENU_OPTIONS},
{ITT_EFUNC, 0, "{case}Load Game", M_LoadGame, 0},
{ITT_EFUNC, 0, "{case}Save Game", M_SaveGame, 0},
{ITT_EFUNC, 0, "{case}Quit Game", M_QuitDOOM, 0}
#else
{ITT_SETMENU, 0, "new game", NULL, MENU_NEWGAME},
{ITT_SETMENU, 0, "options", NULL, MENU_OPTIONS},
{ITT_SETMENU, 0, "game files", NULL, MENU_FILES},
{ITT_EFUNC, 0, "info", M_ReadThis, 0},
{ITT_EFUNC, 0, "quit game", M_QuitDOOM, 0}
#endif
};
menu_t MainDef = {
#if __JHEXEN__
0,
110, 50,
M_DrawMainMenu,
5, MainItems,
0, MENU_NONE,
GF_FONTB,
cfg.menuColor,
LINEHEIGHT_B,
0, 5
#elif __JHERETIC__
0,
110, 56,
M_DrawMainMenu,
5, MainItems,
0, MENU_NONE,
GF_FONTB,
cfg.menuColor,
LINEHEIGHT_B,
0, 5
#elif __JDOOM64__
0,
97, 64,
M_DrawMainMenu,
5, MainItems,
0, MENU_NONE,
GF_FONTB,
cfg.menuColor,
LINEHEIGHT_B + 1,
0, 5
#else
0,
97, 64,
M_DrawMainMenu,
6, MainItems,
0, MENU_NONE,
GF_FONTB,
cfg.menuColor,
LINEHEIGHT_B + 1,
0, 6
#endif
};
menuitem_t NewGameItems[] = {
{ITT_EFUNC, 0, "S", M_NewGame, 0},
{ITT_EFUNC, 0, "M", SCEnterMultiplayerMenu, 0}
};
menu_t NewGameDef = {
#if __JHEXEN__
0,
110, 50,
M_DrawNewGameMenu,
2, NewGameItems,
0, MENU_MAIN,
GF_FONTB,
cfg.menuColor,
LINEHEIGHT_B,
0, 2
#elif __JHERETIC__
0,
110, 64,
M_DrawNewGameMenu,
2, NewGameItems,
0, MENU_MAIN,
GF_FONTB,
cfg.menuColor,
LINEHEIGHT_B,
0, 2
#elif __JDOOM64__
0,
97, 64,
M_DrawNewGameMenu,
2, NewGameItems,
0, MENU_MAIN,
GF_FONTB,
cfg.menuColor,
LINEHEIGHT_B + 1,
0, 2
#else
0,
97, 64,
M_DrawNewGameMenu,
2, NewGameItems,
0, MENU_MAIN,
GF_FONTB,
cfg.menuColor,
LINEHEIGHT_B + 1,
0, 2
#endif
};
#if __JHEXEN__
static menuitem_t* ClassItems;
menu_t ClassDef = {
0,
66, 66,
M_DrawClassMenu,
0, NULL,
0, MENU_NEWGAME,
GF_FONTB,
cfg.menuColor,
LINEHEIGHT_B + 1,
0, 0
};
#endif
#if __JDOOM__ || __JHERETIC__
static menuitem_t* EpisodeItems;
#endif
#if __JDOOM__ || __JHERETIC__
menu_t EpiDef = {
0,
48,
# if __JDOOM__
63,
# else
50,
# endif
M_DrawEpisode,
0, NULL,
0, MENU_NEWGAME,
GF_FONTB,
cfg.menuColor,
LINEHEIGHT + 1,
0, 0
};
#endif
#if __JHERETIC__ || __JHEXEN__
static menuitem_t FilesItems[] = {
{ITT_EFUNC, 0, "load game", M_LoadGame, 0},
{ITT_EFUNC, 0, "save game", M_SaveGame, 0}
};
static menu_t FilesMenu = {
0,
110, 60,
M_DrawFilesMenu,
2, FilesItems,
0, MENU_MAIN,
GF_FONTB,
cfg.menuColor,
LINEHEIGHT + 1,
0, 2
};
#endif
static menuitem_t LoadItems[] = {
{ITT_EFUNC, 0, NULL, M_LoadSelect, 0},
{ITT_EFUNC, 0, NULL, M_LoadSelect, 1},
{ITT_EFUNC, 0, NULL, M_LoadSelect, 2},
{ITT_EFUNC, 0, NULL, M_LoadSelect, 3},
{ITT_EFUNC, 0, NULL, M_LoadSelect, 4},
{ITT_EFUNC, 0, NULL, M_LoadSelect, 5},
#if __JDOOM__ || __JHERETIC__ || __JDOOM64__
{ITT_EFUNC, 0, NULL, M_LoadSelect, 6},
{ITT_EFUNC, 0, NULL, M_LoadSelect, 7}
#endif
};
static menu_t LoadDef = {
0,
#if __JDOOM__ || __JDOOM64__
80, 44,
#else
80, 30,
#endif
M_DrawLoad,
NUMSAVESLOTS, LoadItems,
0, MENU_MAIN,
GF_FONTA,
cfg.menuColor2,
LINEHEIGHT_A + 8,
0, NUMSAVESLOTS
};
static menuitem_t SaveItems[] = {
{ITT_EFUNC, 0, NULL, M_SaveSelect, 0},
{ITT_EFUNC, 0, NULL, M_SaveSelect, 1},
{ITT_EFUNC, 0, NULL, M_SaveSelect, 2},
{ITT_EFUNC, 0, NULL, M_SaveSelect, 3},
{ITT_EFUNC, 0, NULL, M_SaveSelect, 4},
{ITT_EFUNC, 0, NULL, M_SaveSelect, 5},
#if __JDOOM__ || __JHERETIC__ || __JDOOM64__
{ITT_EFUNC, 0, NULL, M_SaveSelect, 6},
{ITT_EFUNC, 0, NULL, M_SaveSelect, 7}
#endif
};
static menu_t SaveDef = {
0,
#if __JDOOM__ || __JDOOM64__
80, 44,
#else
80, 30,
#endif
M_DrawSave,
NUMSAVESLOTS, SaveItems,
0, MENU_MAIN,
GF_FONTA,
cfg.menuColor2,
LINEHEIGHT_A + 8,
0, NUMSAVESLOTS
};
#if __JHEXEN__
static menuitem_t SkillItems[] = {
{ITT_EFUNC, 0, NULL, M_ChooseSkill, SM_BABY},
{ITT_EFUNC, 0, NULL, M_ChooseSkill, SM_EASY},
{ITT_EFUNC, 0, NULL, M_ChooseSkill, SM_MEDIUM},
{ITT_EFUNC, 0, NULL, M_ChooseSkill, SM_HARD},
{ITT_EFUNC, 0, NULL, M_ChooseSkill, SM_NIGHTMARE}
};
static menu_t SkillDef = {
0,
120, 44,
M_DrawSkillMenu,
5, SkillItems,
2, MENU_CLASS,
GF_FONTB,
cfg.menuColor,
LINEHEIGHT,
0, 5
};
#elif __JHERETIC__
static menuitem_t SkillItems[] = {
{ITT_EFUNC, 0, "W", M_ChooseSkill, SM_BABY},
{ITT_EFUNC, 0, "Y", M_ChooseSkill, SM_EASY},
{ITT_EFUNC, 0, "B", M_ChooseSkill, SM_MEDIUM},
{ITT_EFUNC, 0, "S", M_ChooseSkill, SM_HARD},
{ITT_EFUNC, 0, "P", M_ChooseSkill, SM_NIGHTMARE}
};
static menu_t SkillDef = {
0,
38, 30,
M_DrawSkillMenu,
5, SkillItems,
2, MENU_EPISODE,
GF_FONTB,
cfg.menuColor,
LINEHEIGHT,
0, 5
};
#elif __JDOOM64__
static menuitem_t SkillItems[] = {
{ITT_EFUNC, 0, "I", M_ChooseSkill, 0, &skillModeNames[0]},
{ITT_EFUNC, 0, "H", M_ChooseSkill, 1, &skillModeNames[1]},
{ITT_EFUNC, 0, "H", M_ChooseSkill, 2, &skillModeNames[2]},
{ITT_EFUNC, 0, "U", M_ChooseSkill, 3, &skillModeNames[3]},
};
static menu_t SkillDef = {
0,
48, 63,
M_DrawSkillMenu,
4, SkillItems,
2, MENU_NEWGAME,
GF_FONTB,
cfg.menuColor,
LINEHEIGHT,
0, 4
};
#else
static menuitem_t SkillItems[] = {
// Text defs TXT_SKILL1..5.
{ITT_EFUNC, 0, "I", M_ChooseSkill, 0, &skillModeNames[0]},
{ITT_EFUNC, 0, "H", M_ChooseSkill, 1, &skillModeNames[1]},
{ITT_EFUNC, 0, "H", M_ChooseSkill, 2, &skillModeNames[2]},
{ITT_EFUNC, 0, "U", M_ChooseSkill, 3, &skillModeNames[3]},
{ITT_EFUNC, MIF_NOTALTTXT, "N", M_ChooseSkill, 4, &skillModeNames[4]}
};
static menu_t SkillDef = {
0,
48, 63,
M_DrawSkillMenu,
5, SkillItems,
2, MENU_EPISODE,
GF_FONTB,
cfg.menuColor,
LINEHEIGHT,
0, 5
};
#endif
static menuitem_t OptionsItems[] = {
{ITT_EFUNC, 0, "end game", M_EndGame, 0},
{ITT_EFUNC, 0, "control panel", M_OpenDCP, 0},
{ITT_SETMENU, 0, "controls", NULL, MENU_CONTROLS},
{ITT_SETMENU, 0, "gameplay", NULL, MENU_GAMEPLAY},
{ITT_SETMENU, 0, "hud", NULL, MENU_HUD},
{ITT_SETMENU, 0, "automap", NULL, MENU_MAP},
{ITT_SETMENU, 0, "weapons", NULL, MENU_WEAPONS},
#if __JHERETIC__ || __JHEXEN__
{ITT_SETMENU, 0, "inventory", NULL, MENU_INVENTORY},
#endif
{ITT_SETMENU, 0, "sound", NULL, MENU_OPTIONS2},
{ITT_EFUNC, 0, "mouse", M_OpenDCP, 2},
{ITT_EFUNC, 0, "joystick", M_OpenDCP, 2}
};
static menu_t OptionsDef = {
0,
110, 63,
M_DrawOptions,
#if __JHERETIC__ || __JHEXEN__
11,
#else
10,
#endif
OptionsItems,
0, MENU_MAIN,
GF_FONTA,
cfg.menuColor2,
LINEHEIGHT_A,
0,
#if __JHERETIC__ || __JHEXEN__
11
#else
10
#endif
};
static menuitem_t Options2Items[] = {
{ITT_LRFUNC, 0, "SFX VOLUME :", M_SfxVol, 0},
#if __JHERETIC__ || __JHEXEN__
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
#endif
{ITT_LRFUNC, 0, "MUSIC VOLUME :", M_MusicVol, 0},
#if __JHERETIC__ || __JHEXEN__
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
#endif
{ITT_EFUNC, 0, "OPEN AUDIO PANEL", M_OpenDCP, 1},
};
static menu_t Options2Def = {
0,
#if __JHEXEN__
70, 25,
#elif __JHERETIC__
70, 30,
#elif __JDOOM__ || __JDOOM64__
70, 40,
#endif
M_DrawOptions2,
#if __JDOOM__ || __JDOOM64__
3, Options2Items,
#else
7, Options2Items,
#endif
0, MENU_OPTIONS,
GF_FONTA,
cfg.menuColor2,
LINEHEIGHT_A,
#if __JDOOM__ || __JDOOM64__
0, 3
#else
0, 7
#endif
};
static menuitem_t HUDItems[] = {
{ITT_LRFUNC, 0, "View size :", M_SizeDisplay, 0},
#if __JHERETIC__ || __JHEXEN__
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
#endif
{ITT_LRFUNC, 0, "Wide Offset :", M_HUDInOffsetScale, 0},
#if __JHERETIC__ || __JHEXEN__
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
#endif
#if __JDOOM__
{ITT_EFUNC, 0, "Single key display :", M_ToggleVar, 0, NULL, "hud-keys-combine"},
#endif
{ITT_LRFUNC, 0, "Auto-hide :", M_HUDHideTime, 0},
{ITT_EMPTY, 0, "Un-hide events", NULL, 0},
{ITT_EFUNC, 0, "Receive damage :", M_ToggleVar, 0, NULL, "hud-unhide-damage"},
{ITT_EFUNC, 0, "Pickup health :", M_ToggleVar, 0, NULL, "hud-unhide-pickup-health"},
{ITT_EFUNC, 0, "Pickup armor :", M_ToggleVar, 0, NULL, "hud-unhide-pickup-armor"},
{ITT_EFUNC, 0, "Pickup powerup :", M_ToggleVar, 0, NULL, "hud-unhide-pickup-powerup"},
{ITT_EFUNC, 0, "Pickup weapon :", M_ToggleVar, 0, NULL, "hud-unhide-pickup-weapon"},
#if __JHEXEN__
{ITT_EFUNC, 0, "Pickup mana :", M_ToggleVar, 0, NULL, "hud-unhide-pickup-ammo"},
#else
{ITT_EFUNC, 0, "Pickup ammo :", M_ToggleVar, 0, NULL, "hud-unhide-pickup-ammo"},
#endif
{ITT_EFUNC, 0, "Pickup key :", M_ToggleVar, 0, NULL, "hud-unhide-pickup-key"},
#if __JHERETIC__ || __JHEXEN__
{ITT_EFUNC, 0, "Pickup item :", M_ToggleVar, 0, NULL, "hud-unhide-pickup-invitem"},
#endif
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, "Messages", NULL, 0},
{ITT_EFUNC, 0, "Shown :", M_ChangeMessages, 0},
{ITT_LRFUNC, 0, "Size :", M_SizeMessages, 0},
#if __JHERETIC__ || __JHEXEN__
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
#endif
{ITT_LRFUNC, 0, "Uptime :", M_MessageUptime, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, "Crosshair", NULL, 0},
{ITT_LRFUNC, 0, "Symbol :", M_Xhair, 0},
{ITT_LRFUNC, 0, "Size :", M_XhairSize, 0},
#if __JHERETIC__ || __JHEXEN__
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
#endif
{ITT_LRFUNC, 0, "Opacity :", M_XhairOpacity, 0},
#if __JHERETIC__ || __JHEXEN__
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
#endif
{ITT_EFUNC, 0, "Vitality color :", M_ToggleVar, 0, NULL, "view-cross-vitality"},
{ITT_EFUNC, 0, " color", SCColorWidget, 7 },
#if __JDOOM__ || __JHERETIC__ || __JHEXEN__
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, "Status bar", NULL, 0},
{ITT_LRFUNC, 0, "Size :", M_SizeStatusBar, 0},
# if __JHERETIC__ || __JHEXEN__
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
# endif
{ITT_LRFUNC, 0, "Opacity :", M_StatusBarOpacity, 0},
# if __JHERETIC__ || __JHEXEN__
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
# endif
#endif
{ITT_EMPTY, 0, NULL, NULL, 0},
#if __JDOOM__ || __JDOOM64__ || __JHERETIC__
{ITT_EMPTY, 0, "Counters", NULL, 0 },
{ITT_LRFUNC, 0, "Kills :", M_KillCounter, 0 },
{ITT_LRFUNC, 0, "Items :", M_ItemCounter, 0 },
{ITT_LRFUNC, 0, "Secrets :", M_SecretCounter, 0 },
{ITT_LRFUNC, 0, "Size :", M_HUDCheatCounterScale, 0},
#if __JHERETIC__
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
#endif
#endif
#if __JDOOM__ || __JDOOM64__ || __JHERETIC__
{ITT_EMPTY, 0, NULL, NULL, 0},
#endif
{ITT_EMPTY, 0, "Fullscreen HUD", NULL, 0},
{ITT_LRFUNC, 0, "Size :", M_HUDScale, 0},
#if __JHERETIC__ || __JHEXEN__
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
#endif
{ITT_EFUNC, 0, " text color", SCColorWidget, 5},
#if __JHEXEN__
{ITT_EFUNC, 0, "Show mana :", M_ToggleVar, 0, NULL, "hud-mana" },
#endif
#if __JDOOM__ || __JDOOM64__ || __JHERETIC__
{ITT_EFUNC, 0, "Show ammo :", M_ToggleVar, 0, NULL, "hud-ammo" },
{ITT_EFUNC, 0, "Show armor :", M_ToggleVar, 0, NULL, "hud-armor" },
#endif
#if __JDOOM64__
{ITT_EFUNC, 0, "Show power keys :", M_ToggleVar, 0, NULL, "hud-power" },
#endif
#if __JDOOM__
{ITT_EFUNC, 0, "Show face :", M_ToggleVar, 0, NULL, "hud-face"},
#endif
{ITT_EFUNC, 0, "Show health :", M_ToggleVar, 0, NULL, "hud-health"},
#if __JDOOM__ || __JDOOM64__ || __JHERETIC__
{ITT_EFUNC, 0, "Show keys :", M_ToggleVar, 0, NULL, "hud-keys"},
#endif
#if __JHERETIC__ || __JHEXEN__
{ITT_EFUNC, 0, "Show item :", M_ToggleVar, 0, NULL, "hud-currentitem" },
#endif
};
static menu_t HUDDef = {
0,
#if __JDOOM__ || __JDOOM64__
80, 40,
#else
80, 28,
#endif
M_DrawHUDMenu,
#if __JHEXEN__
51, HUDItems,
#elif __JHERETIC__
61, HUDItems,
#elif __JDOOM64__
39, HUDItems,
#elif __JDOOM__
43, HUDItems,
#endif
0, MENU_OPTIONS,
GF_FONTA,
cfg.menuColor2,
LINEHEIGHT_A,
#if __JHEXEN__
0, 15 // 21
#elif __JHERETIC__
0, 15 // 23
#elif __JDOOM64__
0, 19
#elif __JDOOM__
0, 19
#endif
};
#if __JHERETIC__ || __JHEXEN__
static menuitem_t InventoryItems[] = {
{ITT_EFUNC, 0, "Select mode : ", M_ToggleVar, 0, NULL, "ctl-inventory-mode"},
{ITT_EFUNC, 0, "Wrap around :", M_ToggleVar, 0, NULL, "ctl-inventory-wrap"},
{ITT_EFUNC, 0, "Choose and use :", M_ToggleVar, 0, NULL, "ctl-inventory-use-immediate"},
{ITT_EFUNC, 0, "Select next if use failed :", M_ToggleVar, 0, NULL, "ctl-inventory-use-next"},
{ITT_LRFUNC, 0, "Auto-hide :", M_InventoryHideTime, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, "Full-screen HUD", NULL, 0},
{ITT_LRFUNC, 0, "Max visible slots :", M_InventorySlotMaxVis, 0, NULL, "hud-inventory-slot-max"},
{ITT_EFUNC, 0, "Show empty slots :", M_ToggleVar, 0, NULL, "hud-inventory-slot-showempty"}
};
static menu_t InventoryDef = {
0,
78, 48,
M_DrawInventoryMenu,
9, InventoryItems,
0, MENU_OPTIONS,
GF_FONTA,
cfg.menuColor2,
LINEHEIGHT_A,
0, 9
};
#endif
static menuitem_t WeaponItems[] = {
{ITT_EMPTY, 0, "Priority order", NULL, 0},
{ITT_LRFUNC, 0, "1 :", M_WeaponOrder, 0 << NUM_WEAPON_TYPES },
{ITT_LRFUNC, 0, "2 :", M_WeaponOrder, 1 << NUM_WEAPON_TYPES },
{ITT_LRFUNC, 0, "3 :", M_WeaponOrder, 2 << NUM_WEAPON_TYPES },
{ITT_LRFUNC, 0, "4 :", M_WeaponOrder, 3 << NUM_WEAPON_TYPES },
#if !__JHEXEN__
{ITT_LRFUNC, 0, "5 :", M_WeaponOrder, 4 << NUM_WEAPON_TYPES },
{ITT_LRFUNC, 0, "6 :", M_WeaponOrder, 5 << NUM_WEAPON_TYPES },
{ITT_LRFUNC, 0, "7 :", M_WeaponOrder, 6 << NUM_WEAPON_TYPES },
{ITT_LRFUNC, 0, "8 :", M_WeaponOrder, 7 << NUM_WEAPON_TYPES },
#endif
#if __JDOOM__ || __JDOOM64__
{ITT_LRFUNC, 0, "9 :", M_WeaponOrder, 8 << NUM_WEAPON_TYPES },
#endif
#if __JDOOM64__
{ITT_LRFUNC, 0, "10 :", M_WeaponOrder, 9 << NUM_WEAPON_TYPES },
#endif
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, "Cycling", NULL, 0 },
{ITT_EFUNC, 0, "Use Priority Order :", M_ToggleVar, 0, NULL, "player-weapon-nextmode"},
{ITT_LRFUNC, 0, "Sequential :", M_ToggleVar, 0, NULL, "player-weapon-cycle-sequential"},
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, "Autoswitch", NULL, 0},
{ITT_LRFUNC, 0, "Pickup Weapon :", M_WeaponAutoSwitch, 0},
{ITT_EFUNC, 0, " If Not Firing :", M_ToggleVar, 0, NULL, "player-autoswitch-notfiring"},
{ITT_LRFUNC, 0, "Pickup Ammo :", M_AmmoAutoSwitch, 0},
#if __JDOOM__ || __JDOOM64__
{ITT_EFUNC, 0, "Pickup Beserk :", M_ToggleVar, 0, NULL, "player-autoswitch-berserk"}
#endif
};
static menu_t WeaponDef = {
MNF_NOHOTKEYS,
#if __JDOOM__ || __JDOOM64__
78, 40,
#elif __JHERETIC__
78, 26,
#else // __JHEXEN__
78, 38,
#endif
M_DrawWeaponMenu,
#if __JDOOM64__
21,
#elif __JDOOM__
20,
#elif __JHERETIC__
18,
#elif __JHEXEN__
14,
#endif
WeaponItems,
1, MENU_OPTIONS,
GF_FONTA,
cfg.menuColor2,
LINEHEIGHT_A,
#if __JDOOM__ || __JDOOM64__
0, 17, { 17, 40 }
#elif __JHERETIC__
0, 15, { 15, 26 }
#else // __JHEXEN__
0, 14
#endif
};
static menuitem_t GameplayItems[] = {
{ITT_EFUNC, 0, "ALWAYS RUN :", M_ToggleVar, 0, NULL, "ctl-run"},
{ITT_EFUNC, 0, "USE LOOKSPRING :", M_ToggleVar, 0, NULL, "ctl-look-spring"},
{ITT_EFUNC, 0, "USE AUTOAIM :", M_ToggleVar, 0, NULL, "ctl-aim-noauto"},
#if __JDOOM__ || __JHERETIC__ || __JDOOM64__
{ITT_EFUNC, 0, "ALLOW JUMPING :", M_ToggleVar, 0, NULL, "player-jump"},
#endif
#if __JDOOM64__
{ ITT_EFUNC, 0, "WEAPON RECOIL : ", M_WeaponRecoil, 0 },
#endif
#if __JDOOM__ || __JHERETIC__ || __JDOOM64__
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, "COMPATIBILITY", NULL, 0 },
# if __JDOOM__ || __JDOOM64__
{ITT_EFUNC, 0, "ANY BOSS TRIGGER 666 :", M_ToggleVar, 0, NULL,
"game-anybossdeath666"},
# if !__JDOOM64__
{ITT_EFUNC, 0, "AV RESURRECTS GHOSTS :", M_ToggleVar, 0, NULL,
"game-raiseghosts"},
# endif
{ITT_EFUNC, 0, "PE LIMITED TO 21 LOST SOULS :", M_ToggleVar, 0, NULL,
"game-maxskulls"},
{ITT_EFUNC, 0, "LS CAN GET STUCK INSIDE WALLS :", M_ToggleVar, 0, NULL,
"game-skullsinwalls"},
# endif
# if __JDOOM__ || __JHERETIC__ || __JDOOM64__
{ITT_EFUNC, 0, "MONSTERS CAN GET STUCK IN DOORS :", M_ToggleVar, 0, NULL,
"game-monsters-stuckindoors"},
{ITT_EFUNC, 0, "SOME OBJECTS NEVER HANG OVER LEDGES :", M_ToggleVar, 0, NULL,
"game-objects-neverhangoverledges"},
{ITT_EFUNC, 0, "OBJECTS FALL UNDER OWN WEIGHT :", M_ToggleVar, 0, NULL,
"game-objects-falloff"},
{ITT_EFUNC, 0, "CORPSES SLIDE DOWN STAIRS :", M_ToggleVar, 0, NULL,
"game-corpse-sliding"},
{ITT_EFUNC, 0, "USE EXACTLY DOOM'S CLIPPING CODE :", M_ToggleVar, 0, NULL,
"game-objects-clipping"},
{ITT_EFUNC, 0, " ^IFNOT NORTHONLY WALLRUNNING :", M_ToggleVar, 0, NULL,
"game-player-wallrun-northonly"},
# endif
# if __JDOOM__ || __JDOOM64__
{ITT_EFUNC, 0, "ZOMBIE PLAYERS CAN EXIT MAPS :", M_ToggleVar, 0, NULL,
"game-zombiescanexit"},
{ITT_EFUNC, 0, "FIX OUCH FACE :", M_ToggleVar, 0, NULL, "hud-face-ouchfix"},
{ITT_EFUNC, 0, "FIX WEAPON SLOT DISPLAY :", M_ToggleVar, 0, NULL, "hud-status-weaponslots-ownedfix"}
# endif
#endif
};
#if __JHEXEN__
static menu_t GameplayDef = {
0,
88, 25,
M_DrawGameplay,
3, GameplayItems,
0, MENU_OPTIONS,
GF_FONTA,
cfg.menuColor2,
LINEHEIGHT_A,
0, 3
};
#else
static menu_t GameplayDef = {
0,
#if __JHERETIC__
30, 30,
#else
30, 40,
#endif
M_DrawGameplay,
#if __JDOOM64__
17, GameplayItems,
#elif __JDOOM__
19, GameplayItems,
#else
12, GameplayItems,
#endif
0, MENU_OPTIONS,
GF_FONTA,
cfg.menuColor2,
LINEHEIGHT_A,
#if __JDOOM64__
0, 17
#elif __JDOOM__