AutoSaveWarningInSeconds
AutoSaveWarningInSeconds
#Overview
name: AutoSaveWarningInSeconds
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of AutoSaveWarningInSeconds is to specify the number of seconds before an auto-save operation when a warning should be displayed to the user. This setting is part of the editor’s auto-save system, which helps prevent data loss by periodically saving work in progress.
This setting variable is primarily used by the Unreal Editor’s loading and saving subsystem, specifically within the auto-save functionality. It is defined in the EditorLoadingSavingSettings class and utilized in the PackageAutoSaver module.
The value of this variable is set in the editor’s settings, likely through the Project Settings or Editor Preferences interface. It is stored as a config property, meaning it can be saved and loaded from configuration files.
AutoSaveWarningInSeconds interacts with other auto-save related variables, such as AutoSaveTimeMinutes and AutoSaveMaxBackups. It is used in conjunction with these to determine when to display warnings and perform auto-saves.
Developers should be aware that this variable affects the user experience in the editor. Setting it too low might lead to frequent interruptions, while setting it too high might not give users enough time to prepare for an impending auto-save.
Best practices when using this variable include:
- Setting a reasonable value that balances user notification and minimal disruption (the UI suggests a range of 0-20 seconds).
- Considering the typical workflow of your team and adjusting the value accordingly.
- Ensuring that the warning time is less than the total auto-save interval to avoid confusion.
- Testing different values to find the optimal balance for your team’s workflow.
- Documenting any custom settings for team-wide consistency.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:183, section: [/Script/UnrealEd.EditorLoadingSavingSettings]
- INI Section:
/Script/UnrealEd.EditorLoadingSavingSettings
- Raw value:
10
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/EditorLoadingSavingSettings.h:192
Scope (from outer to inner):
file
class class UEditorLoadingSavingSettings : public UObject
Source code excerpt:
/** The number of seconds warning before an autosave*/
UPROPERTY(EditAnywhere, config, Category=AutoSave, meta=(DisplayName="Warning in seconds", ClampMin = "0", UIMin = "0", UIMax = "20"))
int32 AutoSaveWarningInSeconds;
/** How many auto save files to keep around*/
UPROPERTY(EditAnywhere, config, Category = AutoSave, meta = (DisplayName = "Maximum number of AutoSaves", ClampMin = "1", UIMin = "1", UIMax = "100"))
int32 AutoSaveMaxBackups = 10;
public:
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/PackageAutoSaver.cpp:128
Scope (from outer to inner):
file
function void FPackageAutoSaver::UpdateAutoSaveCount
Source code excerpt:
const UEditorLoadingSavingSettings* LoadingSavingSettings = GetDefault<UEditorLoadingSavingSettings>();
const float AutoSaveWarningTime = FMath::Max(0.0f, static_cast<float>(LoadingSavingSettings->AutoSaveTimeMinutes * 60 - LoadingSavingSettings->AutoSaveWarningInSeconds));
// Make sure we don't skip the auto-save warning when debugging the editor.
if (AutoSaveCount < AutoSaveWarningTime && (AutoSaveCount + DeltaSeconds) > AutoSaveWarningTime)
{
AutoSaveCount = AutoSaveWarningTime;
}
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/PackageAutoSaver.cpp:690
Scope (from outer to inner):
file
function void FPackageAutoSaver::UpdateAutoSaveNotification
Source code excerpt:
if (UserAllowsAutosave && // The user has set to allow auto-save in preferences
TimeInSecondsUntilAutosave < LoadingSavingSettings->AutoSaveWarningInSeconds &&
!InGame // we want to hide auto-save if we are simulating/playing
)
{
if (!bAutoSaveNotificationLaunched && !bDelayingDueToFailedSave)
{
if (CanAutoSave())
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/PackageAutoSaver.cpp:743
Scope (from outer to inner):
file
function void FPackageAutoSaver::UpdateAutoSaveNotification
Source code excerpt:
else // defer until the user finishes using pop-up menus or the notification will dismiss them...
{
ForceMinimumTimeTillAutoSave(static_cast<float>(LoadingSavingSettings->AutoSaveWarningInSeconds));
}
}
else
{
// Update the remaining time on the notification
TSharedPtr<SNotificationItem> NotificationItem = AutoSaveNotificationPtr.Pin();