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.

# Conflicts:
#	wadsrc/static/menudef.txt
This commit is contained in:
Alexander 2019-09-30 21:20:04 +07:00 committed by drfrag
parent b4d10d2f5b
commit a44f80c19d
2 changed files with 12 additions and 1 deletions

View file

@ -50,6 +50,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)
{
@ -89,9 +91,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] == '$')

View file

@ -1177,6 +1177,10 @@ OptionMenu "MiscOptions" protected
Option "$MISCMNU_CACHENODES", "gl_cachenodes", "OnOff"
Slider "$MISCMNU_CACHETIME", "gl_cachetime", 0.0, 2.0, 0.1
SafeCommand "$MISCMNU_CLEARNODECACHE", "clearnodecache"
StaticText " "
Option "$MISCMNU_QUICKEXIT", "m_quickexit", "OnOff"
IfOption(Windows)
{
StaticText " "