diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-04-17 21:12:03 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-04-17 21:12:03 -0400 |
commit | 4af998024cf47ed90a2177c42b77217208685f50 (patch) | |
tree | 237e5dadaff00ae2d4b7349be3ca30038ea56f4d /src/SMAPI/Framework/ModLoading | |
parent | bb2c52386015829c161a56d418f3795335559d8a (diff) | |
download | SMAPI-4af998024cf47ed90a2177c42b77217208685f50.tar.gz SMAPI-4af998024cf47ed90a2177c42b77217208685f50.tar.bz2 SMAPI-4af998024cf47ed90a2177c42b77217208685f50.zip |
add warning in developer mode for mods with no update keys
Diffstat (limited to 'src/SMAPI/Framework/ModLoading')
-rw-r--r-- | src/SMAPI/Framework/ModLoading/ModMetadata.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/ModLoading/ModMetadata.cs b/src/SMAPI/Framework/ModLoading/ModMetadata.cs index 1a0f9994..af888b71 100644 --- a/src/SMAPI/Framework/ModLoading/ModMetadata.cs +++ b/src/SMAPI/Framework/ModLoading/ModMetadata.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using StardewModdingAPI.Framework.ModData; namespace StardewModdingAPI.Framework.ModLoading @@ -102,5 +103,13 @@ namespace StardewModdingAPI.Framework.ModLoading this.Api = api; return this; } + + /// <summary>Whether the mod has at least one update key set.</summary> + public bool HasUpdateKeys() + { + return + this.Manifest?.UpdateKeys != null + && this.Manifest.UpdateKeys.Any(key => !string.IsNullOrWhiteSpace(key)); + } } } |