/
mn_menu.c
4264 lines (3766 loc) · 112 KB
/
mn_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-2007 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2005-2007 Daniel Swanson <danij@dengine.net>
*\author Copyright © 2006 Jamie Jones <yagisan@dengine.net>
*\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
*/
/**
* mn_menu.c: Common selection menu, options, episode etc.
* Sliders and icons. Kinda widget stuff.
*/
// HEADER FILES ------------------------------------------------------------
#ifdef MSVC
# pragma warning(disable:4018)
#endif
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
#if __JHEXEN__ || __JSTRIFE__
# include <lzss.h>
#endif
#if __DOOM64TC__
# include "doom64tc.h"
#elif __WOLFTC__
# include "wolftc.h"
#elif __JDOOM__
# include "jdoom.h"
#elif __JHERETIC__
# include "jheretic.h"
# include "g_common.h"
# include "m_argv.h"
#elif __JHEXEN__
# include "jhexen.h"
#elif __JSTRIFE__
# include "jstrife.h"
#endif
#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"
// MACROS ------------------------------------------------------------------
#define OBSOLETE CVF_HIDE|CVF_NO_ARCHIVE
#define SAVESTRINGSIZE 24
#define CVAR(typ, x) (*(typ*)Con_GetVariable(x)->ptr)
#define snd_SfxVolume (Get(DD_SFX_VOLUME)/17)
#define snd_MusicVolume (Get(DD_MUSIC_VOLUME)/17)
// QuitDOOM messages
#ifndef __JDOOM__
#define NUM_QUITMESSAGES 0
#endif
// TYPES -------------------------------------------------------------------
typedef struct rgba_s {
float *r, *g, *b, *a;
} rgba_t;
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
extern void Ed_MakeCursorVisible(void);
extern void Ed_MakeCursorVisible(void);
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
void InitFonts(void);
void M_NewGame(int option, void *data);
void M_Episode(int option, void *data); // Does nothing in jHEXEN
void M_ChooseClass(int option, void *data); // Does something only in jHEXEN
void M_ChooseSkill(int option, void *data);
void M_LoadGame(int option, void *data);
void M_SaveGame(int option, void *data);
void M_GameFiles(int option, void *data); // Does nothing in jDOOM
void M_EndGame(int option, void *data);
void M_ReadThis(int option, void *data);
void M_ReadThis2(int option, void *data);
#ifndef __JDOOM__
void M_ReadThis3(int option, void *data);
#endif
void M_QuitDOOM(int option, void *data);
void M_ToggleVar(int option, void *data);
void M_OpenDCP(int option, void *data);
void M_ChangeMessages(int option, void *data);
void M_WeaponAutoSwitch(int option, void *data);
void M_AmmoAutoSwitch(int option, void *data);
void M_HUDInfo(int option, void *data);
void M_HUDScale(int option, void *data);
void M_SfxVol(int option, void *data);
void M_WeaponOrder(int option, void *data);
void M_MusicVol(int option, void *data);
void M_SizeDisplay(int option, void *data);
#if !__DOOM64TC__
void M_SizeStatusBar(int option, void *data);
void M_StatusBarAlpha(int option, void *data);
#endif
void M_HUDRed(int option, void *data);
void M_HUDGreen(int option, void *data);
void M_HUDBlue(int option, void *data);
void M_FinishReadThis(int option, void *data);
void M_LoadSelect(int option, void *data);
void M_SaveSelect(int option, void *data);
void M_Xhair(int option, void *data);
void M_XhairSize(int option, void *data);
#ifdef __JDOOM__
void M_XhairR(int option, void *data);
void M_XhairG(int option, void *data);
void M_XhairB(int option, void *data);
void M_XhairAlpha(int option, void *data);
#endif
void M_StartMenu(void);
void M_ReadSaveStrings(void);
void M_DoSave(int slot);
void M_DoLoad(int slot);
static void M_QuickSave(void);
static void M_QuickLoad(void);
#if __DOOM64TC__
void M_WeaponRecoil(int option, void *data);
#endif
void M_DrawMainMenu(void);
void M_DrawReadThis1(void);
void M_DrawReadThis2(void);
#ifndef __JDOOM__
void M_DrawReadThis3(void);
#endif
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);
void M_DrawMapMenu(void);
void M_DrawWeaponMenu(void);
void M_DrawLoad(void);
void M_DrawSave(void);
void M_DrawFilesMenu(void);
void M_DrawBackgroundBox(int x, int y, int w, int h,
float r, float g, float b, float a,
boolean background, int border);
// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
static void M_DrawBackground(menu_t *menu);
// EXTERNAL DATA DECLARATIONS ----------------------------------------------
extern editfield_t *ActiveEdit; // in Mn_def.h
extern boolean chatOn; // in heads-up code
#ifdef __JDOOM__
extern int joyaxis[3];
#endif
extern char *weaponNames[];
extern int typein_time; // in heads-up code
extern dpatch_t hu_font[HU_FONTSIZE];
extern dpatch_t hu_font_a[HU_FONTSIZE], hu_font_b[HU_FONTSIZE];
// PUBLIC DATA DEFINITIONS -------------------------------------------------
#ifndef __JDOOM__
char *endmsg[] = {
"ARE YOU SURE YOU WANT TO QUIT?",
"ARE YOU SURE YOU WANT TO END THE GAME?",
"DO YOU WANT TO QUICKSAVE THE GAME NAMED",
"DO YOU WANT TO QUICKLOAD THE GAME NAMED"
};
#endif
#ifdef __JDOOM__
/// The end message strings will be initialized in MN_Init().
char *endmsg[NUM_QUITMESSAGES + 1];
#endif
const char* QuitEndMsg[] =
{
"ARE YOU SURE YOU WANT TO QUIT?",
"ARE YOU SURE YOU WANT TO END THE GAME?",
"DO YOU WANT TO QUICKSAVE THE GAME NAMED",
"DO YOU WANT TO QUICKLOAD THE GAME NAMED",
"ARE YOU SURE YOU WANT TO SUICIDE?",
NULL
};
char gammamsg[5][81];
boolean inhelpscreens;
boolean menuactive;
menu_t *currentMenu;
int screenblocks = 10; // has default
#if __JHERETIC__
static int MenuEpisode;
#endif
// -1 = no quicksave slot picked!
int quickSaveSlot;
// 1 = message to be printed
int messageToPrint;
// ...and here is the message string!
char *messageString;
int messageResponse;
int messageLastMenuActive;
// timed message = no input from user
boolean messageNeedsInput;
boolean (*messageRoutine) (int response, void *data);
char tempstring[80];
// old save description before edit
char saveOldString[SAVESTRINGSIZE];
char savegamestrings[10][SAVESTRINGSIZE];
// 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];
#if __JDOOM__
static char *yesno[3] = { "NO", "YES", "MAYBE?" };
#else
static char *yesno[2] = { "NO", "YES" };
#endif
#if __JDOOM__ || __JHERETIC__
char *episodemsg;
int epi;
#endif
static char shiftTable[59] = // Contains characters 32 to 90.
{
/* 32 */ 0, 0, 0, 0, 0, 0, 0, '"',
/* 40 */ 0, 0, 0, 0, '<', '_', '>', '?', ')', '!',
/* 50 */ '@', '#', '$', '%', '^', '&', '*', '(', 0, ':',
/* 60 */ 0, '+', 0, 0, 0, 0, 0, 0, 0, 0,
/* 70 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 80 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 90 */ 0
};
// Alpha level for the entire menu. Used primarily by M_WriteText2().
float menu_alpha = 0;
int menu_color = 0;
float skull_angle = 0;
int frame; // used by any graphic animations that need to be pumped
int gammaLevel;
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
// Sounds played in the menu
int menusnds[] = {
#if __WOLFTC__
sfx_menubc, // close menu
sfx_menubc, // open menu
sfx_menubc, // cancel
sfx_menumv, // up/down
sfx_menumv, // left/right
sfx_menusl, // accept
sfx_menumv // bad sound (eg can't autosave)
#elif __JDOOM__
sfx_dorcls, // close menu
sfx_swtchx, // open menu
sfx_swtchn, // cancel
sfx_pstop, // up/down
sfx_stnmov, // left/right
sfx_pistol, // accept
sfx_oof // bad sound (eg can't autosave)
#elif __JHERETIC__
sfx_switch,
sfx_chat,
sfx_switch,
sfx_switch,
sfx_stnmov,
sfx_chat,
sfx_chat
#elif __JHEXEN__
SFX_PLATFORM_STOP,
SFX_DOOR_LIGHT_CLOSE,
SFX_FIGHTER_HAMMER_HITWALL,
SFX_PICKUP_KEY,
SFX_FIGHTER_HAMMER_HITWALL,
SFX_CHAT,
SFX_CHAT
#endif
};
// PRIVATE DATA DEFINITIONS ------------------------------------------------
#ifndef __JDOOM__
static int SkullBaseLump;
#endif
static int cursors = NUMCURSORS;
dpatch_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], &cfg.automapBack[3] },
{ &cfg.hudColor[0], &cfg.hudColor[1], &cfg.hudColor[2], &cfg.hudColor[3] }
};
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
static int menuFogTexture = 0;
static float mfSpeeds[2] = { 1 * .05f, 1 * -.085f };
static float mfAngle[2] = { 93, 12 };
static float mfPosAngle[2] = { 35, 77 };
static float mfPos[2][2];
static float mfAlpha = 0;
static float mfYjoin = 0.5f;
static boolean updown = true;
static float outFade = 0;
static boolean fadingOut = false;
static int menuDarkTicks = 15;
static int quitAsk = 0; // set ON so menu fog is rendered with the quit message
#if !defined( __JHEXEN__ ) && !defined( __JHERETIC__ )
static int quitYet = 0; // prevents multiple quit responses
#endif
static int slamInTicks = 9;
// used to fade out the background a little when a widget is active
static float menu_calpha = 0;
//static boolean FileMenuKeySteal;
//static boolean slottextloaded;
static int quicksave;
static int quickload;
#ifndef __JDOOM__
#define READTHISID 3
#else
#define READTHISID 5
#endif
menuitem_t MainItems[] = {
#if __DOOM64TC__
{ITT_EFUNC, 0, "{case}New Game", M_NewGame, 0},
{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}Read This!", M_ReadThis, 0},
{ITT_EFUNC, 0, "{case}Quit Game", M_QuitDOOM, 0}
#elif __JDOOM__
{ITT_EFUNC, 0, "{case}New Game", M_NewGame, 0, "M_NGAME"},
{ITT_EFUNC, 0, "{case}Multiplayer", SCEnterMultiplayerMenu, 0},
{ITT_SETMENU, 0, "{case}Options", NULL, MENU_OPTIONS, "M_OPTION" },
{ITT_EFUNC, 0, "{case}Load Game", M_LoadGame, 0, "M_LOADG"},
{ITT_EFUNC, 0, "{case}Save Game", M_SaveGame, 0, "M_SAVEG"},
{ITT_EFUNC, 0, "{case}Read This!", M_ReadThis, 0, "M_RDTHIS"},
{ITT_EFUNC, 0, "{case}Quit Game", M_QuitDOOM, 0, "M_QUITG"}
#elif __JSTRIFE__
{ITT_EFUNC, 0, "N", M_NewGame, 0, ""},
{ITT_EFUNC, 0, "M", SCEnterMultiplayerMenu, 0, ""},
{ITT_SETMENU, 0, "O", NULL, 0, MENU_OPTIONS},
{ITT_EFUNC, 0, "L", M_LoadGame, 0, ""},
{ITT_EFUNC, 0, "S", M_SaveGame, 0, ""},
{ITT_EFUNC, 0, "R", M_ReadThis, 0, ""},
{ITT_EFUNC, 0, "Q", M_QuitDOOM, 0, ""}
#else
{ITT_EFUNC, 0, "new game", M_NewGame, 0},
{ITT_EFUNC, 0, "multiplayer", SCEnterMultiplayerMenu, 0},
{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,
6, MainItems,
0, MENU_NONE,
hu_font_b, //1, 0, 0,
cfg.menuColor,
NULL,
LINEHEIGHT_B,
0, 6
#elif __JHERETIC__
0,
110, 64,
M_DrawMainMenu,
6, MainItems,
0, MENU_NONE,
hu_font_b, //1, 0, 0,
cfg.menuColor,
NULL,
LINEHEIGHT_B,
0, 6
#elif __JSTRIFE__
0,
97, 64,
M_DrawMainMenu,
7, MainItems,
0, MENU_NONE,
hu_font_a, //1, 0, 0,
cfg.menuColor,
NULL,
LINEHEIGHT_B + 1,
0, 7
#elif __DOOM64TC__
0,
97, 64,
M_DrawMainMenu,
6, MainItems,
0, MENU_NONE,
hu_font_b, //1, 0, 0,
cfg.menuColor,
NULL,
LINEHEIGHT_B + 1,
0, 6
#else
0,
97, 64,
M_DrawMainMenu,
7, MainItems,
0, MENU_NONE,
hu_font_b, //1, 0, 0,
cfg.menuColor,
NULL,
LINEHEIGHT_B + 1,
0, 7
#endif
};
#if __JHEXEN__
menuitem_t ClassItems[] = {
{ITT_EFUNC, 0, "FIGHTER", M_ChooseClass, 0},
{ITT_EFUNC, 0, "CLERIC", M_ChooseClass, 1},
{ITT_EFUNC, 0, "MAGE", M_ChooseClass, 2}
};
menu_t ClassDef = {
0,
66, 66,
M_DrawClassMenu,
3, ClassItems,
0, MENU_MAIN,
hu_font_b, //1, 0, 0,
cfg.menuColor,
NULL,
LINEHEIGHT_B + 1,
0, 3
};
#endif
#ifdef __JHERETIC__
menuitem_t EpisodeItems[] = {
{ITT_EFUNC, 0, "city of the damned", M_Episode, 1},
{ITT_EFUNC, 0, "hell's maw", M_Episode, 2},
{ITT_EFUNC, 0, "the dome of d'sparil", M_Episode, 3},
{ITT_EFUNC, 0, "the ossuary", M_Episode, 4},
{ITT_EFUNC, 0, "the stagnant demesne", M_Episode, 5}
};
menu_t EpiDef = {
0,
48, 50,
M_DrawEpisode,
3, EpisodeItems,
0, MENU_MAIN,
hu_font_b, //1, 0, 0,
cfg.menuColor,
NULL,
LINEHEIGHT + 1,
0, 3
};
#elif __DOOM64TC__
menuitem_t EpisodeItems[] = {
// Text defs TXT_EPISODE1..2.
{ITT_EFUNC, 0, "A", M_Episode, 0 },
{ITT_EFUNC, 0, "O", M_Episode, 1 }
};
menu_t EpiDef = {
0,
48, 63,
M_DrawEpisode,
2, EpisodeItems,
0, MENU_MAIN,
hu_font_b, //1, 0, 0,
cfg.menuColor,
NULL,
LINEHEIGHT + 1,
0, 2
};
#elif __JDOOM__
menuitem_t EpisodeItems[] = {
// Text defs TXT_EPISODE1..4.
{ITT_EFUNC, 0, "K", M_Episode, 0, "M_EPI1" },
{ITT_EFUNC, 0, "T", M_Episode, 1, "M_EPI2" },
{ITT_EFUNC, 0, "I", M_Episode, 2, "M_EPI3" },
{ITT_EFUNC, 0, "T", M_Episode, 3, "M_EPI4" }
};
menu_t EpiDef = {
0,
48, 63,
M_DrawEpisode,
4, EpisodeItems,
0, MENU_MAIN,
hu_font_b, //1, 0, 0,
cfg.menuColor,
NULL,
LINEHEIGHT + 1,
0, 4
};
#endif
#ifndef __JDOOM__
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,
hu_font_b, //1, 0, 0,
cfg.menuColor,
NULL,
LINEHEIGHT + 1,
0, 2
};
#endif
static menuitem_t LoadItems[] = {
{ITT_EFUNC, 0, "1", M_LoadSelect, 0, ""},
{ITT_EFUNC, 0, "2", M_LoadSelect, 1, ""},
{ITT_EFUNC, 0, "3", M_LoadSelect, 2, ""},
{ITT_EFUNC, 0, "4", M_LoadSelect, 3, ""},
{ITT_EFUNC, 0, "5", M_LoadSelect, 4, ""},
{ITT_EFUNC, 0, "6", M_LoadSelect, 5, ""},
#if __JDOOM__ || __JHERETIC__
{ITT_EFUNC, 0, "7", M_LoadSelect, 6, ""},
{ITT_EFUNC, 0, "8", M_LoadSelect, 7, ""}
#endif
};
static menu_t LoadDef = {
0,
#ifndef __JDOOM__
80, 30,
#else
80, 54,
#endif
M_DrawLoad,
NUMSAVESLOTS, LoadItems,
0, MENU_MAIN,
hu_font_a,
cfg.menuColor2,
NULL,
LINEHEIGHT_A + 8,
0, NUMSAVESLOTS
};
static menuitem_t SaveItems[] = {
{ITT_EFUNC, 0, "1", M_SaveSelect, 0, ""},
{ITT_EFUNC, 0, "2", M_SaveSelect, 1, ""},
{ITT_EFUNC, 0, "3", M_SaveSelect, 2, ""},
{ITT_EFUNC, 0, "4", M_SaveSelect, 3, ""},
{ITT_EFUNC, 0, "5", M_SaveSelect, 4, ""},
{ITT_EFUNC, 0, "6", M_SaveSelect, 5, ""},
#if __JDOOM__ || __JHERETIC__
{ITT_EFUNC, 0, "7", M_SaveSelect, 6, ""},
{ITT_EFUNC, 0, "8", M_SaveSelect, 7, ""}
#endif
};
static menu_t SaveDef = {
0,
#ifndef __JDOOM__
80, 30,
#else
80, 54,
#endif
M_DrawSave,
NUMSAVESLOTS, SaveItems,
0, MENU_MAIN,
hu_font_a,
cfg.menuColor2,
NULL,
LINEHEIGHT_A + 8,
0, NUMSAVESLOTS
};
#if __JSTRIFE__
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_MAIN,
hu_font_b, //1, 0, 0,
cfg.menuColor,
NULL,
LINEHEIGHT,
0, 5
};
#elif __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,
hu_font_b, //1, 0, 0,
cfg.menuColor,
NULL,
LINEHEIGHT,
0, 5
};
#elif __JHERETIC__
static menuitem_t SkillItems[] = {
{ITT_EFUNC, 0, "thou needet a wet-nurse", M_ChooseSkill, SM_BABY},
{ITT_EFUNC, 0, "yellowbellies-r-us", M_ChooseSkill, SM_EASY},
{ITT_EFUNC, 0, "bringest them oneth", M_ChooseSkill, SM_MEDIUM},
{ITT_EFUNC, 0, "thou art a smite-meister", M_ChooseSkill, SM_HARD},
{ITT_EFUNC, 0, "black plague possesses thee", M_ChooseSkill, SM_NIGHTMARE}
};
static menu_t SkillDef = {
0,
38, 30,
M_DrawSkillMenu,
5, SkillItems,
2, MENU_EPISODE,
hu_font_b, //1, 0, 0,
cfg.menuColor,
NULL,
LINEHEIGHT,
0, 5
};
#elif __JDOOM__
static menuitem_t SkillItems[] = {
// Text defs TXT_SKILL1..5.
{ITT_EFUNC, 0, "I", M_ChooseSkill, 0, "M_JKILL"},
{ITT_EFUNC, 0, "H", M_ChooseSkill, 1, "M_ROUGH"},
{ITT_EFUNC, 0, "H", M_ChooseSkill, 2, "M_HURT"},
{ITT_EFUNC, 0, "U", M_ChooseSkill, 3, "M_ULTRA"},
{ITT_EFUNC, MIF_NOTALTTXT, "N", M_ChooseSkill, 4, "M_NMARE"}
};
static menu_t SkillDef = {
0,
48, 63,
M_DrawSkillMenu,
5, SkillItems,
2, MENU_EPISODE,
hu_font_b, //1, 0, 0,
cfg.menuColor,
NULL,
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, "gameplay...", NULL, MENU_GAMEPLAY},
{ITT_SETMENU, 0, "hud...", NULL, MENU_HUD},
{ITT_SETMENU, 0, "automap...", NULL, MENU_MAP},
{ITT_SETMENU, 0, "weapons...", NULL, MENU_WEAPONSETUP},
{ITT_SETMENU, 0, "sound...", NULL, MENU_OPTIONS2},
{ITT_EFUNC, 0, "controls", M_OpenDCP, 3},
{ITT_SETMENU, 0, "mouse options", M_OpenDCP, 2},
{ITT_SETMENU, 0, "joystick options", M_OpenDCP, 2}
};
static menu_t OptionsDef = {
0,
94, 84,
M_DrawOptions,
10, OptionsItems,
0, MENU_MAIN,
hu_font_a, //1, 0, 0,
cfg.menuColor2,
NULL,
LINEHEIGHT_A,
0, 10
};
static menuitem_t Options2Items[] = {
{ITT_LRFUNC, 0, "SFX VOLUME :", M_SfxVol, 0},
#ifndef __JDOOM__
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
#endif
{ITT_LRFUNC, 0, "MUSIC VOLUME :", M_MusicVol, 0},
#ifndef __JDOOM__
{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__ || __JSTRIFE__
70, 25,
#elif __JHERETIC__
70, 30,
#elif __JDOOM__
70, 40,
#endif
M_DrawOptions2,
#ifndef __JDOOM__
7, Options2Items,
#else
3, Options2Items,
#endif
0, MENU_OPTIONS,
hu_font_a,
cfg.menuColor2,
NULL,
LINEHEIGHT_A,
#ifndef __JDOOM__
0, 7
#else
0, 3
#endif
};
menuitem_t ReadItems1[] = {
{ITT_EFUNC, 0, "", M_ReadThis2, 0}
};
menu_t ReadDef1 = {
MNF_NOSCALE,
280, 185,
M_DrawReadThis1,
1, ReadItems1,
0, MENU_MAIN,
hu_font_b, //1, 0, 0,
cfg.menuColor,
NULL,
LINEHEIGHT,
0, 1
};
menuitem_t ReadItems2[] = {
#ifdef __JDOOM__ // heretic and hexen have 3 readthis screens.
{ITT_EFUNC, 0, "", M_FinishReadThis, 0}
#else
{ITT_EFUNC, 0, "", M_ReadThis3, 0}
#endif
};
menu_t ReadDef2 = {
MNF_NOSCALE,
330, 175,
M_DrawReadThis2,
1, ReadItems2,
0, MENU_MAIN,
hu_font_b, //1, 0, 0,
cfg.menuColor,
NULL,
LINEHEIGHT,
0, 1
};
#ifndef __JDOOM__
menuitem_t ReadItems3[] = {
{ITT_EFUNC, 0, "", M_FinishReadThis, 0}
};
menu_t ReadDef3 = {
MNF_NOSCALE,
330, 175,
M_DrawReadThis3,
1, ReadItems3,
0, MENU_MAIN,
hu_font_b, //1, 0, 0,
cfg.menuColor,
NULL,
LINEHEIGHT,
0, 1
};
#endif
static menuitem_t HUDItems[] = {
#if __DOOM64TC__
{ITT_EFUNC, 0, "show ammo :", M_ToggleVar, 0, NULL, "hud-ammo" },
{ITT_EFUNC, 0, "show armor :", M_ToggleVar, 0, NULL, "hud-armor" },
{ITT_EFUNC, 0, "show power keys :", M_ToggleVar, 0, NULL, "hud-power" },
{ITT_EFUNC, 0, "show health :", M_ToggleVar, 0, NULL,"hud-health" },
{ITT_EFUNC, 0, "show keys :", M_ToggleVar, 0, NULL, "hud-keys" },
{ITT_LRFUNC, 0, "scale", M_HUDScale, 0},
{ITT_EFUNC, 0, " HUD color", SCColorWidget, 5},
#elif __JDOOM__
{ITT_EFUNC, 0, "show ammo :", M_ToggleVar, 0, NULL, "hud-ammo" },
{ITT_EFUNC, 0, "show armor :", M_ToggleVar, 0, NULL, "hud-armor" },
{ITT_EFUNC, 0, "show face :", M_ToggleVar, 0, NULL, "hud-face" },
{ITT_EFUNC, 0, "show health :", M_ToggleVar, 0, NULL,"hud-health" },
{ITT_EFUNC, 0, "show keys :", M_ToggleVar, 0, NULL, "hud-keys" },
{ITT_LRFUNC, 0, "scale", M_HUDScale, 0},
{ITT_EFUNC, 0, " HUD color", SCColorWidget, 5},
#endif
{ITT_EFUNC, 0, "MESSAGES :", M_ChangeMessages, 0},
{ITT_LRFUNC, 0, "CROSSHAIR :", M_Xhair, 0},
{ITT_LRFUNC, 0, "CROSSHAIR SIZE :", M_XhairSize, 0},
#if !__JDOOM__
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
#endif
{ITT_LRFUNC, 0, "SCREEN SIZE", M_SizeDisplay, 0},
#if !__JDOOM__
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
#endif
#if !__DOOM64TC__
{ITT_LRFUNC, 0, "STATUS BAR SIZE", M_SizeStatusBar, 0},
# if !__JDOOM__
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
# endif
{ITT_LRFUNC, 0, "STATUS BAR ALPHA :", M_StatusBarAlpha, 0},
# if !__JDOOM__
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
# endif
#endif
#if __JHEXEN__ || __JSTRIFE__
{ITT_INERT, 0, "FULLSCREEN HUD", NULL, 0},
{ITT_INERT, 0, "FULLSCREEN HUD", NULL, 0},
{ITT_EFUNC, 0, "SHOW MANA :", M_ToggleVar, 0, NULL, "hud-mana" },
{ITT_EFUNC, 0, "SHOW HEALTH :", M_ToggleVar, 0, NULL, "hud-health" },
{ITT_EFUNC, 0, "SHOW ARTIFACT :", M_ToggleVar, 0, NULL, "hud-artifact" },
{ITT_EFUNC, 0, " HUD COLOUR", SCColorWidget, 5},
{ITT_LRFUNC, 0, "SCALE", M_HUDScale, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
#elif __JHERETIC__
{ITT_INERT, 0, "FULLSCREEN HUD", NULL, 0},
{ITT_INERT, 0, "FULLSCREEN HUD", NULL, 0},
{ITT_EFUNC, 0, "SHOW AMMO :", M_ToggleVar, 0, NULL, "hud-ammo" },
{ITT_EFUNC, 0, "SHOW ARMOR :", M_ToggleVar, 0, NULL, "hud-armor" },
{ITT_EFUNC, 0, "SHOW ARTIFACT :", M_ToggleVar, 0, NULL, "hud-artifact" },
{ITT_EFUNC, 0, "SHOW HEALTH :", M_ToggleVar, 0, NULL, "hud-health" },
{ITT_EFUNC, 0, "SHOW KEYS :", M_ToggleVar, 0, NULL, "hud-keys" },
{ITT_EFUNC, 0, " HUD COLOUR", SCColorWidget, 5},
{ITT_LRFUNC, 0, "SCALE", M_HUDScale, 0},
{ITT_EMPTY, 0, NULL, NULL, 0},
{ITT_EMPTY, 0, NULL, NULL, 0}
#endif
};
static menu_t HUDDef = {
0,
#ifndef __JDOOM__
64, 30,
#else
70, 40,
#endif
M_DrawHUDMenu,
#if __JHEXEN__ || __JSTRIFE__
23, HUDItems,
#elif __JHERETIC__
25, HUDItems,
#elif __DOOM64TC__
11, HUDItems,
#elif __JDOOM__
13, HUDItems,
#endif
0, MENU_OPTIONS,
hu_font_a,
cfg.menuColor2,
NULL,
LINEHEIGHT_A,
#if __JHEXEN__ || __JSTRIFE__
0, 15 // 21
#elif __JHERETIC__
0, 15 // 23
#elif __DOOM64TC__
0, 11
#elif __JDOOM__
0, 13
#endif
};
static menuitem_t WeaponItems[] = {
{ITT_EMPTY, 0, "Use left/right to move", NULL, 0 },
{ITT_EMPTY, 0, "item up/down the list." , NULL, 0 },
{ITT_EMPTY, 0, NULL, NULL, 0},
{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__
{ITT_LRFUNC, 0, "9 :", M_WeaponOrder, 8 << NUM_WEAPON_TYPES },
#endif
#if __DOOM64TC__