add m_quickexit option for quick exit in game menu

Default: off (false)

When this option is enabled (true), then exiting the game from
main menu and by menu_quit command doesn't require confirmation
and doesn't play sound.
This commit is contained in:
Alexander 2019-09-30 21:20:04 +07:00 committed by Christoph Oelckers
commit ff9715c080
2 changed files with 12 additions and 1 deletions

View file

@ -46,6 +46,8 @@
EXTERN_CVAR (Bool, saveloadconfirmation) // [mxd]
EXTERN_CVAR (Bool, quicksaverotation)
CVAR(Bool, m_quickexit, false, CVAR_ARCHIVE)
typedef void(*hfunc)();
DEFINE_ACTION_FUNCTION(DMessageBoxMenu, CallHandler)
{
@ -85,9 +87,14 @@ DMenu *CreateMessageBoxMenu(DMenu *parent, const char *message, int messagemode,
CCMD (menu_quit)
{ // F10
if (m_quickexit)
{
ST_Endoom();
}
M_StartControlPanel (true);
int messageindex = gametic % gameinfo.quitmessages.Size();
const size_t messageindex = static_cast<size_t>(gametic) % gameinfo.quitmessages.Size();
FString EndString;
const char *msg = gameinfo.quitmessages[messageindex];
if (msg[0] == '$')