Skip to content

Commit

Permalink
Automatically enable tile folder creation ONLY when a new game is sta…
Browse files Browse the repository at this point in the history
…rted, to avoid confusion when the mod is added mid game.
  • Loading branch information
TheVillageGuy committed Apr 11, 2024
1 parent 5f8205b commit 06e11d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions Source/GameComponents/GameComponentProgressManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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;
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Source/MapComponents/MapComponent_RenderManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit 06e11d9

Please sign in to comment.