Skip to content

Commit

Permalink
Add a SkipDynamicCoAExtraction flag to configuration (not visible in …
Browse files Browse the repository at this point in the history
…the frontend) (#2074) #patch
  • Loading branch information
IhateTrains authored Jul 13, 2024
1 parent 553a6f4 commit ea440b4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
echo 'CK3directory = "C:\Program Files (x86)\Steam\steamapps\common\Crusader Kings III"' >> configuration.txt
echo 'targetGameModPath = "C:\Users\Administrator\Documents\Paradox Interactive\Crusader Kings III\mod"' >> configuration.txt
echo 'SaveGame = "../../save.rome"' >> configuration.txt
echo 'SkipDynamicCoAExtraction = 1' >> configuration.txt
cat configuration.txt
- name: "Run conversion"
working-directory: Release/ImperatorToCK3
Expand Down
10 changes: 10 additions & 0 deletions ImperatorToCK3/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public sealed class Configuration {
public double ImperatorCivilizationWorth { get; set; } = 0.4;
public LegionConversion LegionConversion { get; set; } = LegionConversion.MenAtArms;
public Date CK3BookmarkDate { get; set; } = new(0, 1, 1);
public bool SkipDynamicCoAExtraction { get; set; } = false;
public bool FallenEagleEnabled { get; set; }

public Configuration() { }
Expand Down Expand Up @@ -134,6 +135,15 @@ private void RegisterKeys(Parser parser) {
}
Logger.Info($"CK3 bookmark date set to: {CK3BookmarkDate}");
});
parser.RegisterKeyword("SkipDynamicCoAExtraction", reader => {
var valueString = reader.GetString();
try {
SkipDynamicCoAExtraction = Convert.ToInt32(valueString, CultureInfo.InvariantCulture) == 1;
Logger.Info($"{nameof(SkipDynamicCoAExtraction)} set to: {SkipDynamicCoAExtraction}");
} catch (Exception e) {
Logger.Error($"Undefined error, {nameof(SkipDynamicCoAExtraction)} value was: {valueString}; Error message: {e}");
}
});
parser.RegisterRegex(CommonRegexes.Catchall, ParserHelpers.IgnoreAndLogItem);
}

Expand Down
6 changes: 4 additions & 2 deletions ImperatorToCK3/Imperator/World.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,10 @@ public World(Configuration config, ConverterVersion converterVersion) {
}

Logger.Info("*** Building World ***");

ExtractDynamicCoatsOfArms(config);

if (!config.SkipDynamicCoAExtraction) {
ExtractDynamicCoatsOfArms(config);
}

// Link all the intertwining references
Logger.Info("Linking Characters with Families...");
Expand Down

0 comments on commit ea440b4

Please sign in to comment.