diff options
author | Dan Volchek <volchek2@illinois.edu> | 2018-06-10 13:15:53 -0700 |
---|---|---|
committer | Dan Volchek <volchek2@illinois.edu> | 2018-06-10 13:15:53 -0700 |
commit | 5b9e365b5d252e2d1e957303c6b06fa1b3ae2f14 (patch) | |
tree | e034c3c88f71ff1dbd296909bbd66d7471382ad7 /src/SMAPI/Framework/ModLoading | |
parent | 235d67623de648499db521606e4b9033d35388e5 (diff) | |
download | SMAPI-5b9e365b5d252e2d1e957303c6b06fa1b3ae2f14.tar.gz SMAPI-5b9e365b5d252e2d1e957303c6b06fa1b3ae2f14.tar.bz2 SMAPI-5b9e365b5d252e2d1e957303c6b06fa1b3ae2f14.zip |
add version info to ModMetadata, change update checking to consider preview versions
Diffstat (limited to 'src/SMAPI/Framework/ModLoading')
-rw-r--r-- | src/SMAPI/Framework/ModLoading/ModMetadata.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/ModLoading/ModMetadata.cs b/src/SMAPI/Framework/ModLoading/ModMetadata.cs index e4ec7e3b..8f544da3 100644 --- a/src/SMAPI/Framework/ModLoading/ModMetadata.cs +++ b/src/SMAPI/Framework/ModLoading/ModMetadata.cs @@ -43,6 +43,15 @@ namespace StardewModdingAPI.Framework.ModLoading /// <summary>The mod-provided API (if any).</summary> public object Api { get; private set; } + /// <summary>The latest version of the mod.</summary> + public ISemanticVersion LatestVersion { get; private set; } + + /// <summary>The latest preview version of the mod, if any.</summary> + public ISemanticVersion LatestPreviewVersion { get; private set; } + + /// <summary>The error checking for updates for this mod, if any.</summary> + public string UpdateCheckError { get; private set; } + /// <summary>Whether the mod is a content pack.</summary> public bool IsContentPack => this.Manifest?.ContentPackFor != null; @@ -115,6 +124,24 @@ namespace StardewModdingAPI.Framework.ModLoading return this; } + /// <summary>Set the update status.</summary> + /// <param name="latestVersion">The latest version.</param> + /// <param name="latestPreviewVersion">The latest preview version.</param> + public IModMetadata SetUpdateStatus(ISemanticVersion latestVersion, ISemanticVersion latestPreviewVersion) + { + this.LatestVersion = latestVersion; + this.LatestPreviewVersion = latestPreviewVersion; + return this; + } + + // <summary>Set the update status, indicating an error happened.</summary> + /// <param name="updateCheckError">The error checking for updates, if any.</param> + public IModMetadata SetUpdateStatus(string updateCheckError) + { + this.UpdateCheckError = updateCheckError; + return this; + } + /// <summary>Whether the mod manifest was loaded (regardless of whether the mod itself was loaded).</summary> public bool HasManifest() { |