fix asset load conflict always showing multiple-mod form

This commit is contained in:
Jesse Plamondon-Willard 2022-03-25 22:16:49 -04:00
parent e1fc566e0a
commit 9025b0dcc5
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
2 changed files with 5 additions and 1 deletions

View File

@ -9,6 +9,7 @@
* Improved [command-line arguments](technical/smapi.md#command-line-arguments) on Linux/macOS:
* Added `--use-current-shell` to avoid opening a separate terminal window.
* Fixed `--no-terminal` still opening a terminal window, even if nothing is logged to it (thanks to Ryhon0!).
* Fixed warning text when a mod causes an asset load conflict with itself.
* For mod authors:
* Added [content events](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Events#Content), which will replace `IAssetEditor` and `IAssetLoader` in SMAPI 4.0.0. These include new features not supported by the old API like content pack labels.

View File

@ -400,7 +400,10 @@ namespace StardewModdingAPI.Framework.ContentManagers
return true;
}
string[] loaderNames = loaders.Select(p => p.Mod.DisplayName).ToArray();
string[] loaderNames = loaders
.Select(p => p.Mod.DisplayName)
.Distinct()
.ToArray();
string errorPhrase = loaderNames.Length > 1
? $"Multiple mods want to provide '{info.Name}' asset ({string.Join(", ", loaderNames)})"
: $"The '{loaderNames[0]}' mod wants to provide the '{info.Name}' asset multiple times";