distinguish empty/XNB folders from invalid manifest for error-tracking
This commit is contained in:
parent
1d5017f119
commit
c2f474bf88
|
@ -9,6 +9,9 @@ namespace StardewModdingAPI.Framework.ModLoading
|
||||||
/// <summary>Multiple copies of the mod are installed.</summary>
|
/// <summary>Multiple copies of the mod are installed.</summary>
|
||||||
Duplicate,
|
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>
|
/// <summary>The mod has incompatible code instructions, needs a newer SMAPI version, or is marked 'assume broken' in the SMAPI metadata list.</summary>
|
||||||
Incompatible,
|
Incompatible,
|
||||||
|
|
||||||
|
@ -22,6 +25,9 @@ namespace StardewModdingAPI.Framework.ModLoading
|
||||||
MissingDependencies,
|
MissingDependencies,
|
||||||
|
|
||||||
/// <summary>The mod is marked obsolete in the SMAPI metadata list.</summary>
|
/// <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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,16 @@ namespace StardewModdingAPI.Framework.ModLoading
|
||||||
if (shouldIgnore)
|
if (shouldIgnore)
|
||||||
metadata.SetStatus(status, ModFailReason.DisabledByDotConvention, "disabled by dot convention");
|
metadata.SetStatus(status, ModFailReason.DisabledByDotConvention, "disabled by dot convention");
|
||||||
else if (status == ModMetadataStatus.Failed)
|
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;
|
yield return metadata;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue