mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 05:01:41 +00:00
Added "Miscellaneous Options" -> "Save/Load confirmation" option (defaults to true). When disabled, confirmation dialog won't be shown when performing quicksave/quickload.
This commit is contained in:
parent
59ad6206de
commit
81a5273b58
4 changed files with 25 additions and 4 deletions
|
@ -2064,6 +2064,7 @@ FString G_BuildSaveName (const char *prefix, int slot)
|
|||
CVAR (Int, autosavenum, 0, CVAR_NOSET|CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
static int nextautosave = -1;
|
||||
CVAR (Int, disableautosave, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
CVAR (Bool, saveloadconfirmation, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) // [mxd]
|
||||
CUSTOM_CVAR (Int, autosavecount, 4, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
{
|
||||
if (self < 0)
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
|
||||
|
||||
extern FSaveGameNode *quickSaveSlot;
|
||||
EXTERN_CVAR (Bool, saveloadconfirmation) // [mxd]
|
||||
|
||||
class DMessageBoxMenu : public DMenu
|
||||
{
|
||||
|
@ -588,13 +589,22 @@ CCMD (quicksave)
|
|||
if (gamestate != GS_LEVEL)
|
||||
return;
|
||||
|
||||
S_Sound (CHAN_VOICE | CHAN_UI, "menu/activate", snd_menuvolume, ATTN_NONE);
|
||||
if (quickSaveSlot == NULL)
|
||||
{
|
||||
S_Sound(CHAN_VOICE | CHAN_UI, "menu/activate", snd_menuvolume, ATTN_NONE);
|
||||
M_StartControlPanel(false);
|
||||
M_SetMenu(NAME_Savegamemenu);
|
||||
return;
|
||||
}
|
||||
|
||||
// [mxd]. Just save the game, no questions asked.
|
||||
if (!saveloadconfirmation)
|
||||
{
|
||||
G_SaveGame(quickSaveSlot->Filename.GetChars(), quickSaveSlot->Title);
|
||||
return;
|
||||
}
|
||||
|
||||
S_Sound(CHAN_VOICE | CHAN_UI, "menu/activate", snd_menuvolume, ATTN_NONE);
|
||||
DMenu *newmenu = new DQuickSaveMenu(false);
|
||||
newmenu->mParentMenu = DMenu::CurrentMenu;
|
||||
M_ActivateMenu(newmenu);
|
||||
|
@ -666,22 +676,30 @@ void DQuickLoadMenu::HandleResult(bool res)
|
|||
|
||||
CCMD (quickload)
|
||||
{ // F9
|
||||
M_StartControlPanel (true);
|
||||
|
||||
if (netgame)
|
||||
{
|
||||
M_StartControlPanel(true);
|
||||
M_StartMessage (GStrings("QLOADNET"), 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (quickSaveSlot == NULL)
|
||||
{
|
||||
M_StartControlPanel(false);
|
||||
M_StartControlPanel(true);
|
||||
// signal that whatever gets loaded should be the new quicksave
|
||||
quickSaveSlot = (FSaveGameNode *)1;
|
||||
M_SetMenu(NAME_Loadgamemenu);
|
||||
return;
|
||||
}
|
||||
|
||||
// [mxd]. Just load the game, no questions asked.
|
||||
if (!saveloadconfirmation)
|
||||
{
|
||||
G_LoadGame(quickSaveSlot->Filename.GetChars());
|
||||
return;
|
||||
}
|
||||
|
||||
M_StartControlPanel(true);
|
||||
DMenu *newmenu = new DQuickLoadMenu(false);
|
||||
newmenu->mParentMenu = DMenu::CurrentMenu;
|
||||
M_ActivateMenu(newmenu);
|
||||
|
|
|
@ -1853,6 +1853,7 @@ MISCMNU_QUERYIWAD = "Show IWAD selection dialog";
|
|||
MISCMNU_ALLCHEATS = "Enable cheats from all games";
|
||||
MISCMNU_ENABLEAUTOSAVES = "Enable autosaves";
|
||||
MISCMNU_AUTOSAVECOUNT = "Number of autosaves";
|
||||
MISCMNU_SAVELOADCONFIRMATION = "Save/Load confirmation";
|
||||
MISCMNU_DEHLOAD = "Load *.deh/*.bex lumps";
|
||||
MISCMNU_CACHENODES = "Cache nodes";
|
||||
MISCMNU_CACHETIME = "Time threshold for node caching";
|
||||
|
|
|
@ -892,6 +892,7 @@ OptionMenu "MiscOptions"
|
|||
StaticText " "
|
||||
Option "$MISCMNU_ALLCHEATS", "allcheats", "OnOff"
|
||||
Option "$MISCMNU_ENABLEAUTOSAVES", "disableautosave", "Autosave"
|
||||
Option "$MISCMNU_SAVELOADCONFIRMATION", "saveloadconfirmation", "OnOff"
|
||||
Slider "$MISCMNU_AUTOSAVECOUNT", "autosavecount", 1, 20, 1, 0
|
||||
Option "$MISCMNU_DEHLOAD", "dehload", "dehopt"
|
||||
StaticText " "
|
||||
|
|
Loading…
Reference in a new issue