Implement auto-save

This commit is contained in:
Dan Stoian
2025-01-16 18:29:19 +02:00
committed by Gustas
parent 94f2ce4f56
commit e903baf680
22 changed files with 392 additions and 1 deletions

View File

@@ -251,6 +251,14 @@ namespace OpenRA
public Color[] CustomColors = Array.Empty<Color>();
}
public class SinglePlayerGameSettings
{
[Desc("Sets the Auto-save frequency, in seconds")]
public int AutoSaveInterval = 0;
[Desc("Sets the AutoSave number of max files to bes saved on the file-system")]
public int AutoSaveMaxFileCount = 10;
}
public class GameSettings
{
public string Platform = "Default";
@@ -308,8 +316,8 @@ namespace OpenRA
public readonly GraphicSettings Graphics = new();
public readonly ServerSettings Server = new();
public readonly DebugSettings Debug = new();
public readonly SinglePlayerGameSettings SinglePlayerSettings = new();
internal Dictionary<string, Hotkey> Keys = new();
public readonly Dictionary<string, object> Sections;
// A direct clone of the file loaded from disk.
@@ -328,6 +336,7 @@ namespace OpenRA
{ "Graphics", Graphics },
{ "Server", Server },
{ "Debug", Debug },
{ "SinglePlayerSettings", SinglePlayerSettings },
};
// Override fieldloader to ignore invalid entries