dp_doom: disable screen size up/down and save/load keybindings

This commit is contained in:
oxmox 2023-03-03 05:54:47 +01:00
parent a85d8bb821
commit 93b401420c

View file

@ -1,4 +1,4 @@
// Emacs style mode select -*- C++ -*- // Emacs style mode select -*- C++ -*-
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Id:$ // $Id:$
@ -71,14 +71,14 @@ int mouseSensitivity; // has default
// Show messages has default, 0 = off, 1 = on // Show messages has default, 0 = off, 1 = on
int showMessages; int showMessages;
// Blocky mode, has default, 0 = high, 1 = normal // Blocky mode, has default, 0 = high, 1 = normal
int detailLevel; int detailLevel;
int screenblocks; // has default int screenblocks; // has default
// temp for screenblocks (0-9) // temp for screenblocks (0-9)
int screenSize; int screenSize;
// Maximum volume of a sound effect. // Maximum volume of a sound effect.
// Internal default is max out of 0-15. // Internal default is max out of 0-15.
@ -88,20 +88,20 @@ int sfxVolume = 15;
int musicVolume = 15; int musicVolume = 15;
// -1 = no quicksave slot picked! // -1 = no quicksave slot picked!
int quickSaveSlot; int quickSaveSlot;
// 1 = message to be printed // 1 = message to be printed
int messageToPrint; int messageToPrint;
// ...and here is the message string! // ...and here is the message string!
const char* messageString; const char* messageString;
// message x & y // message x & y
int messx; int messx;
int messy; int messy;
int messageLastMenuActive; int messageLastMenuActive;
// timed message = no input from user // timed message = no input from user
boolean messageNeedsInput; boolean messageNeedsInput;
void (*messageRoutine)(int response); void (*messageRoutine)(int response);
@ -117,11 +117,11 @@ char gammamsg[5][26] =
}; };
// we are going to be entering a savegame string // we are going to be entering a savegame string
int saveStringEnter; int saveStringEnter;
int saveSlot; // which slot to save in int saveSlot; // which slot to save in
int saveCharIndex; // which char we're editing int saveCharIndex; // which char we're editing
// old save description before edit // old save description before edit
char saveOldString[SAVESTRINGSIZE]; char saveOldString[SAVESTRINGSIZE];
boolean inhelpscreens; boolean inhelpscreens;
boolean menuactive; boolean menuactive;
@ -142,16 +142,16 @@ typedef struct
{ {
// 0 = no cursor here, 1 = ok, 2 = arrows ok // 0 = no cursor here, 1 = ok, 2 = arrows ok
short status; short status;
char name[10]; char name[10];
// choice = menu item #. // choice = menu item #.
// if status = 2, // if status = 2,
// choice=0:leftarrow,1:rightarrow // choice=0:leftarrow,1:rightarrow
void (*routine)(int choice); void (*routine)(int choice);
// hotkey in menu // hotkey in menu
char alphaKey; char alphaKey;
} menuitem_t; } menuitem_t;
@ -176,7 +176,7 @@ short whichSkull; // which skull to draw
char skullName[2][/*8*/9] = {"M_SKULL1","M_SKULL2"}; char skullName[2][/*8*/9] = {"M_SKULL1","M_SKULL2"};
// current menudef // current menudef
menu_t* currentMenu; menu_t* currentMenu;
// //
// PROTOTYPES // PROTOTYPES
@ -514,7 +514,7 @@ void M_ReadSaveStrings(void)
FILE* handle; FILE* handle;
int i; int i;
char name[256]; char name[256];
for (i = 0;i < load_end;i++) for (i = 0;i < load_end;i++)
{ {
if (M_CheckParm("-cdrom")) if (M_CheckParm("-cdrom"))
@ -542,7 +542,7 @@ void M_ReadSaveStrings(void)
void M_DrawLoad(void) void M_DrawLoad(void)
{ {
int i; int i;
V_DrawPatchDirect (72,28,0,W_CacheLumpName("M_LOADG",PU_CACHE)); V_DrawPatchDirect (72,28,0,W_CacheLumpName("M_LOADG",PU_CACHE));
for (i = 0;i < load_end; i++) for (i = 0;i < load_end; i++)
{ {
@ -559,9 +559,9 @@ void M_DrawLoad(void)
void M_DrawSaveLoadBorder(int x,int y) void M_DrawSaveLoadBorder(int x,int y)
{ {
int i; int i;
V_DrawPatchDirect (x-8,y+7,0,W_CacheLumpName("M_LSLEFT",PU_CACHE)); V_DrawPatchDirect (x-8,y+7,0,W_CacheLumpName("M_LSLEFT",PU_CACHE));
for (i = 0;i < 24;i++) for (i = 0;i < 24;i++)
{ {
V_DrawPatchDirect (x,y+7,0,W_CacheLumpName("M_LSCNTR",PU_CACHE)); V_DrawPatchDirect (x,y+7,0,W_CacheLumpName("M_LSCNTR",PU_CACHE));
@ -579,7 +579,7 @@ void M_DrawSaveLoadBorder(int x,int y)
void M_LoadSelect(int choice) void M_LoadSelect(int choice)
{ {
char name[256]; char name[256];
if (M_CheckParm("-cdrom")) if (M_CheckParm("-cdrom"))
sprintf(name,"c:\\doomdata\\"SAVEGAMENAME"%d.dsg",choice); sprintf(name,"c:\\doomdata\\"SAVEGAMENAME"%d.dsg",choice);
else else
@ -600,7 +600,7 @@ void M_LoadGame (int choice)
M_StartMessage(LOADNET,NULL,false); M_StartMessage(LOADNET,NULL,false);
return; return;
} }
M_SetupNextMenu(&LoadDef); M_SetupNextMenu(&LoadDef);
M_ReadSaveStrings(); M_ReadSaveStrings();
} }
@ -612,14 +612,14 @@ void M_LoadGame (int choice)
void M_DrawSave(void) void M_DrawSave(void)
{ {
int i; int i;
V_DrawPatchDirect (72,28,0,W_CacheLumpName("M_SAVEG",PU_CACHE)); V_DrawPatchDirect (72,28,0,W_CacheLumpName("M_SAVEG",PU_CACHE));
for (i = 0;i < load_end; i++) for (i = 0;i < load_end; i++)
{ {
M_DrawSaveLoadBorder(LoadDef.x,LoadDef.y+LINEHEIGHT*i); M_DrawSaveLoadBorder(LoadDef.x,LoadDef.y+LINEHEIGHT*i);
M_WriteText(LoadDef.x,LoadDef.y+LINEHEIGHT*i,savegamestrings[i]); M_WriteText(LoadDef.x,LoadDef.y+LINEHEIGHT*i,savegamestrings[i]);
} }
if (saveStringEnter) if (saveStringEnter)
{ {
i = M_StringWidth(savegamestrings[saveSlot]); i = M_StringWidth(savegamestrings[saveSlot]);
@ -647,7 +647,7 @@ void M_SaveSelect(int choice)
{ {
// we are going to be intercepting all chars // we are going to be intercepting all chars
saveStringEnter = 1; saveStringEnter = 1;
saveSlot = choice; saveSlot = choice;
strcpy(saveOldString,savegamestrings[choice]); strcpy(saveOldString,savegamestrings[choice]);
if (!strcmp(savegamestrings[choice],EMPTYSTRING)) if (!strcmp(savegamestrings[choice],EMPTYSTRING))
@ -667,10 +667,10 @@ void M_SaveGame (int choice)
M_StartMessage(SAVEDEAD,NULL,false); M_StartMessage(SAVEDEAD,NULL,false);
return; return;
} }
if (gamestate != GS_LEVEL) if (gamestate != GS_LEVEL)
return; return;
M_SetupNextMenu(&SaveDef); M_SetupNextMenu(&SaveDef);
M_ReadSaveStrings(); M_ReadSaveStrings();
} }
@ -701,7 +701,7 @@ void M_QuickSave(void)
if (gamestate != GS_LEVEL) if (gamestate != GS_LEVEL)
return; return;
if (quickSaveSlot < 0) if (quickSaveSlot < 0)
{ {
M_StartControlPanel(); M_StartControlPanel();
@ -736,7 +736,7 @@ void M_QuickLoad(void)
M_StartMessage(QLOADNET,NULL,false); M_StartMessage(QLOADNET,NULL,false);
return; return;
} }
if (quickSaveSlot < 0) if (quickSaveSlot < 0)
{ {
M_StartMessage(QSAVESPOT,NULL,false); M_StartMessage(QSAVESPOT,NULL,false);
@ -832,7 +832,7 @@ void M_SfxVol(int choice)
sfxVolume++; sfxVolume++;
break; break;
} }
S_SetSfxVolume(sfxVolume*8); S_SetSfxVolume(sfxVolume*8);
} }
@ -849,7 +849,7 @@ void M_MusicVol(int choice)
musicVolume++; musicVolume++;
break; break;
} }
S_SetMusicVolume(musicVolume*8); S_SetMusicVolume(musicVolume*8);
} }
@ -885,7 +885,7 @@ void M_NewGame(int choice)
M_StartMessage(NEWGAME,NULL,false); M_StartMessage(NEWGAME,NULL,false);
return; return;
} }
if ( gamemode == commercial ) if ( gamemode == commercial )
M_SetupNextMenu(&NewDef); M_SetupNextMenu(&NewDef);
else else
@ -907,7 +907,7 @@ void M_VerifyNightmare(int ch)
{ {
if (ch != 'y') if (ch != 'y')
return; return;
G_DeferedInitNew(sk_nightmare,epi+1,1); G_DeferedInitNew(sk_nightmare,epi+1,1);
M_ClearMenus (); M_ClearMenus ();
} }
@ -919,7 +919,7 @@ void M_ChooseSkill(int choice)
M_StartMessage(NIGHTMARE,M_VerifyNightmare,true); M_StartMessage(NIGHTMARE,M_VerifyNightmare,true);
return; return;
} }
G_DeferedInitNew(choice,epi+1,1); G_DeferedInitNew(choice,epi+1,1);
M_ClearMenus (); M_ClearMenus ();
} }
@ -942,7 +942,7 @@ void M_Episode(int choice)
"M_Episode: 4th episode requires UltimateDOOM\n"); "M_Episode: 4th episode requires UltimateDOOM\n");
choice = 0; choice = 0;
} }
epi = choice; epi = choice;
M_SetupNextMenu(&NewDef); M_SetupNextMenu(&NewDef);
} }
@ -959,7 +959,7 @@ char msgNames[2][9] = {"M_MSGOFF","M_MSGON"};
void M_DrawOptions(void) void M_DrawOptions(void)
{ {
V_DrawPatchDirect (108,15,0,W_CacheLumpName("M_OPTTTL",PU_CACHE)); V_DrawPatchDirect (108,15,0,W_CacheLumpName("M_OPTTTL",PU_CACHE));
V_DrawPatchDirect (OptionsDef.x + 175,OptionsDef.y+LINEHEIGHT*detail,0, V_DrawPatchDirect (OptionsDef.x + 175,OptionsDef.y+LINEHEIGHT*detail,0,
W_CacheLumpName(detailNames[detailLevel],PU_CACHE)); W_CacheLumpName(detailNames[detailLevel],PU_CACHE));
@ -968,7 +968,7 @@ void M_DrawOptions(void)
M_DrawThermo(OptionsDef.x,OptionsDef.y+LINEHEIGHT*(mousesens+1), M_DrawThermo(OptionsDef.x,OptionsDef.y+LINEHEIGHT*(mousesens+1),
10,mouseSensitivity); 10,mouseSensitivity);
M_DrawThermo(OptionsDef.x,OptionsDef.y+LINEHEIGHT*(scrnsize+1), M_DrawThermo(OptionsDef.x,OptionsDef.y+LINEHEIGHT*(scrnsize+1),
9,screenSize); 9,screenSize);
} }
@ -991,7 +991,7 @@ void M_ChangeMessages(int choice)
(void)choice; (void)choice;
showMessages = 1 - showMessages; showMessages = 1 - showMessages;
if (!showMessages) if (!showMessages)
players[consoleplayer].message = MSGOFF; players[consoleplayer].message = MSGOFF;
else else
@ -1008,7 +1008,7 @@ void M_EndGameResponse(int ch)
{ {
if (ch != 'y') if (ch != 'y')
return; return;
currentMenu->lastOn = itemOn; currentMenu->lastOn = itemOn;
M_ClearMenus (); M_ClearMenus ();
D_StartTitle (); D_StartTitle ();
@ -1023,13 +1023,13 @@ void M_EndGame(int choice)
S_StartSound(NULL,sfx_oof); S_StartSound(NULL,sfx_oof);
return; return;
} }
if (netgame) if (netgame)
{ {
M_StartMessage(NETEND,NULL,false); M_StartMessage(NETEND,NULL,false);
return; return;
} }
M_StartMessage(ENDGAME,M_EndGameResponse,true); M_StartMessage(ENDGAME,M_EndGameResponse,true);
} }
@ -1120,7 +1120,7 @@ void M_QuitDOOM(int choice)
sprintf(endstring,"%s\n\n"DOSY, endmsg[0] ); sprintf(endstring,"%s\n\n"DOSY, endmsg[0] );
else else
sprintf(endstring,"%s\n\n"DOSY, endmsg[gametic%NUM_QUITMESSAGES]); sprintf(endstring,"%s\n\n"DOSY, endmsg[gametic%NUM_QUITMESSAGES]);
M_StartMessage(endstring,M_QuitResponse,true); M_StartMessage(endstring,M_QuitResponse,true);
} }
@ -1181,7 +1181,7 @@ void M_SizeDisplay(int choice)
} }
break; break;
} }
R_SetViewSize (screenblocks, detailLevel); R_SetViewSize (screenblocks, detailLevel);
} }
@ -1270,7 +1270,7 @@ int M_StringWidth(const char* string)
size_t i; size_t i;
int w = 0; int w = 0;
int c; int c;
for (i = 0;i < strlen(string);i++) for (i = 0;i < strlen(string);i++)
{ {
c = toupper(string[i]) - HU_FONTSTART; c = toupper(string[i]) - HU_FONTSTART;
@ -1279,7 +1279,7 @@ int M_StringWidth(const char* string)
else else
w += SHORT (hu_font[c]->width); w += SHORT (hu_font[c]->width);
} }
return w; return w;
} }
@ -1293,12 +1293,12 @@ int M_StringHeight(const char* string)
size_t i; size_t i;
int h; int h;
int height = SHORT(hu_font[0]->height); int height = SHORT(hu_font[0]->height);
h = height; h = height;
for (i = 0;i < strlen(string);i++) for (i = 0;i < strlen(string);i++)
if (string[i] == '\n') if (string[i] == '\n')
h += height; h += height;
return h; return h;
} }
@ -1317,12 +1317,12 @@ M_WriteText
int c; int c;
int cx; int cx;
int cy; int cy;
ch = string; ch = string;
cx = x; cx = x;
cy = y; cy = y;
while(1) while(1)
{ {
c = *ch++; c = *ch++;
@ -1334,14 +1334,14 @@ M_WriteText
cy += 12; cy += 12;
continue; continue;
} }
c = toupper(c) - HU_FONTSTART; c = toupper(c) - HU_FONTSTART;
if (c < 0 || c>= HU_FONTSIZE) if (c < 0 || c>= HU_FONTSIZE)
{ {
cx += 4; cx += 4;
continue; continue;
} }
w = SHORT (hu_font[c]->width); w = SHORT (hu_font[c]->width);
if (cx+w > SCREENWIDTH) if (cx+w > SCREENWIDTH)
break; break;
@ -1369,9 +1369,9 @@ boolean M_Responder (event_t* ev)
static int lasty = 0; static int lasty = 0;
static int mousex = 0; static int mousex = 0;
static int lastx = 0; static int lastx = 0;
ch = -1; ch = -1;
if (ev->type == ev_joystick && joywait < I_GetTime()) if (ev->type == ev_joystick && joywait < I_GetTime())
{ {
if (ev->data3 == -1) if (ev->data3 == -1)
@ -1384,7 +1384,7 @@ boolean M_Responder (event_t* ev)
ch = KEY_DOWNARROW; ch = KEY_DOWNARROW;
joywait = I_GetTime() + 5; joywait = I_GetTime() + 5;
} }
if (ev->data2 == -1) if (ev->data2 == -1)
{ {
ch = KEY_LEFTARROW; ch = KEY_LEFTARROW;
@ -1395,7 +1395,7 @@ boolean M_Responder (event_t* ev)
ch = KEY_RIGHTARROW; ch = KEY_RIGHTARROW;
joywait = I_GetTime() + 2; joywait = I_GetTime() + 2;
} }
if (ev->data1&1) if (ev->data1&1)
{ {
ch = KEY_ENTER; ch = KEY_ENTER;
@ -1424,7 +1424,7 @@ boolean M_Responder (event_t* ev)
mousewait = I_GetTime() + 5; mousewait = I_GetTime() + 5;
mousey = lasty += 30; mousey = lasty += 30;
} }
mousex += ev->data2; mousex += ev->data2;
if (mousex < lastx-30) if (mousex < lastx-30)
{ {
@ -1438,13 +1438,13 @@ boolean M_Responder (event_t* ev)
mousewait = I_GetTime() + 5; mousewait = I_GetTime() + 5;
mousex = lastx += 30; mousex = lastx += 30;
} }
if (ev->data1&1) if (ev->data1&1)
{ {
ch = KEY_ENTER; ch = KEY_ENTER;
mousewait = I_GetTime() + 15; mousewait = I_GetTime() + 15;
} }
if (ev->data1&2) if (ev->data1&2)
{ {
ch = KEY_BACKSPACE; ch = KEY_BACKSPACE;
@ -1457,11 +1457,11 @@ boolean M_Responder (event_t* ev)
ch = ev->data1; ch = ev->data1;
} }
} }
if (ch == -1) if (ch == -1)
return false; return false;
// Save Game string input // Save Game string input
if (saveStringEnter) if (saveStringEnter)
{ {
@ -1474,18 +1474,18 @@ boolean M_Responder (event_t* ev)
savegamestrings[saveSlot][saveCharIndex] = 0; savegamestrings[saveSlot][saveCharIndex] = 0;
} }
break; break;
case KEY_ESCAPE: case KEY_ESCAPE:
saveStringEnter = 0; saveStringEnter = 0;
strcpy(&savegamestrings[saveSlot][0],saveOldString); strcpy(&savegamestrings[saveSlot][0],saveOldString);
break; break;
case KEY_ENTER: case KEY_ENTER:
saveStringEnter = 0; saveStringEnter = 0;
if (savegamestrings[saveSlot][0]) if (savegamestrings[saveSlot][0])
M_DoSave(saveSlot); M_DoSave(saveSlot);
break; break;
default: default:
ch = toupper(ch); ch = toupper(ch);
if (ch != 32) if (ch != 32)
@ -1503,49 +1503,53 @@ boolean M_Responder (event_t* ev)
} }
return true; return true;
} }
// Take care of any messages that need input // Take care of any messages that need input
if (messageToPrint) if (messageToPrint)
{ {
if (messageNeedsInput == true && if (messageNeedsInput == true &&
!(ch == ' ' || ch == 'n' || ch == 'y' || ch == KEY_ESCAPE)) !(ch == ' ' || ch == 'n' || ch == 'y' || ch == KEY_ESCAPE))
return false; return false;
menuactive = messageLastMenuActive; menuactive = messageLastMenuActive;
messageToPrint = 0; messageToPrint = 0;
if (messageRoutine) if (messageRoutine)
messageRoutine(ch); messageRoutine(ch);
menuactive = false; menuactive = false;
S_StartSound(NULL,sfx_swtchx); S_StartSound(NULL,sfx_swtchx);
return true; return true;
} }
#if 0
if (devparm && ch == KEY_F1) if (devparm && ch == KEY_F1)
{ {
G_ScreenShot (); G_ScreenShot ();
return true; return true;
} }
#endif
// F-Keys // F-Keys
if (!menuactive) if (!menuactive)
switch(ch) switch(ch)
{ {
#if 0
case KEY_MINUS: // Screen size down case KEY_MINUS: // Screen size down
if (automapactive || chat_on) if (automapactive || chat_on)
return false; return false;
M_SizeDisplay(0); M_SizeDisplay(0);
S_StartSound(NULL,sfx_stnmov); S_StartSound(NULL,sfx_stnmov);
return true; return true;
case KEY_EQUALS: // Screen size up case KEY_EQUALS: // Screen size up
if (automapactive || chat_on) if (automapactive || chat_on)
return false; return false;
M_SizeDisplay(1); M_SizeDisplay(1);
S_StartSound(NULL,sfx_stnmov); S_StartSound(NULL,sfx_stnmov);
return true; return true;
#endif
case KEY_F1: // Help key case KEY_F1: // Help key
M_StartControlPanel (); M_StartControlPanel ();
@ -1553,60 +1557,62 @@ boolean M_Responder (event_t* ev)
currentMenu = &ReadDef2; currentMenu = &ReadDef2;
else else
currentMenu = &ReadDef1; currentMenu = &ReadDef1;
itemOn = 0; itemOn = 0;
S_StartSound(NULL,sfx_swtchn); S_StartSound(NULL,sfx_swtchn);
return true; return true;
#if 0
case KEY_F2: // Save case KEY_F2: // Save
M_StartControlPanel(); M_StartControlPanel();
S_StartSound(NULL,sfx_swtchn); S_StartSound(NULL,sfx_swtchn);
M_SaveGame(0); M_SaveGame(0);
return true; return true;
case KEY_F3: // Load case KEY_F3: // Load
M_StartControlPanel(); M_StartControlPanel();
S_StartSound(NULL,sfx_swtchn); S_StartSound(NULL,sfx_swtchn);
M_LoadGame(0); M_LoadGame(0);
return true; return true;
#endif
case KEY_F4: // Sound Volume case KEY_F4: // Sound Volume
M_StartControlPanel (); M_StartControlPanel ();
currentMenu = &SoundDef; currentMenu = &SoundDef;
itemOn = sfx_vol; itemOn = sfx_vol;
S_StartSound(NULL,sfx_swtchn); S_StartSound(NULL,sfx_swtchn);
return true; return true;
case KEY_F5: // Detail toggle case KEY_F5: // Detail toggle
M_ChangeDetail(0); M_ChangeDetail(0);
S_StartSound(NULL,sfx_swtchn); S_StartSound(NULL,sfx_swtchn);
return true; return true;
case KEY_F6: // Quicksave case KEY_F6: // Quicksave
S_StartSound(NULL,sfx_swtchn); S_StartSound(NULL,sfx_swtchn);
M_QuickSave(); M_QuickSave();
return true; return true;
case KEY_F7: // End game case KEY_F7: // End game
S_StartSound(NULL,sfx_swtchn); S_StartSound(NULL,sfx_swtchn);
M_EndGame(0); M_EndGame(0);
return true; return true;
case KEY_F8: // Toggle messages case KEY_F8: // Toggle messages
M_ChangeMessages(0); M_ChangeMessages(0);
S_StartSound(NULL,sfx_swtchn); S_StartSound(NULL,sfx_swtchn);
return true; return true;
case KEY_F9: // Quickload case KEY_F9: // Quickload
S_StartSound(NULL,sfx_swtchn); S_StartSound(NULL,sfx_swtchn);
M_QuickLoad(); M_QuickLoad();
return true; return true;
case KEY_F10: // Quit DOOM case KEY_F10: // Quit DOOM
S_StartSound(NULL,sfx_swtchn); S_StartSound(NULL,sfx_swtchn);
M_QuitDOOM(0); M_QuitDOOM(0);
return true; return true;
case KEY_F11: // gamma toggle case KEY_F11: // gamma toggle
usegamma++; usegamma++;
if (usegamma > 4) if (usegamma > 4)
@ -1614,10 +1620,10 @@ boolean M_Responder (event_t* ev)
players[consoleplayer].message = gammamsg[usegamma]; players[consoleplayer].message = gammamsg[usegamma];
I_SetPalette (W_CacheLumpName ("PLAYPAL",PU_CACHE)); I_SetPalette (W_CacheLumpName ("PLAYPAL",PU_CACHE));
return true; return true;
} }
// Pop-up menu? // Pop-up menu?
if (!menuactive) if (!menuactive)
{ {
@ -1630,7 +1636,7 @@ boolean M_Responder (event_t* ev)
return false; return false;
} }
// Keys usable within menu // Keys usable within menu
switch (ch) switch (ch)
{ {
@ -1643,7 +1649,7 @@ boolean M_Responder (event_t* ev)
S_StartSound(NULL,sfx_pstop); S_StartSound(NULL,sfx_pstop);
} while(currentMenu->menuitems[itemOn].status==-1); } while(currentMenu->menuitems[itemOn].status==-1);
return true; return true;
case KEY_UPARROW: case KEY_UPARROW:
do do
{ {
@ -1662,7 +1668,7 @@ boolean M_Responder (event_t* ev)
currentMenu->menuitems[itemOn].routine(0); currentMenu->menuitems[itemOn].routine(0);
} }
return true; return true;
case KEY_RIGHTARROW: case KEY_RIGHTARROW:
if (currentMenu->menuitems[itemOn].routine && if (currentMenu->menuitems[itemOn].routine &&
currentMenu->menuitems[itemOn].status == 2) currentMenu->menuitems[itemOn].status == 2)
@ -1689,13 +1695,13 @@ boolean M_Responder (event_t* ev)
} }
} }
return true; return true;
case KEY_ESCAPE: case KEY_ESCAPE:
currentMenu->lastOn = itemOn; currentMenu->lastOn = itemOn;
M_ClearMenus (); M_ClearMenus ();
S_StartSound(NULL,sfx_swtchx); S_StartSound(NULL,sfx_swtchx);
return true; return true;
case KEY_BACKSPACE: case KEY_BACKSPACE:
currentMenu->lastOn = itemOn; currentMenu->lastOn = itemOn;
if (currentMenu->prevMenu) if (currentMenu->prevMenu)
@ -1705,7 +1711,7 @@ boolean M_Responder (event_t* ev)
S_StartSound(NULL,sfx_swtchn); S_StartSound(NULL,sfx_swtchn);
} }
return true; return true;
default: default:
for (i = itemOn+1;i < currentMenu->numitems;i++) for (i = itemOn+1;i < currentMenu->numitems;i++)
if (currentMenu->menuitems[i].alphaKey == ch) if (currentMenu->menuitems[i].alphaKey == ch)
@ -1722,7 +1728,7 @@ boolean M_Responder (event_t* ev)
return true; return true;
} }
break; break;
} }
return false; return false;
@ -1738,7 +1744,7 @@ void M_StartControlPanel (void)
// intro might call this repeatedly // intro might call this repeatedly
if (menuactive) if (menuactive)
return; return;
I_GrabMouse(false); I_GrabMouse(false);
menuactive = 1; menuactive = 1;
@ -1763,7 +1769,7 @@ void M_Drawer (void)
inhelpscreens = false; inhelpscreens = false;
// Horiz. & Vertically center string and print it. // Horiz. & Vertically center string and print it.
if (messageToPrint) if (messageToPrint)
{ {
@ -1779,13 +1785,13 @@ void M_Drawer (void)
start += i+1; start += i+1;
break; break;
} }
if (i == strlen(messageString+start)) if (i == strlen(messageString+start))
{ {
strcpy(string,messageString+start); strcpy(string,messageString+start);
start += i; start += i;
} }
x = 160 - M_StringWidth(string)/2; x = 160 - M_StringWidth(string)/2;
M_WriteText(x,y,string); M_WriteText(x,y,string);
y += SHORT(hu_font[0]->height); y += SHORT(hu_font[0]->height);
@ -1798,7 +1804,7 @@ void M_Drawer (void)
if (currentMenu->routine) if (currentMenu->routine)
currentMenu->routine(); // call Draw routine currentMenu->routine(); // call Draw routine
// DRAW MENU // DRAW MENU
x = currentMenu->x; x = currentMenu->x;
y = currentMenu->y; y = currentMenu->y;
@ -1812,7 +1818,7 @@ void M_Drawer (void)
y += LINEHEIGHT; y += LINEHEIGHT;
} }
// DRAW SKULL // DRAW SKULL
V_DrawPatchDirect(x + SKULLXOFF,currentMenu->y - 5 + itemOn*LINEHEIGHT, 0, V_DrawPatchDirect(x + SKULLXOFF,currentMenu->y - 5 + itemOn*LINEHEIGHT, 0,
W_CacheLumpName(skullName[whichSkull],PU_CACHE)); W_CacheLumpName(skullName[whichSkull],PU_CACHE));
@ -1877,7 +1883,7 @@ void M_Init (void)
// Here we could catch other version dependencies, // Here we could catch other version dependencies,
// like HELP1/2, and four episodes. // like HELP1/2, and four episodes.
switch ( gamemode ) switch ( gamemode )
{ {
case commercial: case commercial:
@ -1905,6 +1911,5 @@ void M_Init (void)
default: default:
break; break;
} }
}
}