Skip to content

Commit

Permalink
Create folder per tile
Browse files Browse the repository at this point in the history
Move tile name to end of filename to prevent file sorting problems
  • Loading branch information
TheVillageGuy committed Apr 11, 2024
1 parent 075e183 commit 7cb7a90
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Source/MapComponents/MapComponent_RenderManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,10 @@ private string CreateFilePath(FileNamePattern fileNamePattern, bool addTmpSubdir
{
var subDir = Escape(Find.World.info.seedString, Path.GetInvalidPathChars());
path = Path.Combine(path, subDir);
if (!manuallyTriggered)
{
path = Path.Combine(path, "tile-" + map.Tile.ToString());
}
}

Directory.CreateDirectory(path);
Expand Down Expand Up @@ -809,15 +813,15 @@ private string CreateImageNameDateTime()
var day = GenDate.DayOfQuadrum(tick, longitude) + 1;
var hour = GenDate.HourInteger(tick, longitude);
string mapName = PRModSettings.useMapNameInstead ? map.ToString() : map.Tile.ToString();
return "rimworld-" + Find.World.info.seedString + "-" + mapName + "-" + year + "-" + quadrum + "-" +
((day < 10) ? "0" : "") + day + "-" + ((hour < 10) ? "0" : "") + hour;
return "rimworld-" + Find.World.info.seedString + "-" + year + "-" + quadrum + "-" +
((day < 10) ? "0" : "") + day + "-" + ((hour < 10) ? "0" : "") + hour + "-" + mapName;
}

private string CreateImageNameNumbered()
{
string mapName = PRModSettings.useMapNameInstead ? map.ToString() : map.Tile.ToString();
return "rimworld-" + Find.World.info.seedString + "-" + mapName + "-" +
lastRenderedCounter.ToString("000000");
return "rimworld-" + Find.World.info.seedString + "-" +
lastRenderedCounter.ToString("000000") + "-" + mapName;
}
}
}

0 comments on commit 7cb7a90

Please sign in to comment.