mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-12 23:54:17 +00:00
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:
parent
0c2ed71cdd
commit
ff9715c080
2 changed files with 12 additions and 1 deletions
|
@ -46,6 +46,8 @@
|
||||||
EXTERN_CVAR (Bool, saveloadconfirmation) // [mxd]
|
EXTERN_CVAR (Bool, saveloadconfirmation) // [mxd]
|
||||||
EXTERN_CVAR (Bool, quicksaverotation)
|
EXTERN_CVAR (Bool, quicksaverotation)
|
||||||
|
|
||||||
|
CVAR(Bool, m_quickexit, false, CVAR_ARCHIVE)
|
||||||
|
|
||||||
typedef void(*hfunc)();
|
typedef void(*hfunc)();
|
||||||
DEFINE_ACTION_FUNCTION(DMessageBoxMenu, CallHandler)
|
DEFINE_ACTION_FUNCTION(DMessageBoxMenu, CallHandler)
|
||||||
{
|
{
|
||||||
|
@ -85,9 +87,14 @@ DMenu *CreateMessageBoxMenu(DMenu *parent, const char *message, int messagemode,
|
||||||
|
|
||||||
CCMD (menu_quit)
|
CCMD (menu_quit)
|
||||||
{ // F10
|
{ // F10
|
||||||
|
if (m_quickexit)
|
||||||
|
{
|
||||||
|
ST_Endoom();
|
||||||
|
}
|
||||||
|
|
||||||
M_StartControlPanel (true);
|
M_StartControlPanel (true);
|
||||||
|
|
||||||
int messageindex = gametic % gameinfo.quitmessages.Size();
|
const size_t messageindex = static_cast<size_t>(gametic) % gameinfo.quitmessages.Size();
|
||||||
FString EndString;
|
FString EndString;
|
||||||
const char *msg = gameinfo.quitmessages[messageindex];
|
const char *msg = gameinfo.quitmessages[messageindex];
|
||||||
if (msg[0] == '$')
|
if (msg[0] == '$')
|
||||||
|
|
|
@ -1202,6 +1202,10 @@ OptionMenu "MiscOptions" protected
|
||||||
SafeCommand "$MISCMNU_CLEARNODECACHE", "clearnodecache"
|
SafeCommand "$MISCMNU_CLEARNODECACHE", "clearnodecache"
|
||||||
StaticText " "
|
StaticText " "
|
||||||
Option "$OPTMNU_LANGUAGE", "language", "LanguageOptions"
|
Option "$OPTMNU_LANGUAGE", "language", "LanguageOptions"
|
||||||
|
|
||||||
|
StaticText " "
|
||||||
|
Option "$MISCMNU_QUICKEXIT", "m_quickexit", "OnOff"
|
||||||
|
|
||||||
IfOption(Windows)
|
IfOption(Windows)
|
||||||
{
|
{
|
||||||
StaticText " "
|
StaticText " "
|
||||||
|
|
Loading…
Reference in a new issue