Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Source/1.3/GCQS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,18 @@ public void quicksave(string baseName= "Quicksave")
string mapName = baseName;
if (Settings.uniqueQuicksaveName)
{
mapName += Utils.getUniqueSuffix();
if(Settings.maxQuicksaveCount > 0)
{
if(currentQuickSaveIndex >= Settings.maxQuicksaveCount)
{
currentQuickSaveIndex = 0;
}
mapName += "_" + currentQuickSaveIndex++.ToString();
}
else
{
mapName += Utils.getUniqueSuffix();
}
}

LongEventHandler.QueueLongEvent(delegate ()
Expand Down Expand Up @@ -157,6 +168,7 @@ orderby f.LastWriteTime descending

private bool kpQS;
private bool kpQL;
static private int currentQuickSaveIndex = 0;

private Game game;
}
Expand Down
5 changes: 5 additions & 0 deletions Source/1.3/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class Settings : ModSettings
public static string curFolder = "Default";
public static int nbAutosave = 5;
public static int keyBinding = 1;
public static int maxQuicksaveCount = 10;
public static bool disableAutosave = false;
public static bool uniqueQuicksaveName = false;
public static bool uniqueSaveName = false;
Expand All @@ -35,6 +36,9 @@ public static void DoSettingsWindowContents(Rect inRect)
list.Label("ARS_SettingsNbAutosave".Translate(Settings.nbAutosave));
nbAutosave = (int)list.Slider(nbAutosave, 2, 150);

list.Label("ARS_SettingsMaxQuicksaveCount".Translate(Settings.maxQuicksaveCount));
maxQuicksaveCount = (int)list.Slider(maxQuicksaveCount, 2, 150);

list.GapLine();
list.Label("ARS_SettingsQSSection".Translate());
list.GapLine();
Expand All @@ -55,6 +59,7 @@ public override void ExposeData()
Scribe_Collections.Look<string>(ref folders, "folders", LookMode.Value);
Scribe_Values.Look<int>(ref nbAutosave, "nbAutosave", 5);
Scribe_Values.Look<int>(ref keyBinding, "keyBinding", 1);
Scribe_Values.Look<int>(ref maxQuicksaveCount, "maxQuicksaveCount", 10);
Scribe_Values.Look<bool>(ref disableAutosave, "disableAutosave", false);
Scribe_Values.Look<bool>(ref uniqueQuicksaveName, "uniqueQuicksaveName", false);
Scribe_Values.Look<bool>(ref uniqueSaveName, "uniqueSaveName", false);
Expand Down