From 8b7649c824a3bcf74a3f0b1bd3f0bcddd1490ab5 Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Wed, 4 Aug 2021 10:41:24 +0200 Subject: [PATCH] Restore all menu options to sane behavior Load/Save game is still not supported. --- README | 3 ++- cgdoom/d_englsh.h | 4 ++++ cgdoom/dstrings.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++ cgdoom/m_menu.c | 46 +++++++++++++++++------------------- cgdoom/st_stuff.c | 2 +- 5 files changed, 88 insertions(+), 27 deletions(-) create mode 100644 cgdoom/dstrings.c diff --git a/README b/README index 7474c29..644e84c 100644 --- a/README +++ b/README @@ -13,8 +13,9 @@ sources (GPL) and nDoom (GPLv2). See LICENSE. UI improvements TODO: -> Better keyboard layout (including more keys, eg. Run) --> Unlock entries of the game menu and options menu + => Edit messages accordingly ("press y"/etc) -> Warp to level from the main screen +-> Figure out why blue key looks yellow in status bar WAD support TODO: -> Unmodified 1.9 shareware WAD works all the way through? diff --git a/cgdoom/d_englsh.h b/cgdoom/d_englsh.h index af067ee..3a941ce 100644 --- a/cgdoom/d_englsh.h +++ b/cgdoom/d_englsh.h @@ -67,13 +67,17 @@ #define DETAILHI "High detail" #define DETAILLO "Low detail" +#define DETAILCGD "in cgdoom, press [+] or [-]\nto change detail level" #define GAMMALVL0 "Gamma correction OFF" #define GAMMALVL1 "Gamma correction level 1" #define GAMMALVL2 "Gamma correction level 2" #define GAMMALVL3 "Gamma correction level 3" #define GAMMALVL4 "Gamma correction level 4" +#define GAMMALV "Brightness: %d/4" #define EMPTYSTRING "empty slot" +#define NOTIMP "not implemented in cgdoom yet!" + // // P_inter.C // diff --git a/cgdoom/dstrings.c b/cgdoom/dstrings.c new file mode 100644 index 0000000..c3d9b19 --- /dev/null +++ b/cgdoom/dstrings.c @@ -0,0 +1,60 @@ +// Emacs style mode select -*- C++ -*- +//----------------------------------------------------------------------------- +// +// $Id:$ +// +// Copyright (C) 1993-1996 by id Software, Inc. +// +// This source is available for distribution and/or modification +// only under the terms of the DOOM Source Code License as +// published by id Software. All rights reserved. +// +// The source is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License +// for more details. +// +// $Log:$ +// +// DESCRIPTION: +// Globally defined strings. +// +//----------------------------------------------------------------------------- + +#include "dstrings.h" + + + +const char* endmsg[NUM_QUITMESSAGES+1]= +{ + // DOOM1 + QUITMSG, + "please don't leave, there's more\ndemons to toast!", + "let's beat it -- this is turning\ninto a bloodbath!", + "i wouldn't leave if i were you.\ndos is much worse.", + "you're trying to say you like dos\nbetter than me, right?", + "don't leave yet -- there's a\ndemon around that corner!", + "ya know, next time you come in here\ni'm gonna toast ya.", + "go ahead and leave. see if i care." + + // QuitDOOM II messages + "you want to quit?\nthen, thou hast lost an eighth!", + "don't go now, there's a \ndimensional shambler waiting\nat the dos prompt!", + "get outta here and go back\nto your boring programs.", + "if i were your boss, i'd \n deathmatch ya in a minute!", + "look, bud. you leave now\nand you forfeit your body count!", + "just leave. when you come\nback, i'll be waiting with a bat.", + "you're lucky i don't smack\nyou for thinking about leaving." + + // FinalDOOM? + "fuck you, pussy!\nget the fuck out!", + "you quit and i'll jizz\nin your cystholes!", + "if you leave, i'll make\nthe lord drink my jizz.", + "hey, ron! can we say\n'fuck' in the game?", + "i'd leave: this is just\nmore monsters and levels.\nwhat a load.", + "suck it down, asshole!\nyou're a fucking wimp!", + "don't quit now! we're \nstill spending your money!", + + // Internal debug. Different style, too. + "THIS IS NO MESSAGE!\nPage intentionally left blank." +}; diff --git a/cgdoom/m_menu.c b/cgdoom/m_menu.c index e871bf7..3579610 100644 --- a/cgdoom/m_menu.c +++ b/cgdoom/m_menu.c @@ -22,7 +22,6 @@ // //----------------------------------------------------------------------------- -//static const char #include "os.h" @@ -174,8 +173,8 @@ menu_t* currentMenu; 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_LoadGame(int choice); +void M_SaveGame(int choice); void M_Options(int choice); void M_EndGame(int choice); void M_ReadThis(int choice); @@ -241,10 +240,9 @@ enum menuitem_t MainMenu[]= { {1,"M_NGAME",M_NewGame,'n'}, -//CGD: hack to remove but keep menu size {1,"M_OPTION",M_Options,'o'}, - {1,"M_LOADG",M_NewGame/*M_LoadGame*/,'l'}, - {1,"M_SAVEG",M_NewGame/*M_SaveGame*/,'s'}, + {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'} @@ -506,6 +504,16 @@ void M_DrawLoad(void) */ +void M_LoadGame(int choice) +{ + M_StartMessage(NOTIMP, NULL, true); +} + +void M_SaveGame(int choice) +{ + M_StartMessage(NOTIMP, NULL, true); +} + // // Draw border for the savegame description // @@ -637,7 +645,7 @@ void M_DrawEpisode(void) void M_VerifyNightmare(int ch) { - if (ch != 'y') + if (ch != 'y' && ch != ' ' && ch != KEY_ENTER) return; G_DeferedInitNew((skill_t)nightmare,epi+1,1); @@ -724,7 +732,7 @@ void M_ChangeMessages(int choice) // void M_EndGameResponse(int ch) { - if (ch != 'y') + if (ch != 'y' && ch != ' ' && ch != KEY_ENTER) return; currentMenu->lastOn = itemOn; @@ -767,7 +775,7 @@ void M_FinishReadThis(int choice) void M_QuitResponse(int ch) { - if (ch != 'y') + if (ch != 'y' && ch != ' ' && ch != KEY_ENTER) return; I_Quit (); @@ -781,9 +789,9 @@ void M_QuitDOOM(int choice) choice = 0; // We pick index 0 which is language sensitive, // or one at random, between 1 and maximum number. - //sprintf(endstring,"%s\n\n"DOSY, endmsg[ (gametic%(NUM_QUITMESSAGES-2))+1 ]); + sprintf(endstring,"%s\n\n"DOSY, endmsg[ (gametic%(NUM_QUITMESSAGES-2))+1 ]); -// M_StartMessage(QUITMSG/*endstring*/,(void *)M_QuitResponse,true); + M_StartMessage(endstring,(void *)M_QuitResponse,true); } @@ -810,19 +818,7 @@ void M_ChangeSensitivity(int choice) void M_ChangeDetail(int choice) { choice = 0; - detailLevel = 1 - detailLevel; - - // FIXME - does not work. Remove anyway? - //printf( "M_ChangeDetail: low detail mode n.a.\n"); - - return; - - /*R_SetViewSize (screenblocks, detailLevel); - - if (!detailLevel) - players[consoleplayer].message = DETAILHI; - else - players[consoleplayer].message = DETAILLO;*/ + M_StartMessage(DETAILCGD,NULL,true); } // @@ -996,7 +992,7 @@ boolean M_Responder (event_t* ev) if (messageToPrint) { if (messageNeedsInput == true && - !(ch == ' ' || ch == 'n' || ch == 'y' || ch == KEY_ESCAPE)) + !(ch == ' ' || ch == 'n' || ch == 'y' || ch == KEY_ESCAPE || ch == KEY_ENTER)) return false; menuactive = (boolean)messageLastMenuActive; diff --git a/cgdoom/st_stuff.c b/cgdoom/st_stuff.c index d9562f1..63a0088 100644 --- a/cgdoom/st_stuff.c +++ b/cgdoom/st_stuff.c @@ -502,7 +502,7 @@ void CGCycleGamma() I_SetPalette(usegamma); static char message[32]; - sprintf(message, "Brightness: %d/4", usegamma); + sprintf(message, GAMMALV, usegamma); plyr->message = message; }