forked from insane-adding-machines/DOOM
-
Notifications
You must be signed in to change notification settings - Fork 20
/
m_menu.c
2125 lines (1752 loc) · 38.4 KB
/
m_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
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// 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.
//
// DESCRIPTION:
// DOOM selection menu, options, episode etc.
// Sliders and icons. Kinda widget stuff.
//
#include <stdlib.h>
#include <ctype.h>
#include "doomdef.h"
#include "doomkeys.h"
#include "dstrings.h"
#include "d_main.h"
#include "deh_main.h"
#include "i_swap.h"
#include "i_system.h"
#include "i_timer.h"
#include "i_video.h"
#include "m_misc.h"
#include "v_video.h"
#include "w_wad.h"
#include "z_zone.h"
#include "r_local.h"
#include "hu_stuff.h"
#include "g_game.h"
#include "m_argv.h"
#include "m_controls.h"
#include "p_saveg.h"
#include "s_sound.h"
#include "doomstat.h"
// Data.
#include "sounds.h"
#include "m_menu.h"
extern patch_t* hu_font[HU_FONTSIZE];
extern boolean message_dontfuckwithme;
extern boolean chat_on; // in heads-up code
//
// defaulted values
//
int mouseSensitivity = 5;
// Show messages has default, 0 = off, 1 = on
int showMessages = 1;
// Blocky mode, has default, 0 = high, 1 = normal
int detailLevel = 0;
int screenblocks = 9;
// temp for screenblocks (0-9)
int screenSize;
// -1 = no quicksave slot picked!
int quickSaveSlot;
// 1 = message to be printed
int messageToPrint;
// ...and here is the message string!
char* messageString;
// message x & y
int messx;
int messy;
int messageLastMenuActive;
// timed message = no input from user
boolean messageNeedsInput;
void (*messageRoutine)(int response);
char gammamsg[5][26] =
{
GAMMALVL0,
GAMMALVL1,
GAMMALVL2,
GAMMALVL3,
GAMMALVL4
};
// 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
// old save description before edit
char saveOldString[SAVESTRINGSIZE];
boolean inhelpscreens;
boolean menuactive;
#define SKULLXOFF -32
#define LINEHEIGHT 16
extern boolean sendpause;
char savegamestrings[10][SAVESTRINGSIZE];
char endstring[160];
//static boolean opldev;
//
// MENU TYPEDEFS
//
typedef struct
{
// 0 = no cursor here, 1 = ok, 2 = arrows ok
short status;
char name[10];
// choice = menu item #.
// if status = 2,
// choice=0:leftarrow,1:rightarrow
void (*routine)(int choice);
// hotkey in menu
char alphaKey;
} menuitem_t;
typedef struct menu_s
{
short numitems; // # of menu items
struct menu_s* prevMenu; // previous menu
menuitem_t* menuitems; // menu items
void (*routine)(); // draw routine
short x;
short y; // x,y of menu
short lastOn; // last item user was on in menu
} menu_t;
short itemOn; // menu item skull is on
short skullAnimCounter; // skull animation counter
short whichSkull; // which skull to draw
// graphic name of skulls
// warning: initializer-string for array of chars is too long
char *skullName[2] = {"M_SKULL1","M_SKULL2"};
// current menudef
menu_t* currentMenu;
//
// PROTOTYPES
//
void M_NewGame(int choice);
void M_Episode(int choice);
void M_ChooseSkill(int choice);
void M_LoadGame(int choice);
void M_SaveGame(int choice);
void M_Options(int choice);
void M_EndGame(int choice);
void M_ReadThis(int choice);
void M_ReadThis2(int choice);
void M_QuitDOOM(int choice);
void M_ChangeMessages(int choice);
void M_ChangeSensitivity(int choice);
void M_SfxVol(int choice);
void M_MusicVol(int choice);
void M_ChangeDetail(int choice);
void M_SizeDisplay(int choice);
void M_StartGame(int choice);
void M_Sound(int choice);
void M_FinishReadThis(int choice);
void M_LoadSelect(int choice);
void M_SaveSelect(int choice);
void M_ReadSaveStrings(void);
void M_QuickSave(void);
void M_QuickLoad(void);
void M_DrawMainMenu(void);
void M_DrawReadThis1(void);
void M_DrawReadThis2(void);
void M_DrawNewGame(void);
void M_DrawEpisode(void);
void M_DrawOptions(void);
void M_DrawSound(void);
void M_DrawLoad(void);
void M_DrawSave(void);
void M_DrawSaveLoadBorder(int x,int y);
void M_SetupNextMenu(menu_t *menudef);
void M_DrawThermo(int x,int y,int thermWidth,int thermDot);
void M_DrawEmptyCell(menu_t *menu,int item);
void M_DrawSelCell(menu_t *menu,int item);
void M_WriteText(int x, int y, char *string);
int M_StringWidth(char *string);
int M_StringHeight(char *string);
void M_StartMessage(char *string,void *routine,boolean input);
void M_StopMessage(void);
void M_ClearMenus (void);
//
// DOOM MENU
//
enum
{
newgame = 0,
options,
loadgame,
savegame,
readthis,
quitdoom,
main_end
} main_e;
menuitem_t MainMenu[]=
{
{1,"M_NGAME",M_NewGame,'n'},
{1,"M_OPTION",M_Options,'o'},
{1,"M_LOADG",M_LoadGame,'l'},
{1,"M_SAVEG",M_SaveGame,'s'},
// Another hickup with Special edition.
{1,"M_RDTHIS",M_ReadThis,'r'},
{1,"M_QUITG",M_QuitDOOM,'q'}
};
menu_t MainDef =
{
main_end,
NULL,
MainMenu,
M_DrawMainMenu,
97,64,
0
};
//
// EPISODE SELECT
//
enum
{
ep1,
ep2,
ep3,
ep4,
ep_end
} episodes_e;
menuitem_t EpisodeMenu[]=
{
{1,"M_EPI1", M_Episode,'k'},
{1,"M_EPI2", M_Episode,'t'},
{1,"M_EPI3", M_Episode,'i'},
{1,"M_EPI4", M_Episode,'t'}
};
menu_t EpiDef =
{
ep_end, // # of menu items
&MainDef, // previous menu
EpisodeMenu, // menuitem_t ->
M_DrawEpisode, // drawing routine ->
48,63, // x,y
ep1 // lastOn
};
//
// NEW GAME
//
enum
{
killthings,
toorough,
hurtme,
violence,
nightmare,
newg_end
} newgame_e;
menuitem_t NewGameMenu[]=
{
{1,"M_JKILL", M_ChooseSkill, 'i'},
{1,"M_ROUGH", M_ChooseSkill, 'h'},
{1,"M_HURT", M_ChooseSkill, 'h'},
{1,"M_ULTRA", M_ChooseSkill, 'u'},
{1,"M_NMARE", M_ChooseSkill, 'n'}
};
menu_t NewDef =
{
newg_end, // # of menu items
&EpiDef, // previous menu
NewGameMenu, // menuitem_t ->
M_DrawNewGame, // drawing routine ->
48,63, // x,y
hurtme // lastOn
};
//
// OPTIONS MENU
//
enum
{
endgame,
messages,
detail,
scrnsize,
option_empty1,
mousesens,
option_empty2,
soundvol,
opt_end
} options_e;
menuitem_t OptionsMenu[]=
{
{1,"M_ENDGAM", M_EndGame,'e'},
{1,"M_MESSG", M_ChangeMessages,'m'},
{1,"M_DETAIL", M_ChangeDetail,'g'},
{2,"M_SCRNSZ", M_SizeDisplay,'s'},
{-1,"",0,'\0'},
{2,"M_MSENS", M_ChangeSensitivity,'m'},
{-1,"",0,'\0'},
{1,"M_SVOL", M_Sound,'s'}
};
menu_t OptionsDef =
{
opt_end,
&MainDef,
OptionsMenu,
M_DrawOptions,
60,37,
0
};
//
// Read This! MENU 1 & 2
//
enum
{
rdthsempty1,
read1_end
} read_e;
menuitem_t ReadMenu1[] =
{
{1,"",M_ReadThis2,0}
};
menu_t ReadDef1 =
{
read1_end,
&MainDef,
ReadMenu1,
M_DrawReadThis1,
280,185,
0
};
enum
{
rdthsempty2,
read2_end
} read_e2;
menuitem_t ReadMenu2[]=
{
{1,"",M_FinishReadThis,0}
};
menu_t ReadDef2 =
{
read2_end,
&ReadDef1,
ReadMenu2,
M_DrawReadThis2,
330,175,
0
};
//
// SOUND VOLUME MENU
//
enum
{
sfx_vol,
sfx_empty1,
music_vol,
sfx_empty2,
sound_end
} sound_e;
menuitem_t SoundMenu[]=
{
{2,"M_SFXVOL",M_SfxVol,'s'},
{-1,"",0,'\0'},
{2,"M_MUSVOL",M_MusicVol,'m'},
{-1,"",0,'\0'}
};
menu_t SoundDef =
{
sound_end,
&OptionsDef,
SoundMenu,
M_DrawSound,
80,64,
0
};
//
// LOAD GAME MENU
//
enum
{
load1,
load2,
load3,
load4,
load5,
load6,
load_end
} load_e;
menuitem_t LoadMenu[]=
{
{1,"", M_LoadSelect,'1'},
{1,"", M_LoadSelect,'2'},
{1,"", M_LoadSelect,'3'},
{1,"", M_LoadSelect,'4'},
{1,"", M_LoadSelect,'5'},
{1,"", M_LoadSelect,'6'}
};
menu_t LoadDef =
{
load_end,
&MainDef,
LoadMenu,
M_DrawLoad,
80,54,
0
};
//
// SAVE GAME MENU
//
menuitem_t SaveMenu[]=
{
{1,"", M_SaveSelect,'1'},
{1,"", M_SaveSelect,'2'},
{1,"", M_SaveSelect,'3'},
{1,"", M_SaveSelect,'4'},
{1,"", M_SaveSelect,'5'},
{1,"", M_SaveSelect,'6'}
};
menu_t SaveDef =
{
load_end,
&MainDef,
SaveMenu,
M_DrawSave,
80,54,
0
};
//
// M_ReadSaveStrings
// read the strings from the savegame files
//
void M_ReadSaveStrings(void)
{
FILE *handle;
int i;
char name[256];
for (i = 0;i < load_end;i++)
{
M_StringCopy(name, P_SaveGameFile(i), sizeof(name));
handle = fopen(name, "rb");
if (handle == NULL)
{
M_StringCopy(savegamestrings[i], EMPTYSTRING, SAVESTRINGSIZE);
LoadMenu[i].status = 0;
continue;
}
fread(&savegamestrings[i], 1, SAVESTRINGSIZE, handle);
fclose(handle);
LoadMenu[i].status = 1;
}
}
//
// M_LoadGame & Cie.
//
void M_DrawLoad(void)
{
int i;
V_DrawPatchDirect(72, 28,
W_CacheLumpName(DEH_String("M_LOADG"), PU_CACHE));
for (i = 0;i < load_end; i++)
{
M_DrawSaveLoadBorder(LoadDef.x,LoadDef.y+LINEHEIGHT*i);
M_WriteText(LoadDef.x,LoadDef.y+LINEHEIGHT*i,savegamestrings[i]);
}
}
//
// Draw border for the savegame description
//
void M_DrawSaveLoadBorder(int x,int y)
{
int i;
V_DrawPatchDirect(x - 8, y + 7,
W_CacheLumpName(DEH_String("M_LSLEFT"), PU_CACHE));
for (i = 0;i < 24;i++)
{
V_DrawPatchDirect(x, y + 7,
W_CacheLumpName(DEH_String("M_LSCNTR"), PU_CACHE));
x += 8;
}
V_DrawPatchDirect(x, y + 7,
W_CacheLumpName(DEH_String("M_LSRGHT"), PU_CACHE));
}
//
// User wants to load this game
//
void M_LoadSelect(int choice)
{
char name[256];
M_StringCopy(name, P_SaveGameFile(choice), sizeof(name));
G_LoadGame (name);
M_ClearMenus ();
}
//
// Selected from DOOM menu
//
void M_LoadGame (int choice)
{
if (netgame)
{
M_StartMessage(DEH_String(LOADNET),NULL,false);
return;
}
M_SetupNextMenu(&LoadDef);
M_ReadSaveStrings();
}
//
// M_SaveGame & Cie.
//
void M_DrawSave(void)
{
int i;
V_DrawPatchDirect(72, 28, W_CacheLumpName(DEH_String("M_SAVEG"), PU_CACHE));
for (i = 0;i < load_end; i++)
{
M_DrawSaveLoadBorder(LoadDef.x,LoadDef.y+LINEHEIGHT*i);
M_WriteText(LoadDef.x,LoadDef.y+LINEHEIGHT*i,savegamestrings[i]);
}
if (saveStringEnter)
{
i = M_StringWidth(savegamestrings[saveSlot]);
M_WriteText(LoadDef.x + i,LoadDef.y+LINEHEIGHT*saveSlot,"_");
}
}
//
// M_Responder calls this when user is finished
//
void M_DoSave(int slot)
{
G_SaveGame (slot,savegamestrings[slot]);
M_ClearMenus ();
// PICK QUICKSAVE SLOT YET?
if (quickSaveSlot == -2)
quickSaveSlot = slot;
}
//
// User wants to save. Start string input for M_Responder
//
void M_SaveSelect(int choice)
{
// we are going to be intercepting all chars
saveStringEnter = 1;
saveSlot = choice;
M_StringCopy(saveOldString,savegamestrings[choice], SAVESTRINGSIZE);
if (!strcmp(savegamestrings[choice], EMPTYSTRING))
savegamestrings[choice][0] = 0;
saveCharIndex = strlen(savegamestrings[choice]);
}
//
// Selected from DOOM menu
//
void M_SaveGame (int choice)
{
if (!usergame)
{
M_StartMessage(DEH_String(SAVEDEAD),NULL,false);
return;
}
if (gamestate != GS_LEVEL)
return;
M_SetupNextMenu(&SaveDef);
M_ReadSaveStrings();
}
//
// M_QuickSave
//
char tempstring[80];
void M_QuickSaveResponse(int key)
{
if (key == key_menu_confirm)
{
M_DoSave(quickSaveSlot);
S_StartSound(NULL,sfx_swtchx);
}
}
void M_QuickSave(void)
{
if (!usergame)
{
S_StartSound(NULL,sfx_oof);
return;
}
if (gamestate != GS_LEVEL)
return;
if (quickSaveSlot < 0)
{
M_StartControlPanel();
M_ReadSaveStrings();
M_SetupNextMenu(&SaveDef);
quickSaveSlot = -2; // means to pick a slot now
return;
}
DEH_snprintf(tempstring, 80, QSPROMPT, savegamestrings[quickSaveSlot]);
M_StartMessage(tempstring,M_QuickSaveResponse,true);
}
//
// M_QuickLoad
//
void M_QuickLoadResponse(int key)
{
if (key == key_menu_confirm)
{
M_LoadSelect(quickSaveSlot);
S_StartSound(NULL,sfx_swtchx);
}
}
void M_QuickLoad(void)
{
if (netgame)
{
M_StartMessage(DEH_String(QLOADNET),NULL,false);
return;
}
if (quickSaveSlot < 0)
{
M_StartMessage(DEH_String(QSAVESPOT),NULL,false);
return;
}
DEH_snprintf(tempstring, 80, QLPROMPT, savegamestrings[quickSaveSlot]);
M_StartMessage(tempstring,M_QuickLoadResponse,true);
}
//
// Read This Menus
// Had a "quick hack to fix romero bug"
//
void M_DrawReadThis1(void)
{
char *lumpname = "CREDIT";
int skullx = 330, skully = 175;
inhelpscreens = true;
// Different versions of Doom 1.9 work differently
switch (gameversion)
{
case exe_doom_1_666:
case exe_doom_1_7:
case exe_doom_1_8:
case exe_doom_1_9:
case exe_hacx:
if (gamemode == commercial)
{
// Doom 2
lumpname = "HELP";
skullx = 330;
skully = 165;
}
else
{
// Doom 1
// HELP2 is the first screen shown in Doom 1
lumpname = "HELP2";
skullx = 280;
skully = 185;
}
break;
case exe_ultimate:
case exe_chex:
// Ultimate Doom always displays "HELP1".
// Chex Quest version also uses "HELP1", even though it is based
// on Final Doom.
lumpname = "HELP1";
break;
case exe_final:
case exe_final2:
// Final Doom always displays "HELP".
lumpname = "HELP";
break;
default:
I_Error("Unhandled game version");
break;
}
lumpname = DEH_String(lumpname);
V_DrawPatchDirect (0, 0, W_CacheLumpName(lumpname, PU_CACHE));
ReadDef1.x = skullx;
ReadDef1.y = skully;
}
//
// Read This Menus - optional second page.
//
void M_DrawReadThis2(void)
{
inhelpscreens = true;
// We only ever draw the second page if this is
// gameversion == exe_doom_1_9 and gamemode == registered
V_DrawPatchDirect(0, 0, W_CacheLumpName(DEH_String("HELP1"), PU_CACHE));
}
//
// Change Sfx & Music volumes
//
void M_DrawSound(void)
{
V_DrawPatchDirect (60, 38, W_CacheLumpName(DEH_String("M_SVOL"), PU_CACHE));
M_DrawThermo(SoundDef.x,SoundDef.y+LINEHEIGHT*(sfx_vol+1),
16,sfxVolume);
M_DrawThermo(SoundDef.x,SoundDef.y+LINEHEIGHT*(music_vol+1),
16,musicVolume);
}
void M_Sound(int choice)
{
M_SetupNextMenu(&SoundDef);
}
void M_SfxVol(int choice)
{
switch(choice)
{
case 0:
if (sfxVolume)
sfxVolume--;
break;
case 1:
if (sfxVolume < 15)
sfxVolume++;
break;
}
S_SetSfxVolume(sfxVolume * 8);
}
void M_MusicVol(int choice)
{
switch(choice)
{
case 0:
if (musicVolume)
musicVolume--;
break;
case 1:
if (musicVolume < 15)
musicVolume++;
break;
}
S_SetMusicVolume(musicVolume * 8);
}
//
// M_DrawMainMenu
//
void M_DrawMainMenu(void)
{
V_DrawPatchDirect(94, 2,
W_CacheLumpName(DEH_String("M_DOOM"), PU_CACHE));
}
//
// M_NewGame
//
void M_DrawNewGame(void)
{
V_DrawPatchDirect(96, 14, W_CacheLumpName(DEH_String("M_NEWG"), PU_CACHE));
V_DrawPatchDirect(54, 38, W_CacheLumpName(DEH_String("M_SKILL"), PU_CACHE));
}
void M_NewGame(int choice)
{
if (netgame && !demoplayback)
{
M_StartMessage(DEH_String(NEWGAME),NULL,false);
return;
}
// Chex Quest disabled the episode select screen, as did Doom II.
if (gamemode == commercial || gameversion == exe_chex)
M_SetupNextMenu(&NewDef);
else
M_SetupNextMenu(&EpiDef);
}
//
// M_Episode
//
int epi;
void M_DrawEpisode(void)
{
V_DrawPatchDirect(54, 38, W_CacheLumpName(DEH_String("M_EPISOD"), PU_CACHE));
}
void M_VerifyNightmare(int key)
{
if (key != key_menu_confirm)
return;
G_DeferedInitNew(nightmare,epi+1,1);
M_ClearMenus ();
}
void M_ChooseSkill(int choice)
{
if (choice == nightmare)
{
M_StartMessage(DEH_String(NIGHTMARE),M_VerifyNightmare,true);
return;
}
G_DeferedInitNew(choice,epi+1,1);
M_ClearMenus ();
}
void M_Episode(int choice)
{
if ( (gamemode == shareware)
&& choice)
{
M_StartMessage(DEH_String(SWSTRING),NULL,false);
M_SetupNextMenu(&ReadDef1);
return;
}
// Yet another hack...
if ( (gamemode == registered)
&& (choice > 2))
{
fprintf( stderr,
"M_Episode: 4th episode requires UltimateDOOM\n");
choice = 0;
}
epi = choice;
M_SetupNextMenu(&NewDef);
}
//
// M_Options
//
static char *detailNames[2] = {"M_GDHIGH","M_GDLOW"};
static char *msgNames[2] = {"M_MSGOFF","M_MSGON"};
void M_DrawOptions(void)
{
V_DrawPatchDirect(108, 15, W_CacheLumpName(DEH_String("M_OPTTTL"),
PU_CACHE));
V_DrawPatchDirect(OptionsDef.x + 175, OptionsDef.y + LINEHEIGHT * detail,
W_CacheLumpName(DEH_String(detailNames[detailLevel]),
PU_CACHE));
V_DrawPatchDirect(OptionsDef.x + 120, OptionsDef.y + LINEHEIGHT * messages,
W_CacheLumpName(DEH_String(msgNames[showMessages]),
PU_CACHE));
M_DrawThermo(OptionsDef.x, OptionsDef.y + LINEHEIGHT * (mousesens + 1),