Skip to content

Commit 87f5653

Browse files
authored
Improve cross platform reliability in ColoredEmblemsOutputter (#505) #patch
* Improve cross platform reliability in ColoredEmblemsOutputter * Update ColoredEmblemsOutputter.cs
1 parent 6b476fb commit 87f5653

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ImperatorToCK3/Outputter/ColoredEmblemsOutputter.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ private static bool IsBrokenEmblem(string fileName, Configuration config) {
1111
var emblemFilePath = Path.Combine(
1212
"output",
1313
config.OutputModName,
14-
"gfx/coat_of_arms/colored_emblems/ce_lion.dds"
14+
"gfx", "coat_of_arms", "colored_emblems", "ce_lion.dds"
1515
);
1616
// something's wrong with ce_lion.dds
1717
if (fileName == "ce_lion.dds" && !File.Exists(emblemFilePath)) {
1818
// instead of converting a broken file from Imperator, copy closest CK3 emblem
1919
var wasCopied = SystemUtils.TryCopyFile(
20-
Path.Combine(config.CK3Path, "game/gfx/coat_of_arms/colored_emblems/ce_lion_passant.dds"),
20+
Path.Combine(config.CK3Path, "game", "gfx", "coat_of_arms", "colored_emblems", "ce_lion_passant.dds"),
2121
emblemFilePath
2222
);
2323
if (!wasCopied) {
@@ -29,7 +29,7 @@ private static bool IsBrokenEmblem(string fileName, Configuration config) {
2929
}
3030

3131
public static void CopyColoredEmblems(Configuration config, IEnumerable<Mod> mods) {
32-
const string coloredEmblemsFolder = "gfx/coat_of_arms/colored_emblems";
32+
var coloredEmblemsFolder = Path.Combine("gfx", "coat_of_arms", "colored_emblems");
3333
var vanillaEmblemsFolder = Path.Combine(config.ImperatorPath, "game", coloredEmblemsFolder);
3434
foreach (var fileName in SystemUtils.GetAllFilesInFolderRecursive(vanillaEmblemsFolder)) {
3535
CopyEmblem(Path.Combine(vanillaEmblemsFolder, fileName), fileName);
@@ -49,8 +49,8 @@ void CopyEmblem(string filePath, string fileName) {
4949
var image = new MagickImage(filePath);
5050
image.Negate(channels: Channels.Red);
5151
// Write the image to new file.
52-
var outputPath = Path.Combine("output", config.OutputModName, "gfx/coat_of_arms/colored_emblems", fileName);
52+
var outputPath = Path.Combine("output", config.OutputModName, "gfx", "coat_of_arms", "colored_emblems", fileName);
5353
image.Write(outputPath);
5454
}
5555
}
56-
}
56+
}

0 commit comments

Comments
 (0)