fix error when a mod is both duplicated and missing the DLL

This commit is contained in:
Jesse Plamondon-Willard 2022-08-08 19:54:07 -04:00
parent 1749a82947
commit 352fa4759e
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
2 changed files with 4 additions and 3 deletions

View File

@ -12,6 +12,7 @@
* Fixed SMAPI on Windows applying different DPI awareness settings than the game (thanks to spacechase0!). * Fixed SMAPI on Windows applying different DPI awareness settings than the game (thanks to spacechase0!).
* Fixed Linux/macOS installer's color scheme question partly unreadable if the terminal background is dark. * Fixed Linux/macOS installer's color scheme question partly unreadable if the terminal background is dark.
* Fixed error message when a mod loads an invalid PNG file (thanks to atravita!). * Fixed error message when a mod loads an invalid PNG file (thanks to atravita!).
* Fixed error message when a mod is duplicated, but one of the copies is also missing the DLL file. This now shows the duplicate-mod message instead of the missing-DLL message.
* Fixed macOS launcher using Terminal regardless of the system's default terminal (thanks to ishan!). * Fixed macOS launcher using Terminal regardless of the system's default terminal (thanks to ishan!).
* Fixed best practices in Linux/macOS launcher scripts (thanks to ishan!). * Fixed best practices in Linux/macOS launcher scripts (thanks to ishan!).
* Improved translations. Thanks to KediDili (updated Turkish)! * Improved translations. Thanks to KediDili (updated Turkish)!

View File

@ -47,7 +47,7 @@ namespace StardewModdingAPI.Framework.ModLoading
IModMetadata metadata = new ModMetadata(folder.DisplayName, folder.Directory.FullName, rootPath, manifest, dataRecord, isIgnored: shouldIgnore); IModMetadata metadata = new ModMetadata(folder.DisplayName, folder.Directory.FullName, rootPath, manifest, dataRecord, isIgnored: shouldIgnore);
if (shouldIgnore) if (shouldIgnore)
metadata.SetStatus(status, ModFailReason.DisabledByDotConvention, "disabled by dot convention"); metadata.SetStatus(status, ModFailReason.DisabledByDotConvention, "disabled by dot convention");
else else if (metadata.Status == ModMetadataStatus.Failed)
metadata.SetStatus(status, ModFailReason.InvalidManifest, folder.ManifestParseErrorText); metadata.SetStatus(status, ModFailReason.InvalidManifest, folder.ManifestParseErrorText);
yield return metadata; yield return metadata;
@ -223,8 +223,8 @@ namespace StardewModdingAPI.Framework.ModLoading
{ {
foreach (IModMetadata mod in group) foreach (IModMetadata mod in group)
{ {
if (mod.Status == ModMetadataStatus.Failed) if (mod.Status == ModMetadataStatus.Failed && mod.FailReason != ModFailReason.InvalidManifest)
continue; // don't replace metadata error continue;
string folderList = string.Join(", ", group.Select(p => p.GetRelativePathWithRoot()).OrderBy(p => p)); string folderList = string.Join(", ", group.Select(p => p.GetRelativePathWithRoot()).OrderBy(p => p));
mod.SetStatus(ModMetadataStatus.Failed, ModFailReason.Duplicate, $"you have multiple copies of this mod installed. To fix this, delete these folders and reinstall the mod: {folderList}."); mod.SetStatus(ModMetadataStatus.Failed, ModFailReason.Duplicate, $"you have multiple copies of this mod installed. To fix this, delete these folders and reinstall the mod: {folderList}.");