summaryrefslogtreecommitdiff
path: root/src/SMAPI
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-08-24 17:49:17 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-08-24 17:49:17 -0400
commitc2f474bf88a43e293d28851785a57a9ca1e60f2e (patch)
treeb5f49f96c4c903403815a809b03f71fb4ed1b209 /src/SMAPI
parent1d5017f1197862d0d9c9f7aa4e13216cad3746d6 (diff)
downloadSMAPI-c2f474bf88a43e293d28851785a57a9ca1e60f2e.tar.gz
SMAPI-c2f474bf88a43e293d28851785a57a9ca1e60f2e.tar.bz2
SMAPI-c2f474bf88a43e293d28851785a57a9ca1e60f2e.zip
distinguish empty/XNB folders from invalid manifest for error-tracking
Diffstat (limited to 'src/SMAPI')
-rw-r--r--src/SMAPI/Framework/ModLoading/ModFailReason.cs8
-rw-r--r--src/SMAPI/Framework/ModLoading/ModResolver.cs11
2 files changed, 17 insertions, 2 deletions
diff --git a/src/SMAPI/Framework/ModLoading/ModFailReason.cs b/src/SMAPI/Framework/ModLoading/ModFailReason.cs
index cd4623e7..cfb76a33 100644
--- a/src/SMAPI/Framework/ModLoading/ModFailReason.cs
+++ b/src/SMAPI/Framework/ModLoading/ModFailReason.cs
@@ -9,6 +9,9 @@ namespace StardewModdingAPI.Framework.ModLoading
/// <summary>Multiple copies of the mod are installed.</summary>
Duplicate,
+ /// <summary>The folder is empty or contains only ignored files.</summary>
+ EmptyFolder,
+
/// <summary>The mod has incompatible code instructions, needs a newer SMAPI version, or is marked 'assume broken' in the SMAPI metadata list.</summary>
Incompatible,
@@ -22,6 +25,9 @@ namespace StardewModdingAPI.Framework.ModLoading
MissingDependencies,
/// <summary>The mod is marked obsolete in the SMAPI metadata list.</summary>
- Obsolete
+ Obsolete,
+
+ /// <summary>The folder is an XNB mod, which can't be loaded through SMAPI.</summary>
+ XnbMod
}
}
diff --git a/src/SMAPI/Framework/ModLoading/ModResolver.cs b/src/SMAPI/Framework/ModLoading/ModResolver.cs
index 5f1fbe4b..fe56f4d2 100644
--- a/src/SMAPI/Framework/ModLoading/ModResolver.cs
+++ b/src/SMAPI/Framework/ModLoading/ModResolver.cs
@@ -48,7 +48,16 @@ namespace StardewModdingAPI.Framework.ModLoading
if (shouldIgnore)
metadata.SetStatus(status, ModFailReason.DisabledByDotConvention, "disabled by dot convention");
else if (status == ModMetadataStatus.Failed)
- metadata.SetStatus(status, ModFailReason.InvalidManifest, folder.ManifestParseErrorText);
+ {
+ ModFailReason reason = folder.ManifestParseError switch
+ {
+ ModParseError.EmptyFolder or ModParseError.EmptyVortexFolder => ModFailReason.EmptyFolder,
+ ModParseError.XnbMod => ModFailReason.XnbMod,
+ _ => ModFailReason.InvalidManifest
+ };
+
+ metadata.SetStatus(status, reason, folder.ManifestParseErrorText);
+ }
yield return metadata;
}