Skip to content

Commit ea8927b

Browse files
Bump PGCG.commonItems from 17.0.1 to 18.0.0 (#2794)
Updated [PGCG.commonItems](https://github.com/ParadoxGameConverters/commonItems.NET) from 17.0.1 to 18.0.0. <details> <summary>Release notes</summary> _Sourced from [PGCG.commonItems's releases](https://github.com/ParadoxGameConverters/commonItems.NET/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/ParadoxGameConverters/commonItems.NET/commits). </details> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=PGCG.commonItems&package-manager=nuget&previous-version=17.0.1&new-version=18.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: iht <IhateTrains@users.noreply.github.com>
1 parent a57a7c9 commit ea8927b

File tree

16 files changed

+34
-59
lines changed

16 files changed

+34
-59
lines changed

ImperatorToCK3.UnitTests/ConfigurationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
using commonItems.Exceptions;
12
using commonItems.Mods;
2-
using ImperatorToCK3.Exceptions;
33
using System;
44
using System.IO;
55
using System.Reflection;

ImperatorToCK3/CK3/Characters/Character.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using commonItems;
22
using commonItems.Collections;
3+
using commonItems.Exceptions;
34
using commonItems.Localization;
45
using ImperatorToCK3.CK3.Armies;
56
using ImperatorToCK3.CK3.Localization;
67
using ImperatorToCK3.CommonUtils;
78
using ImperatorToCK3.CommonUtils.Map;
8-
using ImperatorToCK3.Exceptions;
99
using ImperatorToCK3.Imperator.Armies;
1010
using ImperatorToCK3.Imperator.Countries;
1111
using ImperatorToCK3.Mappers.Culture;

ImperatorToCK3/CK3/Characters/DNAFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using commonItems;
2+
using commonItems.Exceptions;
23
using commonItems.Mods;
34
using ImageMagick;
45
using ImperatorToCK3.CommonUtils.Genes;
5-
using ImperatorToCK3.Exceptions;
66
using ImperatorToCK3.Imperator.Characters;
77
using ImperatorToCK3.Mappers.Gene;
88
using System;

ImperatorToCK3/CK3/Provinces/ProvinceCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using commonItems;
22
using commonItems.Collections;
3+
using commonItems.Exceptions;
34
using commonItems.Mods;
45
using ImperatorToCK3.CK3.Cultures;
56
using ImperatorToCK3.CK3.Religions;
67
using ImperatorToCK3.CK3.Titles;
78
using ImperatorToCK3.CommonUtils.Map;
8-
using ImperatorToCK3.Exceptions;
99
using ImperatorToCK3.Mappers.Culture;
1010
using ImperatorToCK3.Mappers.Province;
1111
using ImperatorToCK3.Mappers.Religion;

ImperatorToCK3/CK3/Wars/War.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using commonItems;
22
using commonItems.Collections;
3+
using commonItems.Exceptions;
34
using ImperatorToCK3.CK3.Provinces;
45
using ImperatorToCK3.CK3.Titles;
5-
using ImperatorToCK3.Exceptions;
66
using ImperatorToCK3.Imperator.States;
77
using ImperatorToCK3.Mappers.Province;
88
using System.Collections.Frozen;

ImperatorToCK3/CK3/World.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using commonItems;
22
using commonItems.Collections;
33
using commonItems.Colors;
4+
using commonItems.Exceptions;
45
using commonItems.Mods;
56
using ImperatorToCK3.CK3.Armies;
67
using ImperatorToCK3.CK3.Characters;
@@ -11,7 +12,6 @@
1112
using ImperatorToCK3.CK3.Religions;
1213
using ImperatorToCK3.CK3.Titles;
1314
using ImperatorToCK3.CommonUtils.Map;
14-
using ImperatorToCK3.Exceptions;
1515
using ImperatorToCK3.Imperator.Countries;
1616
using ImperatorToCK3.Imperator.Diplomacy;
1717
using ImperatorToCK3.Imperator.Jobs;
@@ -451,7 +451,7 @@ private void LoadAndDetectCK3Mods(Configuration config) {
451451

452452
// Let's locate, verify and potentially update those mods immediately.
453453
ModLoader modLoader = new();
454-
modLoader.LoadMods(Directory.GetParent(config.CK3ModsPath)!.FullName, incomingCK3Mods);
454+
modLoader.LoadMods(Directory.GetParent(config.CK3ModsPath)!.FullName, incomingCK3Mods, config.CK3Version, throwForOutOfDateMods: true);
455455

456456
// Add modLoader's UsableMods to LoadedMods.
457457
LoadedMods.AddRange(modLoader.UsableMods);

ImperatorToCK3/CommonUtils/FileHelper.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
namespace ImperatorToCK3.CommonUtils;
1+
using commonItems.Exceptions;
2+
3+
namespace ImperatorToCK3.CommonUtils;
24

35
using commonItems;
46
using System;
57
using Polly;
68
using System.IO;
7-
using Exceptions;
89
using System.Text;
910

1011
public static class FileHelper {

ImperatorToCK3/Configuration.cs

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using commonItems;
22
using commonItems.Collections;
3+
using commonItems.Exceptions;
34
using commonItems.Mods;
4-
using ImperatorToCK3.Exceptions;
55
using System;
66
using System.Collections.Generic;
77
using System.Globalization;
@@ -29,6 +29,8 @@ internal sealed class Configuration {
2929
public Date CK3BookmarkDate { get; set; } = new(0, 1, 1);
3030
public bool SkipDynamicCoAExtraction { get; set; } = false;
3131
public bool SkipHoldingOwnersImport { get; set; } = true;
32+
public GameVersion IRVersion { get; private set; } = new();
33+
public GameVersion CK3Version { get; private set; } = new();
3234
public bool FallenEagleEnabled { get; private set; }
3335
public bool WhenTheWorldStoppedMakingSenseEnabled { get; private set; }
3436
public bool RajasOfAsiaEnabled { get; private set; }
@@ -291,40 +293,34 @@ private void SetOutputName() {
291293

292294
private void VerifyImperatorVersion(ConverterVersion converterVersion) {
293295
var path = Path.Combine(ImperatorPath, "launcher/launcher-settings.json");
294-
var irVersion = GameVersion.ExtractVersionFromLauncher(path);
295-
if (irVersion is null) {
296-
Logger.Error("Imperator version could not be determined, proceeding blind!");
297-
return;
298-
}
296+
IRVersion = GameVersion.ExtractVersionFromLauncher(path) ??
297+
throw new ConverterException("Imperator version could not be determined.");
299298

300-
Logger.Info($"Imperator version: {irVersion.ToShortString()}");
299+
Logger.Info($"Imperator version: {IRVersion.ToShortString()}");
301300

302-
if (converterVersion.MinSource > irVersion) {
303-
Logger.Error($"Imperator version is v{irVersion.ToShortString()}, converter requires minimum v{converterVersion.MinSource.ToShortString()}!");
301+
if (converterVersion.MinSource > IRVersion) {
302+
Logger.Error($"Imperator version is v{IRVersion.ToShortString()}, converter requires minimum v{converterVersion.MinSource.ToShortString()}!");
304303
throw new UserErrorException("Converter vs Imperator installation mismatch!");
305304
}
306-
if (!converterVersion.MaxSource.IsLargerishThan(irVersion)) {
307-
Logger.Error($"Imperator version is v{irVersion.ToShortString()}, converter requires maximum v{converterVersion.MaxSource.ToShortString()}!");
305+
if (!converterVersion.MaxSource.IsLargerishThan(IRVersion)) {
306+
Logger.Error($"Imperator version is v{IRVersion.ToShortString()}, converter requires maximum v{converterVersion.MaxSource.ToShortString()}!");
308307
throw new UserErrorException("Converter vs Imperator installation mismatch!");
309308
}
310309
}
311310

312311
private void VerifyCK3Version(ConverterVersion converterVersion) {
313312
var path = Path.Combine(CK3Path, "launcher/launcher-settings.json");
314-
var ck3Version = GameVersion.ExtractVersionFromLauncher(path);
315-
if (ck3Version is null) {
316-
Logger.Error("CK3 version could not be determined, proceeding blind!");
317-
return;
318-
}
313+
CK3Version = GameVersion.ExtractVersionFromLauncher(path) ??
314+
throw new ConverterException("CK3 version could not be determined.");
319315

320-
Logger.Info($"CK3 version: {ck3Version.ToShortString()}");
316+
Logger.Info($"CK3 version: {CK3Version.ToShortString()}");
321317

322-
if (converterVersion.MinTarget > ck3Version) {
323-
Logger.Error($"CK3 version is v{ck3Version.ToShortString()}, converter requires minimum v{converterVersion.MinTarget.ToShortString()}!");
318+
if (converterVersion.MinTarget > CK3Version) {
319+
Logger.Error($"CK3 version is v{CK3Version.ToShortString()}, converter requires minimum v{converterVersion.MinTarget.ToShortString()}!");
324320
throw new UserErrorException("Converter vs CK3 installation mismatch!");
325321
}
326-
if (!converterVersion.MaxTarget.IsLargerishThan(ck3Version)) {
327-
Logger.Error($"CK3 version is v{ck3Version.ToShortString()}, converter requires maximum v{converterVersion.MaxTarget.ToShortString()}!");
322+
if (!converterVersion.MaxTarget.IsLargerishThan(CK3Version)) {
323+
Logger.Error($"CK3 version is v{CK3Version.ToShortString()}, converter requires maximum v{converterVersion.MaxTarget.ToShortString()}!");
328324
throw new UserErrorException("Converter vs CK3 installation mismatch!");
329325
}
330326
}

ImperatorToCK3/Exceptions/ConverterException.cs

Lines changed: 0 additions & 11 deletions
This file was deleted.

ImperatorToCK3/Exceptions/UserErrorException.cs

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)