diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2018-06-19 19:13:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-19 19:13:19 -0400 |
commit | 4a05cd09b66a9ec37522aa656ab0814095ab6d23 (patch) | |
tree | 1264a442c5a8c9e6977e017166bdc489e9e51322 /src/SMAPI/Framework/ModLoading | |
parent | 645a64cd24146edba44b89f7493ba5ea9950c3c8 (diff) | |
parent | 468eea751dff9c7c70f0eb33eb91adf98b79cf9d (diff) | |
download | SMAPI-4a05cd09b66a9ec37522aa656ab0814095ab6d23.tar.gz SMAPI-4a05cd09b66a9ec37522aa656ab0814095ab6d23.tar.bz2 SMAPI-4a05cd09b66a9ec37522aa656ab0814095ab6d23.zip |
Merge pull request #543 from danvolchek/optional-update-checking
Add version info to IModMetadata, Change update checks to consider preview versions
Diffstat (limited to 'src/SMAPI/Framework/ModLoading')
-rw-r--r-- | src/SMAPI/Framework/ModLoading/ModMetadata.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/ModLoading/ModMetadata.cs b/src/SMAPI/Framework/ModLoading/ModMetadata.cs index e4ec7e3b..88d2770c 100644 --- a/src/SMAPI/Framework/ModLoading/ModMetadata.cs +++ b/src/SMAPI/Framework/ModLoading/ModMetadata.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using StardewModdingAPI.Framework.ModData; +using StardewModdingAPI.Framework.ModUpdateChecking; namespace StardewModdingAPI.Framework.ModLoading { @@ -43,6 +44,12 @@ namespace StardewModdingAPI.Framework.ModLoading /// <summary>The mod-provided API (if any).</summary> public object Api { get; private set; } + /// <summary>The update status of this mod (if any).</summary> + public ModUpdateStatus UpdateStatus { get; private set; } + + /// <summary>The preview update status of this mod (if any).</summary> + public ModUpdateStatus PreviewUpdateStatus { get; private set; } + /// <summary>Whether the mod is a content pack.</summary> public bool IsContentPack => this.Manifest?.ContentPackFor != null; @@ -115,6 +122,22 @@ namespace StardewModdingAPI.Framework.ModLoading return this; } + /// <summary>Set the update status.</summary> + /// <param name="updateStatus">The mod update status.</param> + public IModMetadata SetUpdateStatus(ModUpdateStatus updateStatus) + { + this.UpdateStatus = updateStatus; + return this; + } + + /// <summary>Set the preview update status.</summary> + /// <param name="previewUpdateStatus">The mod preview update status.</param> + public IModMetadata SetPreviewUpdateStatus(ModUpdateStatus previewUpdateStatus) + { + this.PreviewUpdateStatus = previewUpdateStatus; + return this; + } + /// <summary>Whether the mod manifest was loaded (regardless of whether the mod itself was loaded).</summary> public bool HasManifest() { |