Skip to content

Commit 3d85152

Browse files
authored
Clarify log message about mod incompatibility (#817)
* Clarify log message about mod incompatibility * Bump version
1 parent f7a3ab2 commit 3d85152

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

.github/workflows/test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,14 @@ jobs:
2222
- name: "Restore tools"
2323
run: dotnet tool restore
2424

25+
- name: "Restore projects"
26+
run: dotnet restore
27+
2528
- name: "Run tests"
2629
working-directory: commonItems.UnitTests
2730
shell: pwsh
2831
run: |
29-
dotnet test --coverlet --coverlet-output-format lcov --coverlet-exclude "[commonItems.UnitTests]*"
32+
dotnet test --no-restore --coverlet --coverlet-output-format lcov --coverlet-exclude "[commonItems.UnitTests]*"
3033
3134
- name: "Locate coverage report"
3235
id: coverage_report

commonItems.UnitTests/Mods/ModLoaderTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public void LoadModsLogsWarningForOutOfDateMods() {
106106
var mod = Assert.Single(usableMods);
107107
Assert.Equal(new("Outdated Mod", Path.Combine(TestFilesPath, "mod", "outdated")), mod);
108108
var consoleOutput = output.ToString();
109-
Assert.Contains("[WARN] \t\tMod [Outdated Mod] supports game version 1.30.*, but the installed version is 1.31. " +
109+
Assert.Contains("[WARN] \t\tMod [Outdated Mod] supports game version 1.30.*, but your game version is 1.31. " +
110110
"Proceeding anyway, but this can cause issues.", consoleOutput);
111111
}
112112

@@ -120,7 +120,7 @@ public void LoadModsThrowsForGrosslyOutOfDateModsWhenConfigured() {
120120
modLoader.LoadMods(TestFilesPath, incomingMods, installedGameVersion, throwForOutOfDateMods: true)
121121
);
122122

123-
Assert.Equal("\t\tMod [Outdated Mod] supports game version 1.30.*, but the installed version is 1.31. Cannot continue.", exception.Message);
123+
Assert.Equal("\t\tMod [Outdated Mod] supports game version 1.30.*, but your game version is 1.31. Cannot continue.", exception.Message);
124124
}
125125

126126
[Fact]
@@ -141,7 +141,7 @@ public void LoadModsLogWarningForSlightlyOutOfDateMods() {
141141

142142
// Check if the warning is logged, but should not throw as it's only slightly out of date.
143143
var consoleOutput = output.ToString();
144-
Assert.Contains("[WARN] \t\tMod [Slightly Outdated Mod] supports game version 1.31.0.*, but the installed version is 1.31.1. " +
144+
Assert.Contains("[WARN] \t\tMod [Slightly Outdated Mod] supports game version 1.31.0.*, but your game version is 1.31.1. " +
145145
"Proceeding anyway, but this can cause issues.", consoleOutput);
146146
}
147147

commonItems/Mods/ModLoader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void LoadMods(string gameDocumentsPath, List<Mod> incomingMods, GameVersi
5151
var isIncompatible = !GameVersion.IsModCompatibleWithGame(supported, gameVersion);
5252
if (isIncompatible || isSlightlyOutOfDate) {
5353
string problemStr = $"\t\tMod [{mod.Name}] supports game version {supported.ToWildCard()}, " +
54-
$"but the installed version is {gameVersion.ToShortString()}.";
54+
$"but your game version is {gameVersion.ToShortString()}.";
5555
if (throwForOutOfDateMods && isIncompatible && !isSlightlyOutOfDate) {
5656
throw new UserErrorException($"{problemStr} Cannot continue.");
5757
}

commonItems/commonItems.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
88
<PackageId>PGCG.$(AssemblyName)</PackageId>
9-
<Version>22.0.0</Version>
9+
<Version>22.0.1</Version>
1010
<Authors>PGCG</Authors>
1111
<PackageProjectUrl>https://github.com/ParadoxGameConverters/commonItems.NET</PackageProjectUrl>
1212
<RepositoryUrl>https://github.com/ParadoxGameConverters/commonItems.NET</RepositoryUrl>

0 commit comments

Comments
 (0)