-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMN_MENU.C
1788 lines (1645 loc) · 37.8 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
// MN_menu.c
#include <stdarg.h>
#include <stdio.h>
#include <ctype.h>
#include <io.h>
#include "DoomDef.h"
#include "P_local.h"
#include "R_local.h"
#include "soundst.h"
#include "deh_main.h"
// Macros
#define LEFT_DIR 0
#define RIGHT_DIR 1
#define ITEM_HEIGHT 20
#define SELECTOR_XOFFSET (-28)
#define SELECTOR_YOFFSET (-1)
#define SLOTTEXTLEN 16
#define ASCII_CURSOR '['
// Types
typedef enum
{
ITT_EMPTY,
ITT_EFUNC,
ITT_LRFUNC,
ITT_SETMENU,
ITT_INERT
} ItemType_t;
typedef enum
{
MENU_MAIN,
MENU_EPISODE,
MENU_SKILL,
MENU_OPTIONS,
MENU_OPTIONS2,
MENU_FILES,
MENU_LOAD,
MENU_SAVE,
MENU_NONE
} MenuType_t;
typedef struct
{
ItemType_t type;
char *text;
boolean (*func)(int option);
int option;
MenuType_t menu;
} MenuItem_t;
typedef struct
{
int x;
int y;
void (*drawFunc)(void);
int itemCount;
MenuItem_t *items;
int oldItPos;
MenuType_t prevMenu;
} Menu_t;
// Private Functions
static void InitFonts(void);
static void SetMenu(MenuType_t menu);
static boolean SCNetCheck(int option);
static boolean SCQuitGame(int option);
static boolean SCEpisode(int option);
static boolean SCSkill(int option);
static boolean SCMouseSensi(int option);
static boolean SCSfxVolume(int option);
static boolean SCMusicVolume(int option);
static boolean SCScreenSize(int option);
static boolean SCLoadGame(int option);
static boolean SCSaveGame(int option);
static boolean SCMessages(int option);
static boolean SCPalFlashes(int option); // FS: Pal Flashes
static boolean SCHeadBob(int option); // FS: Headbob Toggle
static boolean SCEndGame(int option);
static boolean SCInfo(int option);
static void DrawMainMenu(void);
static void DrawEpisodeMenu(void);
static void DrawSkillMenu(void);
static void DrawOptionsMenu(void);
static void DrawOptions2Menu(void);
static void DrawFileSlots(Menu_t *menu);
static void DrawFilesMenu(void);
static void MN_DrawInfo(void);
static void DrawLoadMenu(void);
static void DrawSaveMenu(void);
static void DrawSlider(Menu_t *menu, int item, int width, int slot);
void MN_LoadSlotText(void);
// External Data
extern int detailLevel;
extern int screenblocks;
// Public Data
boolean MenuActive;
int InfoType;
boolean messageson;
// Private Data
static int FontABaseLump;
static int FontBBaseLump;
static int SkullBaseLump;
static Menu_t *CurrentMenu;
static int CurrentItPos;
static int MenuEpisode;
static int MenuTime;
static boolean soundchanged;
boolean askforquit;
boolean typeofask;
static boolean FileMenuKeySteal;
static boolean slottextloaded;
static char SlotText[6][SLOTTEXTLEN + 2];
static char oldSlotText[SLOTTEXTLEN + 2];
static int SlotStatus[6];
static int slotptr;
static int currentSlot;
static int quicksave;
static int quickload;
int saveOn; //FS
static MenuItem_t MainItems[] =
{
{ ITT_EFUNC, "NEW GAME", SCNetCheck, 1, MENU_EPISODE },
{ ITT_SETMENU, "OPTIONS", NULL, 0, MENU_OPTIONS },
{ ITT_SETMENU, "GAME FILES", NULL, 0, MENU_FILES },
{ ITT_EFUNC, "INFO", SCInfo, 0, MENU_NONE },
{ ITT_EFUNC, "QUIT GAME", SCQuitGame, 0, MENU_NONE }
};
static Menu_t MainMenu =
{
110, 56,
DrawMainMenu,
5, MainItems,
0,
MENU_NONE
};
static MenuItem_t EpisodeItems[] =
{
{ ITT_EFUNC, "CITY OF THE DAMNED", SCEpisode, 1, MENU_NONE },
{ ITT_EFUNC, "HELL'S MAW", SCEpisode, 2, MENU_NONE },
{ ITT_EFUNC, "THE DOME OF D'SPARIL", SCEpisode, 3, MENU_NONE },
{ ITT_EFUNC, "THE OSSUARY", SCEpisode, 4, MENU_NONE },
{ ITT_EFUNC, "THE STAGNANT DEMESNE", SCEpisode, 5, MENU_NONE }
};
static Menu_t EpisodeMenu =
{
80, 50,
DrawEpisodeMenu,
3, EpisodeItems,
0,
MENU_MAIN
};
static MenuItem_t FilesItems[] =
{
{ ITT_EFUNC, "LOAD GAME", SCNetCheck, 2, MENU_LOAD },
{ ITT_SETMENU, "SAVE GAME", NULL, 0, MENU_SAVE }
};
static Menu_t FilesMenu =
{
110, 60,
DrawFilesMenu,
2, FilesItems,
0,
MENU_MAIN
};
static MenuItem_t LoadItems[] =
{
{ ITT_EFUNC, NULL, SCLoadGame, 0, MENU_NONE },
{ ITT_EFUNC, NULL, SCLoadGame, 1, MENU_NONE },
{ ITT_EFUNC, NULL, SCLoadGame, 2, MENU_NONE },
{ ITT_EFUNC, NULL, SCLoadGame, 3, MENU_NONE },
{ ITT_EFUNC, NULL, SCLoadGame, 4, MENU_NONE },
{ ITT_EFUNC, NULL, SCLoadGame, 5, MENU_NONE }
};
static Menu_t LoadMenu =
{
70, 30,
DrawLoadMenu,
6, LoadItems,
0,
MENU_FILES
};
static MenuItem_t SaveItems[] =
{
{ ITT_EFUNC, NULL, SCSaveGame, 0, MENU_NONE },
{ ITT_EFUNC, NULL, SCSaveGame, 1, MENU_NONE },
{ ITT_EFUNC, NULL, SCSaveGame, 2, MENU_NONE },
{ ITT_EFUNC, NULL, SCSaveGame, 3, MENU_NONE },
{ ITT_EFUNC, NULL, SCSaveGame, 4, MENU_NONE },
{ ITT_EFUNC, NULL, SCSaveGame, 5, MENU_NONE }
};
static Menu_t SaveMenu =
{
70, 30,
DrawSaveMenu,
6, SaveItems,
0,
MENU_FILES
};
static MenuItem_t SkillItems[] =
{
{ ITT_EFUNC, "THOU NEEDETH A WET-NURSE", SCSkill, sk_baby, MENU_NONE },
{ ITT_EFUNC, "YELLOWBELLIES-R-US", SCSkill, sk_easy, MENU_NONE },
{ ITT_EFUNC, "BRINGEST THEM ONETH", SCSkill, sk_medium, MENU_NONE },
{ ITT_EFUNC, "THOU ART A SMITE-MEISTER", SCSkill, sk_hard, MENU_NONE },
{ ITT_EFUNC, "BLACK PLAGUE POSSESSES THEE",
SCSkill, sk_nightmare, MENU_NONE }
};
static Menu_t SkillMenu =
{
38, 30,
DrawSkillMenu,
5, SkillItems,
2,
MENU_EPISODE
};
static MenuItem_t OptionsItems[] =
{
{ ITT_EFUNC, "END GAME", SCEndGame, 0, MENU_NONE },
{ ITT_EFUNC, "MESSAGES : ", SCMessages, 0, MENU_NONE },
{ ITT_EFUNC, "PALLETE FLASHES : ", SCPalFlashes, 0, MENU_NONE }, // FS: Pal Flashes
{ ITT_EFUNC, "HEADBOB : ", SCHeadBob, 0, MENU_NONE }, // FS: Headbob Toggle
{ ITT_LRFUNC, "MOUSE SENSITIVITY", SCMouseSensi, 0, MENU_NONE },
{ ITT_EMPTY, NULL, NULL, 0, MENU_NONE },
{ ITT_SETMENU, "MORE...", NULL, 0, MENU_OPTIONS2 }
};
static Menu_t OptionsMenu =
{
88, 15,
DrawOptionsMenu,
7, OptionsItems, // FS: Was 5
0,
MENU_MAIN
};
static MenuItem_t Options2Items[] =
{
{ ITT_LRFUNC, "SCREEN SIZE", SCScreenSize, 0, MENU_NONE },
{ ITT_EMPTY, NULL, NULL, 0, MENU_NONE },
{ ITT_LRFUNC, "SFX VOLUME", SCSfxVolume, 0, MENU_NONE },
{ ITT_EMPTY, NULL, NULL, 0, MENU_NONE },
{ ITT_LRFUNC, "MUSIC VOLUME", SCMusicVolume, 0, MENU_NONE },
{ ITT_EMPTY, NULL, NULL, 0, MENU_NONE }
};
static Menu_t Options2Menu =
{
90, 20,
DrawOptions2Menu,
6, Options2Items,
0,
MENU_OPTIONS
};
static Menu_t *Menus[] =
{
&MainMenu,
&EpisodeMenu,
&SkillMenu,
&OptionsMenu,
&Options2Menu,
&FilesMenu,
&LoadMenu,
&SaveMenu
};
//---------------------------------------------------------------------------
//
// PROC MN_Init
//
//---------------------------------------------------------------------------
void MN_Init(void)
{
InitFonts();
MenuActive = false;
messageson = true;
SkullBaseLump = W_GetNumForName("M_SKL00");
if (ExtendedWAD)
{ // Add episodes 4 and 5 to the menu
EpisodeMenu.itemCount = 5;
EpisodeMenu.y -= ITEM_HEIGHT;
}
}
//---------------------------------------------------------------------------
//
// PROC InitFonts
//
//---------------------------------------------------------------------------
static void InitFonts(void)
{
FontABaseLump = W_GetNumForName("FONTA_S") + 1;
FontBBaseLump = W_GetNumForName("FONTB_S") + 1;
}
//---------------------------------------------------------------------------
//
// PROC MN_DrTextA
//
// Draw text using font A.
//
//---------------------------------------------------------------------------
void MN_DrTextA(char *text, int x, int y)
{
char c;
patch_t *p;
while ((c = *text++) != 0)
{
if (c < 33)
{
x += 5;
}
else
{
p = W_CacheLumpNum(FontABaseLump + c - 33, PU_CACHE);
V_DrawPatch(x, y, p);
x += p->width - 1;
}
}
}
//---------------------------------------------------------------------------
//
// FUNC MN_TextAWidth
//
// Returns the pixel width of a string using font A.
//
//---------------------------------------------------------------------------
int MN_TextAWidth(char *text)
{
char c;
int width;
patch_t *p;
width = 0;
while ((c = *text++) != 0)
{
if (c < 33)
{
width += 5;
}
else
{
p = W_CacheLumpNum(FontABaseLump + c - 33, PU_CACHE);
width += p->width - 1;
}
}
return(width);
}
//---------------------------------------------------------------------------
//
// PROC MN_DrTextB
//
// Draw text using font B.
//
//---------------------------------------------------------------------------
void MN_DrTextB(char *text, int x, int y)
{
char c;
patch_t *p;
while ((c = *text++) != 0)
{
if (c < 33)
{
x += 8;
}
else
{
p = W_CacheLumpNum(FontBBaseLump + c - 33, PU_CACHE);
V_DrawPatch(x, y, p);
x += p->width - 1;
}
}
}
//---------------------------------------------------------------------------
//
// FUNC MN_TextBWidth
//
// Returns the pixel width of a string using font B.
//
//---------------------------------------------------------------------------
int MN_TextBWidth(char *text)
{
char c;
int width;
patch_t *p;
width = 0;
while ((c = *text++) != 0)
{
if (c < 33)
{
width += 5;
}
else
{
p = W_CacheLumpNum(FontBBaseLump + c - 33, PU_CACHE);
width += p->width - 1;
}
}
return(width);
}
//---------------------------------------------------------------------------
//
// PROC MN_Ticker
//
//---------------------------------------------------------------------------
void MN_Ticker(void)
{
if (MenuActive == false)
{
return;
}
MenuTime++;
}
//---------------------------------------------------------------------------
//
// PROC MN_Drawer
//
//---------------------------------------------------------------------------
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 DELETE THIS SAVE?" // FS
};
void MN_Drawer(void)
{
int i;
int x;
int y;
MenuItem_t *item;
char *selName;
if (MenuActive == false)
{
if (askforquit)
{
MN_DrTextA(QuitEndMsg[typeofask - 1], 160 -
MN_TextAWidth(QuitEndMsg[typeofask - 1]) / 2, 80);
if (typeofask == 3)
{
MN_DrTextA(SlotText[quicksave - 1], 160 -
MN_TextAWidth(SlotText[quicksave - 1]) / 2, 90);
MN_DrTextA("?", 160 +
MN_TextAWidth(SlotText[quicksave - 1]) / 2, 90);
}
if (typeofask == 4)
{
MN_DrTextA(SlotText[quickload - 1], 160 -
MN_TextAWidth(SlotText[quickload - 1]) / 2, 90);
MN_DrTextA("?", 160 +
MN_TextAWidth(SlotText[quickload - 1]) / 2, 90);
}
UpdateState |= I_FULLSCRN;
}
return;
}
else
{
UpdateState |= I_FULLSCRN;
if (InfoType)
{
MN_DrawInfo();
return;
}
if (screenblocks < 10)
{
BorderNeedRefresh = true;
}
if (CurrentMenu->drawFunc != NULL)
{
CurrentMenu->drawFunc();
}
x = CurrentMenu->x;
y = CurrentMenu->y;
item = CurrentMenu->items;
for (i = 0; i < CurrentMenu->itemCount; i++)
{
if (item->type != ITT_EMPTY && item->text)
{
MN_DrTextB(DEH_String(item->text), x, y); // FS: For HHE
}
y += ITEM_HEIGHT;
item++;
}
y = CurrentMenu->y + (CurrentItPos * ITEM_HEIGHT) + SELECTOR_YOFFSET;
selName = MenuTime & 16 ? "M_SLCTR1" : "M_SLCTR2";
V_DrawPatch(x + SELECTOR_XOFFSET, y,
W_CacheLumpName(selName, PU_CACHE));
}
}
//---------------------------------------------------------------------------
//
// PROC DrawMainMenu
//
//---------------------------------------------------------------------------
static void DrawMainMenu(void)
{
int frame;
frame = (MenuTime / 3) % 18;
V_DrawPatch(88, 0, W_CacheLumpName("M_HTIC", PU_CACHE));
V_DrawPatch(40, 10, W_CacheLumpNum(SkullBaseLump + (17 - frame),
PU_CACHE));
V_DrawPatch(232, 10, W_CacheLumpNum(SkullBaseLump + frame, PU_CACHE));
}
//---------------------------------------------------------------------------
//
// PROC DrawEpisodeMenu
//
//---------------------------------------------------------------------------
static void DrawEpisodeMenu(void)
{
}
//---------------------------------------------------------------------------
//
// PROC DrawSkillMenu
//
//---------------------------------------------------------------------------
static void DrawSkillMenu(void)
{
}
//---------------------------------------------------------------------------
//
// PROC DrawFilesMenu
//
//---------------------------------------------------------------------------
static void DrawFilesMenu(void)
{
// clear out the quicksave/quickload stuff
quicksave = 0;
quickload = 0;
players[consoleplayer].message = NULL;
players[consoleplayer].messageTics = 1;
}
//---------------------------------------------------------------------------
//
// PROC DrawLoadMenu
//
//---------------------------------------------------------------------------
static void DrawLoadMenu(void)
{
MN_DrTextB("LOAD GAME", 160 - MN_TextBWidth("LOAD GAME") / 2, 10);
if (!slottextloaded)
{
MN_LoadSlotText();
}
DrawFileSlots(&LoadMenu);
}
//---------------------------------------------------------------------------
//
// PROC DrawSaveMenu
//
//---------------------------------------------------------------------------
static void DrawSaveMenu(void)
{
MN_DrTextB("SAVE GAME", 160 - MN_TextBWidth("SAVE GAME") / 2, 10);
if (!slottextloaded)
{
MN_LoadSlotText();
}
DrawFileSlots(&SaveMenu);
}
//===========================================================================
//
// MN_LoadSlotText
//
// Loads in the text message for each slot
//===========================================================================
void MN_LoadSlotText(void)
{
FILE *fp;
int count;
int i;
char name[256];
for (i = 0; i < 6; i++)
{
if (cdrom)
{
sprintf(name, SAVEGAMENAMECD"%d.hsg", i);
}
else
{
sprintf(name, SAVEGAMENAME"%d.hsg", i);
}
fp = fopen(name, "rb+");
if (!fp)
{
SlotText[i][0] = 0; // empty the string
SlotStatus[i] = 0;
continue;
}
count = fread(&SlotText[i], SLOTTEXTLEN, 1, fp);
fclose(fp);
SlotStatus[i] = 1;
}
slottextloaded = true;
}
//---------------------------------------------------------------------------
//
// PROC DrawFileSlots
//
//---------------------------------------------------------------------------
static void DrawFileSlots(Menu_t *menu)
{
int i;
int x;
int y;
x = menu->x;
y = menu->y;
for (i = 0; i < 6; i++)
{
V_DrawPatch(x, y, W_CacheLumpName("M_FSLOT", PU_CACHE));
if (SlotStatus[i])
{
MN_DrTextA(SlotText[i], x + 5, y + 5);
}
y += ITEM_HEIGHT;
}
}
//---------------------------------------------------------------------------
//
// PROC DrawOptionsMenu
//
//---------------------------------------------------------------------------
static void DrawOptionsMenu(void)
{
extern int usePalFlash;
extern int headBob;
if (messageson)
{
MN_DrTextB("ON", 196, 35);
}
else
{
MN_DrTextB("OFF", 196, 35);
}
if (usePalFlash) // FS: Draw Pal Flash
{
MN_DrTextB("ON", 240, 55);
}
else
{
MN_DrTextB("OFF", 240, 55);
}
if (headBob) // FS: Headbob Toggle
{
MN_DrTextB("ON", 188, 75);
}
else
{
MN_DrTextB("OFF", 188, 75);
}
DrawSlider(&OptionsMenu, 5, 10, mouseSensitivity / 5); // FS: We using 20 now and was 3,10, etc..
}
//---------------------------------------------------------------------------
//
// PROC DrawOptions2Menu
//
//---------------------------------------------------------------------------
static void DrawOptions2Menu(void)
{
DrawSlider(&Options2Menu, 1, 9, screenblocks - 3);
DrawSlider(&Options2Menu, 3, 16, snd_MaxVolume);
DrawSlider(&Options2Menu, 5, 16, snd_MusicVolume);
}
//---------------------------------------------------------------------------
//
// PROC SCNetCheck
//
//---------------------------------------------------------------------------
static boolean SCNetCheck(int option)
{
if (!netgame)
{ // okay to go into the menu
return true;
}
if (NetGetPlayerCount() == 1)
return true;
switch (option)
{
case 1:
P_SetMessage(&players[consoleplayer],
"YOU CAN'T START A NEW GAME IN NETPLAY!", true);
break;
case 2:
P_SetMessage(&players[consoleplayer],
"YOU CAN'T LOAD A GAME IN NETPLAY!", true);
break;
default:
break;
}
MenuActive = false;
return false;
}
//---------------------------------------------------------------------------
//
// PROC SCQuitGame
//
//---------------------------------------------------------------------------
static boolean SCQuitGame(int option)
{
MenuActive = false;
askforquit = true;
typeofask = 1; //quit game
if (!netgame && !demoplayback)
{
paused = true;
}
return true;
}
static boolean M_DeleteSaveResponse(int ch) // FS: Ask if we want to delete the save game
{
MenuActive = false;
askforquit = true;
typeofask = 5;
return true;
}
//---------------------------------------------------------------------------
//
// PROC SCEndGame
//
//---------------------------------------------------------------------------
static boolean SCEndGame(int option)
{
if (demoplayback || netgame)
{
return false;
}
MenuActive = false;
askforquit = true;
typeofask = 2; //endgame
paused = true;
return true;
}
//---------------------------------------------------------------------------
//
// PROC SCMessages
//
//---------------------------------------------------------------------------
static boolean SCMessages(int option)
{
messageson ^= 1;
if (messageson)
{
P_SetMessage(&players[consoleplayer], DEH_String("MESSAGES ON"), true);
}
else
{
P_SetMessage(&players[consoleplayer], "MESSAGES OFF", true);
}
S_StartSound(NULL, sfx_chat);
return true;
}
static boolean SCPalFlashes(int option) // FS: Palette Flashes Toggle
{
extern int usePalFlash;
usePalFlash ^= 1;
if (usePalFlash)
{
P_SetMessage(&players[consoleplayer], "PALETTE FLASHES ON", true);
}
else
{
P_SetMessage(&players[consoleplayer], "PALETTE FLASHES OFF", true);
}
S_StartSound(NULL, sfx_chat);
return true;
}
static boolean SCHeadBob(int option) // FS: Headbob Toggle
{
extern int headBob;
headBob ^= 1;
if (headBob)
{
P_SetMessage(&players[consoleplayer], "HEADBOBBING ON", true);
}
else
{
P_SetMessage(&players[consoleplayer], "HEADBOBBING OFF", true);
}
S_StartSound(NULL, sfx_chat);
return true;
}
//---------------------------------------------------------------------------
//
// PROC SCLoadGame
//
//---------------------------------------------------------------------------
static boolean SCLoadGame(int option)
{
char name[256];
if (!SlotStatus[option])
{ // slot's empty...don't try and load
return false;
}
if (cdrom)
{
sprintf(name, SAVEGAMENAMECD"%d.hsg", option);
}
else
{
sprintf(name, SAVEGAMENAME"%d.hsg", option);
}
SaveMenu.oldItPos = option; // FS: Keep it consistent
G_LoadGame(name);
MN_DeactivateMenu();
BorderNeedRefresh = true;
if (quickload == -1)
{
quickload = option + 1;
players[consoleplayer].message = NULL;
players[consoleplayer].messageTics = 1;
}
return true;
}
//---------------------------------------------------------------------------
//
// PROC SCSaveGame
//
//---------------------------------------------------------------------------
static boolean SCSaveGame(int option)
{
char *ptr;
if (!FileMenuKeySteal)
{
FileMenuKeySteal = true;
strcpy(oldSlotText, SlotText[option]);
ptr = SlotText[option];
while (*ptr)
{
ptr++;
}
*ptr = '[';
*(ptr + 1) = 0;
SlotStatus[option]++;
currentSlot = option;
slotptr = ptr - SlotText[option];
return false;
}
else
{
LoadMenu.oldItPos = option; // FS: Keep it consistent
G_SaveGame(option, SlotText[option]);
FileMenuKeySteal = false;
MN_DeactivateMenu();
}
BorderNeedRefresh = true;
if (quicksave == -1)
{
quicksave = option + 1;
players[consoleplayer].message = NULL;
players[consoleplayer].messageTics = 1;
}
return true;
}
//---------------------------------------------------------------------------
//
// PROC SCEpisode
//
//---------------------------------------------------------------------------
static boolean SCEpisode(int option)
{
if (shareware && option > 1)
{
P_SetMessage(&players[consoleplayer],
"ONLY AVAILABLE IN THE REGISTERED VERSION", true);
}
else
{
MenuEpisode = option;
SetMenu(MENU_SKILL);
}
return true;
}
//---------------------------------------------------------------------------
//
// PROC SCSkill
//
//---------------------------------------------------------------------------
static boolean SCSkill(int option)
{
G_DeferedInitNew(option, MenuEpisode, 1);
MN_DeactivateMenu();
return true;
}
//---------------------------------------------------------------------------
//
// PROC SCMouseSensi
//
//---------------------------------------------------------------------------
static boolean SCMouseSensi(int option)
{
if (option == RIGHT_DIR)
{
if (mouseSensitivity < 50) // FS: Go up to 50
{
mouseSensitivity++;
}
}