summaryrefslogtreecommitdiff
path: root/src/SMAPI
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI')
-rw-r--r--src/SMAPI/Framework/IModMetadata.cs3
-rw-r--r--src/SMAPI/Framework/ModLoading/ModMetadata.cs8
-rw-r--r--src/SMAPI/Program.cs10
3 files changed, 16 insertions, 5 deletions
diff --git a/src/SMAPI/Framework/IModMetadata.cs b/src/SMAPI/Framework/IModMetadata.cs
index d3ec0035..6281c052 100644
--- a/src/SMAPI/Framework/IModMetadata.cs
+++ b/src/SMAPI/Framework/IModMetadata.cs
@@ -83,6 +83,9 @@ namespace StardewModdingAPI.Framework
/// <summary>Whether the mod manifest was loaded (regardless of whether the mod itself was loaded).</summary>
bool HasManifest();
+ /// <summary>Whether the mod has an ID (regardless of whether the ID is valid or the mod itself was loaded).</summary>
+ bool HasID();
+
/// <summary>Whether the mod has at least one update key set.</summary>
bool HasUpdateKeys();
}
diff --git a/src/SMAPI/Framework/ModLoading/ModMetadata.cs b/src/SMAPI/Framework/ModLoading/ModMetadata.cs
index 02a77778..3a412009 100644
--- a/src/SMAPI/Framework/ModLoading/ModMetadata.cs
+++ b/src/SMAPI/Framework/ModLoading/ModMetadata.cs
@@ -133,6 +133,14 @@ namespace StardewModdingAPI.Framework.ModLoading
return this.Manifest != null;
}
+ /// <summary>Whether the mod has an ID (regardless of whether the ID is valid or the mod itself was loaded).</summary>
+ public bool HasID()
+ {
+ return
+ this.HasManifest()
+ && !string.IsNullOrWhiteSpace(this.Manifest.UniqueID);
+ }
+
/// <summary>Whether the mod has at least one update key set.</summary>
public bool HasUpdateKeys()
{
diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs
index 14783513..09d9969c 100644
--- a/src/SMAPI/Program.cs
+++ b/src/SMAPI/Program.cs
@@ -640,7 +640,7 @@ namespace StardewModdingAPI
List<ModSearchEntryModel> searchMods = new List<ModSearchEntryModel>();
foreach (IModMetadata mod in mods)
{
- if (!mod.HasManifest())
+ if (!mod.HasID())
continue;
string[] updateKeys = mod.Manifest.UpdateKeys ?? new string[0];
@@ -657,7 +657,7 @@ namespace StardewModdingAPI
foreach (IModMetadata mod in mods.OrderBy(p => p.DisplayName))
{
// link to update-check data
- if (!mod.HasManifest() || !results.TryGetValue(mod.Manifest.UniqueID, out ModEntryModel result))
+ if (!mod.HasID() || !results.TryGetValue(mod.Manifest.UniqueID, out ModEntryModel result))
continue;
mod.SetUpdateData(result);
@@ -665,8 +665,8 @@ namespace StardewModdingAPI
if (result.Errors != null && result.Errors.Any())
{
errors.AppendLine(result.Errors.Length == 1
- ? $" {mod.DisplayName} update error: {result.Errors[0]}"
- : $" {mod.DisplayName} update errors:\n - {string.Join("\n - ", result.Errors)}"
+ ? $" {mod.DisplayName}: {result.Errors[0]}"
+ : $" {mod.DisplayName}:\n - {string.Join("\n - ", result.Errors)}"
);
}
@@ -688,7 +688,7 @@ namespace StardewModdingAPI
// show update errors
if (errors.Length != 0)
- this.Monitor.Log("Encountered errors fetching updates for some mods:\n" + errors, LogLevel.Trace);
+ this.Monitor.Log("Got update-check errors for some mods:\n" + errors.ToString().TrimEnd(), LogLevel.Trace);
// show update alerts
if (updates.Any())