Navigation
API > API/Runtime > API/Runtime/Engine
Interface for platform feature modules Defines the interface to platform's save game system (or a generic file based one)
| Name | ISaveGameSystem |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Public/SaveGameSystem.h |
| Include Path | #include "SaveGameSystem.h" |
Syntax
class ISaveGameSystem
Derived Classes
Enums
Public
| Name | Remarks |
|---|---|
| ESaveExistsResult | Possible result codes when using DoesSaveGameExist. |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FSaveGameAsyncExistsCallback | TFunction< void(const FString &, FPlatformUserId, ISaveGameSystem::ESaveExistsResult)> | Indicates that an async savegame exists check has completed. SlotName, PlatformUserId, save exists result. Should always be called from the gamethread. | SaveGameSystem.h |
| FSaveGameAsyncGetNamesCallback | TFunction< void(FPlatformUserId, bool, const TArray< FString > &)> | Indicates that an async savegame list names has completed. PlatformUserId, bool=success, FoundSaves. Should always be called from the game thread | SaveGameSystem.h |
| FSaveGameAsyncInitCompleteCallback | TFunction< void(FPlatformUserId, bool)> | Indicates that an async savegame initialize has completed. PlatformUserId, bool=success. Should always be called from the gamethread. | SaveGameSystem.h |
| FSaveGameAsyncLoadCompleteCallback | TFunction< void(const FString &, FPlatformUserId, bool, const TArray< uint8 > &)> | Indicates that an async savegame load has completed. SlotName, PlatformUserId, bool=success, SavedData. Should always be called from the gamethread. | SaveGameSystem.h |
| FSaveGameAsyncOpCompleteCallback | TFunction< void(const FString &, FPlatformUserId, bool)> | Indicates that an async savegame operation has completed. SlotName, PlatformUserId, bool=success. Should always be called from the gamethread. | SaveGameSystem.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| AsyncTaskPipe | UE::Tasks::FPipe | Save task pipe prevents multiple async save operations happening in parallel. note that the order is not guaranteed | SaveGameSystem.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool DeleteGame
(
bool bAttemptToUseUI, |
Delete an existing save game, blocking until complete | SaveGameSystem.h | |
virtual void DeleteGameAsync
(
bool bAttemptToUseUI, |
Delete the named savegame asyncronously. | SaveGameSystem.h | |
bool DoesSaveGameExist
(
const TCHAR* Name, |
Return true if the named savegame exists (probably not useful with NativeUI | SaveGameSystem.h | |
virtual void DoesSaveGameExistAsync
(
const TCHAR* Name, |
Asyncronously checks if the named savegame exists. | SaveGameSystem.h | |
ESaveExistsResult DoesSaveGameExistWithResult
(
const TCHAR* Name, |
Similar to DoesSaveGameExist, except returns a result code with more information. | SaveGameSystem.h | |
bool DoesSaveSystemSupportMultipleUsers() |
Some save systems don't support more than one user, in those cases the game needs to avoid saving settings for anyone but the primary user. | SaveGameSystem.h | |
| Gets a list of all known saves. This isn't possible on all platforms. | SaveGameSystem.h | ||
virtual void GetSaveGameNamesAsync
(
FPlatformUserId PlatformUserId, |
Gets a list of all known saves if the platform supports it. | SaveGameSystem.h | |
virtual void InitAsync
(
bool bAttemptToUseUI, |
(Optional) initialise the save system for the given user. | SaveGameSystem.h | |
bool LoadGame
(
bool bAttemptToUseUI, |
Loads the game, blocking until complete | SaveGameSystem.h | |
virtual void LoadGameAsync
(
bool bAttemptToUseUI, |
Load the named savegame asyncronously. | SaveGameSystem.h | |
virtual void LoadGameIfExistsAsync
(
bool bAttemptToUseUI, |
Combines DoesSaveGameExistAsync and LoadGameAsync into one operation for simpler usage, treats all errors as the save game not existing | SaveGameSystem.h | |
bool PlatformHasNativeUI() |
Returns true if the platform has a native UI (like many consoles) | SaveGameSystem.h | |
| Saves the game, blocking until complete. | SaveGameSystem.h | ||
virtual void SaveGameAsync
(
bool bAttemptToUseUI, |
Saves the named savegame asyncronously. | SaveGameSystem.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void OnAsyncComplete
(
TFunction< void()> Callback |
Helper function for calling back to the game thread when an async save operation has completed | SaveGameSystem.h |