summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Framework/Serialisation
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-07-06 17:46:04 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-07-06 17:46:04 -0400
commitd928bf188e9ab171223bc07d7209d2887d954642 (patch)
tree66b41d22d97ad2f7e6cfe1773fdf8527abe19b08 /src/StardewModdingAPI/Framework/Serialisation
parente2b9a4bab3e078851a289ad0a19b555dde09308e (diff)
downloadSMAPI-d928bf188e9ab171223bc07d7209d2887d954642.tar.gz
SMAPI-d928bf188e9ab171223bc07d7209d2887d954642.tar.bz2
SMAPI-d928bf188e9ab171223bc07d7209d2887d954642.zip
add optional mod dependencies in SMAPI 2.0 (#287)
Diffstat (limited to 'src/StardewModdingAPI/Framework/Serialisation')
-rw-r--r--src/StardewModdingAPI/Framework/Serialisation/ManifestFieldConverter.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/StardewModdingAPI/Framework/Serialisation/ManifestFieldConverter.cs b/src/StardewModdingAPI/Framework/Serialisation/ManifestFieldConverter.cs
index e6d62d50..5be0f0b6 100644
--- a/src/StardewModdingAPI/Framework/Serialisation/ManifestFieldConverter.cs
+++ b/src/StardewModdingAPI/Framework/Serialisation/ManifestFieldConverter.cs
@@ -73,7 +73,12 @@ namespace StardewModdingAPI.Framework.Serialisation
{
string uniqueID = obj.Value<string>(nameof(IManifestDependency.UniqueID));
string minVersion = obj.Value<string>(nameof(IManifestDependency.MinimumVersion));
+#if SMAPI_2_0
+ bool required = obj.Value<bool?>(nameof(IManifestDependency.IsRequired)) ?? true;
+ result.Add(new ManifestDependency(uniqueID, minVersion, required));
+#else
result.Add(new ManifestDependency(uniqueID, minVersion));
+#endif
}
return result.ToArray();
}