Merge pull request #899 from khutchins/master

Adds option to use a quicksave rotation
This commit is contained in:
Christoph Oelckers 2019-07-28 08:44:21 +02:00 committed by GitHub
commit c577f1d743
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 58 additions and 9 deletions

View file

@ -318,7 +318,7 @@ DEFINE_ACTION_FUNCTION(FSavegameManager, ReadSaveStrings)
//
//=============================================================================
void FSavegameManager::NotifyNewSave(const FString &file, const FString &title, bool okForQuicksave)
void FSavegameManager::NotifyNewSave(const FString &file, const FString &title, bool okForQuicksave, bool forceQuicksave)
{
FSaveGameNode *node;
@ -342,7 +342,7 @@ void FSavegameManager::NotifyNewSave(const FString &file, const FString &title,
node->bMissingWads = false;
if (okForQuicksave)
{
if (quickSaveSlot == nullptr) quickSaveSlot = node;
if (quickSaveSlot == nullptr || forceQuicksave) quickSaveSlot = node;
LastAccessed = LastSaved = i;
}
return;
@ -358,7 +358,7 @@ void FSavegameManager::NotifyNewSave(const FString &file, const FString &title,
if (okForQuicksave)
{
if (quickSaveSlot == nullptr) quickSaveSlot = node;
if (quickSaveSlot == nullptr || forceQuicksave) quickSaveSlot = node;
LastAccessed = LastSaved = index;
}
}

View file

@ -84,7 +84,7 @@ public:
private:
int InsertSaveNode(FSaveGameNode *node);
public:
void NotifyNewSave(const FString &file, const FString &title, bool okForQuicksave);
void NotifyNewSave(const FString &file, const FString &title, bool okForQuicksave, bool forceQuicksave);
void ClearSaveGames();
void ReadSaveStrings();

View file

@ -44,6 +44,7 @@
#include "vm.h"
EXTERN_CVAR (Bool, saveloadconfirmation) // [mxd]
EXTERN_CVAR (Bool, quicksaverotation)
typedef void(*hfunc)();
DEFINE_ACTION_FUNCTION(DMessageBoxMenu, CallHandler)
@ -174,6 +175,13 @@ CCMD (quicksave)
if (gamestate != GS_LEVEL)
return;
// If the quick save rotation is enabled, it handles the save slot.
if (quicksaverotation)
{
G_DoQuickSave();
return;
}
if (savegameManager.quickSaveSlot == NULL)
{