summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-03-03 17:54:17 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-03-03 17:54:17 -0500
commit36a527956c5410fe5992bfc42fdc11adff9cd9db (patch)
treeca7a4c98fbb24d0f57de9753779e7cd3bf45a971
parentadebec4dd4d3bf4b45f23377a6ab1525fa2d78ef (diff)
downloadSMAPI-36a527956c5410fe5992bfc42fdc11adff9cd9db.tar.gz
SMAPI-36a527956c5410fe5992bfc42fdc11adff9cd9db.tar.bz2
SMAPI-36a527956c5410fe5992bfc42fdc11adff9cd9db.zip
fix detected incompatibility errors not showing mod's update URL (#453)
-rw-r--r--docs/release-notes.md3
-rw-r--r--src/SMAPI/Program.cs10
2 files changed, 9 insertions, 4 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 74db0256..190146fa 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -1,5 +1,8 @@
# Release notes
## 2.6 (upcoming)
+* For players:
+ * Fixed some incompatible-mod errors not showing mod's update URL.
+
* For the [log parser][]:
* Fixed mod list not including all mods if at least one has no author name.
* Fixed some log entries being incorrectly filtered.
diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs
index acab8c70..fec03d6f 100644
--- a/src/SMAPI/Program.cs
+++ b/src/SMAPI/Program.cs
@@ -388,7 +388,7 @@ namespace StardewModdingAPI
mods = resolver.ProcessDependencies(mods, modDatabase).ToArray();
// load mods
- this.LoadMods(mods, this.JsonHelper, this.ContentManager);
+ this.LoadMods(mods, this.JsonHelper, this.ContentManager, modDatabase);
// check for updates
this.CheckForUpdatesAsync(mods);
@@ -670,7 +670,8 @@ namespace StardewModdingAPI
/// <param name="mods">The mods to load.</param>
/// <param name="jsonHelper">The JSON helper with which to read mods' JSON files.</param>
/// <param name="contentManager">The content manager to use for mod content.</param>
- private void LoadMods(IModMetadata[] mods, JsonHelper jsonHelper, SContentManager contentManager)
+ /// <param name="modDatabase">Handles access to SMAPI's internal mod metadata list.</param>
+ private void LoadMods(IModMetadata[] mods, JsonHelper jsonHelper, SContentManager contentManager, ModDatabase modDatabase)
{
this.Monitor.Log("Loading mods...", LogLevel.Trace);
@@ -744,9 +745,10 @@ namespace StardewModdingAPI
{
modAssembly = modAssemblyLoader.Load(metadata, assemblyPath, assumeCompatible: metadata.DataRecord?.Status == ModStatus.AssumeCompatible);
}
- catch (IncompatibleInstructionException ex)
+ catch (IncompatibleInstructionException) // details already in trace logs
{
- TrackSkip(metadata, "it's no longer compatible. Please check for a newer version of the mod.");
+ string url = modDatabase.GetModPageUrlFor(metadata.Manifest.UniqueID);
+ TrackSkip(metadata, $"it's no longer compatible. Please check for a newer version of the mod{(url != null ? $" at {url}" : "")}.");
continue;
}
catch (SAssemblyLoadFailedException ex)