summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-08-24 20:35:13 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-08-24 20:35:13 -0400
commitcd83782ef982b9791b233e384170e0064564c041 (patch)
treee965779912a914b7c77ddd43441d3200117c25d4 /src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs
parent04778dcb26f888b56a8d9a70586f8fb6146d3971 (diff)
downloadSMAPI-cd83782ef982b9791b233e384170e0064564c041.tar.gz
SMAPI-cd83782ef982b9791b233e384170e0064564c041.tar.bz2
SMAPI-cd83782ef982b9791b233e384170e0064564c041.zip
fetch mod update keys from wiki when available
Diffstat (limited to 'src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs')
-rw-r--r--src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs
index 82ac8837..3949f7dc 100644
--- a/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs
+++ b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs
@@ -96,6 +96,15 @@ namespace StardewModdingAPI.Toolkit.Framework.ModData
.Distinct();
}
+ /// <summary>Get the default update key for this mod, if any.</summary>
+ public string GetDefaultUpdateKey()
+ {
+ string updateKey = this.Fields.FirstOrDefault(p => p.Key == ModDataFieldKey.UpdateKey && p.IsDefault)?.Value;
+ return !string.IsNullOrWhiteSpace(updateKey)
+ ? updateKey
+ : null;
+ }
+
/// <summary>Get a parsed representation of the <see cref="ModDataRecord.Fields"/> which match a given manifest.</summary>
/// <param name="manifest">The manifest to match.</param>
public ModDataRecordVersionedFields GetVersionedFields(IManifest manifest)