fix trace logs not showing path for invalid mods
This commit is contained in:
parent
49756e6542
commit
f56636d2c8
|
@ -22,6 +22,7 @@
|
|||
* Added IntelliSense documentation when not using the 'for developers' version of SMAPI.
|
||||
* Mods are no longer prevented from loading a PNG while the game is drawing.
|
||||
* Fixed `IContentPack.ReadJsonFile` allowing non-relative paths.
|
||||
* Fixed trace logs not showing path for invalid mods.
|
||||
* Suppressed the game's 'added crickets' debug output.
|
||||
* **Breaking change:** `helper.ModRegistry` now returns `IModInfo` instead of `IManifest` directly. This lets SMAPI return more metadata about mods in future versions.
|
||||
* **Breaking change:** most SMAPI files have been moved into a `smapi-internal` subfolder. This won't affect compiled mods, but you'll need to update the mod build config NuGet package when compiling mods.
|
||||
|
|
|
@ -837,7 +837,7 @@ namespace StardewModdingAPI.Framework
|
|||
// unlock mod integrations
|
||||
this.ModRegistry.AreAllModsInitialised = true;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>Load a given mod.</summary>
|
||||
/// <param name="mod">The mod to load.</param>
|
||||
/// <param name="mods">The mods being loaded.</param>
|
||||
|
@ -855,13 +855,14 @@ namespace StardewModdingAPI.Framework
|
|||
errorDetails = null;
|
||||
|
||||
// log entry
|
||||
if (mod.IsContentPack)
|
||||
this.Monitor.Log($" {mod.DisplayName} (content pack, {PathUtilities.GetRelativePath(this.ModsPath, mod.DirectoryPath)})...", LogLevel.Trace);
|
||||
else
|
||||
{
|
||||
this.Monitor.Log(mod.Manifest?.EntryDll != null
|
||||
? $" {mod.DisplayName} ({PathUtilities.GetRelativePath(this.ModsPath, mod.DirectoryPath)}{Path.DirectorySeparatorChar}{mod.Manifest.EntryDll})..." // don't use Path.Combine here, since EntryDLL might not be valid
|
||||
: $" {mod.DisplayName}...", LogLevel.Trace);
|
||||
string relativePath = PathUtilities.GetRelativePath(this.ModsPath, mod.DirectoryPath);
|
||||
if (mod.IsContentPack)
|
||||
this.Monitor.Log($" {mod.DisplayName} ({relativePath}) [content pack]...", LogLevel.Trace);
|
||||
else if (mod.Manifest.EntryDll != null)
|
||||
this.Monitor.Log($" {mod.DisplayName} ({relativePath}{Path.DirectorySeparatorChar}{mod.Manifest.EntryDll})...", LogLevel.Trace); // don't use Path.Combine here, since EntryDLL might not be valid
|
||||
else
|
||||
this.Monitor.Log($" {mod.DisplayName} ({relativePath})...", LogLevel.Trace);
|
||||
}
|
||||
|
||||
// add warning for missing update key
|
||||
|
|
Loading…
Reference in New Issue