Skip to content

Commit

Permalink
Remove special handling of ce_lion.dds colored emblem (#1742) #patch
Browse files Browse the repository at this point in the history
  • Loading branch information
IhateTrains authored Feb 3, 2024
1 parent 3dcea01 commit 0ec3877
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions ImperatorToCK3/Outputter/CoatOfArmsEmblemsOutputter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,6 @@
namespace ImperatorToCK3.Outputter;

public static class CoatOfArmsEmblemsOutputter {
private static bool IsBrokenColoredEmblem(string fileName, Configuration config) {
var emblemFilePath = Path.Combine(
"output",
config.OutputModName,
"gfx/coat_of_arms/colored_emblems/ce_lion.dds"
);
// Something's wrong with ce_lion.dds.
if (fileName == "ce_lion.dds" && !File.Exists(emblemFilePath)) {
// Instead of converting a broken file from Imperator, copy closest CK3 emblem.
var wasCopied = SystemUtils.TryCopyFile(
Path.Combine(config.CK3Path, "game/gfx/coat_of_arms/colored_emblems/ce_lion_passant.dds"),
emblemFilePath
);
if (!wasCopied) {
Logger.Warn("Couldn't copy a replacement for ce_lion.dds!");
}
return true;
}
return false;
}

private static void CopyColoredEmblems(Configuration config, ModFilesystem imperatorModFS) {
Logger.Info("Copying colored emblems...");
var coloredEmblemsFolder = "gfx/coat_of_arms/colored_emblems";
Expand All @@ -47,9 +26,6 @@ private static void CopyColoredEmblems(Configuration config, ModFilesystem imper
void CopyEmblem(string emblemFilePath) {
var fileName = CommonFunctions.TrimPath(emblemFilePath);

if (IsBrokenColoredEmblem(fileName, config)) {
return;
}
// Load an image.
var image = new MagickImage(emblemFilePath);
image.Negate(channels: Channels.Red);
Expand Down

0 comments on commit 0ec3877

Please sign in to comment.