diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-07-06 17:46:04 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-07-06 17:46:04 -0400 |
commit | d928bf188e9ab171223bc07d7209d2887d954642 (patch) | |
tree | 66b41d22d97ad2f7e6cfe1773fdf8527abe19b08 /src/StardewModdingAPI/Framework/Serialisation | |
parent | e2b9a4bab3e078851a289ad0a19b555dde09308e (diff) | |
download | SMAPI-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.cs | 5 |
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(); } |