From 06e11d98ec54c8671fb1c0b395f76d64989cd4b2 Mon Sep 17 00:00:00 2001 From: TheVillageGuy Date: Thu, 11 Apr 2024 23:08:20 +0200 Subject: [PATCH 1/2] Automatically enable tile folder creation ONLY when a new game is started, to avoid confusion when the mod is added mid game. --- .../GameComponents/GameComponentProgressManager.cs | 13 +++++++------ Source/MapComponents/MapComponent_RenderManager.cs | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Source/GameComponents/GameComponentProgressManager.cs b/Source/GameComponents/GameComponentProgressManager.cs index a03ab85..12cf2ad 100644 --- a/Source/GameComponents/GameComponentProgressManager.cs +++ b/Source/GameComponents/GameComponentProgressManager.cs @@ -11,9 +11,9 @@ namespace ProgressRenderer { public class GameComponentProgressManager : GameComponent // for game wide ProgressRenderer settings to be saved per game { - public static bool defaultEnabled = true; - public static bool enabled = defaultEnabled; - + + public static bool enabled = true; + public static bool tileFoldersEnabled = false; // variables related to automatic quality adjustment @@ -39,7 +39,8 @@ public GameComponentProgressManager(Game game) override public void StartedNewGame() { - enabled = defaultEnabled; + enabled = true; //When a new game is created or Progress Renderer is added as a mod mid game, rendering is automatically enabled + tileFoldersEnabled = true; //Only when a new game is created, automatic tile folder creation is automatically enabled qualityAdjustment = defaultJPGQualityAdjustment; renderSize = defaultRenderSize; JPGQuality_WORLD = defaultJPGQuality_WORLD; @@ -50,13 +51,13 @@ override public void StartedNewGame() JPGQualityTopMargin = -1; JPGQualityLastTarget = defaultRenderSize; PRModSettings.JPGQualityInitialize = false; - } public override void ExposeData() { base.ExposeData(); - Scribe_Values.Look(ref enabled, "enabled", defaultEnabled); + Scribe_Values.Look(ref enabled, "enabled", true); + Scribe_Values.Look(ref tileFoldersEnabled, "tileFoldersEnabled", false); Scribe_Values.Look(ref qualityAdjustment, "JPGQualityAdjustment", defaultJPGQualityAdjustment); Scribe_Values.Look(ref renderSize, "renderSize", defaultRenderSize); Scribe_Values.Look(ref JPGQuality_WORLD, "JPGQuality", defaultJPGQuality_WORLD); diff --git a/Source/MapComponents/MapComponent_RenderManager.cs b/Source/MapComponents/MapComponent_RenderManager.cs index bf735d5..3ea8542 100644 --- a/Source/MapComponents/MapComponent_RenderManager.cs +++ b/Source/MapComponents/MapComponent_RenderManager.cs @@ -757,7 +757,7 @@ private string CreateFilePath(FileNamePattern fileNamePattern, bool addTmpSubdir { var subDir = Escape(Find.World.info.seedString, Path.GetInvalidPathChars()); path = Path.Combine(path, subDir); - if (!manuallyTriggered) + if (!manuallyTriggered & GameComponentProgressManager.tileFoldersEnabled) // start using tile folders when a new game is created to avoid confusion in existing games { path = Path.Combine(path, "tile-" + map.Tile.ToString()); } From 79ef57e503b383a17b0a64204db2e5f0d48364ed Mon Sep 17 00:00:00 2001 From: TheVillageGuy <47496248+TheVillageGuy@users.noreply.github.com> Date: Thu, 11 Apr 2024 23:17:15 +0200 Subject: [PATCH 2/2] Add a comment about removing this when 1.6 is released --- Source/GameComponents/GameComponentProgressManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/GameComponents/GameComponentProgressManager.cs b/Source/GameComponents/GameComponentProgressManager.cs index 12cf2ad..0fabba0 100644 --- a/Source/GameComponents/GameComponentProgressManager.cs +++ b/Source/GameComponents/GameComponentProgressManager.cs @@ -40,7 +40,7 @@ public GameComponentProgressManager(Game game) override public void StartedNewGame() { enabled = true; //When a new game is created or Progress Renderer is added as a mod mid game, rendering is automatically enabled - tileFoldersEnabled = true; //Only when a new game is created, automatic tile folder creation is automatically enabled + tileFoldersEnabled = true; //Only when a new game is created, automatic tile folder creation is automatically enabled. If 1.6 is ever released, remove all this logic as a new game will have to be started anyway, likely. qualityAdjustment = defaultJPGQualityAdjustment; renderSize = defaultRenderSize; JPGQuality_WORLD = defaultJPGQuality_WORLD;