From 1fa2632289134c39f268c374bb290549f28751d5 Mon Sep 17 00:00:00 2001 From: Dan Volchek Date: Sun, 10 Jun 2018 14:19:05 -0700 Subject: seperate IModMetadata methods, call them correctly when updating --- src/SMAPI/Framework/IModMetadata.cs | 13 ++++++++----- src/SMAPI/Framework/ModLoading/ModMetadata.cs | 18 ++++++++++++------ 2 files changed, 20 insertions(+), 11 deletions(-) (limited to 'src/SMAPI/Framework') diff --git a/src/SMAPI/Framework/IModMetadata.cs b/src/SMAPI/Framework/IModMetadata.cs index 673c5b2e..7bf7d98c 100644 --- a/src/SMAPI/Framework/IModMetadata.cs +++ b/src/SMAPI/Framework/IModMetadata.cs @@ -80,14 +80,17 @@ namespace StardewModdingAPI.Framework /// The mod-provided API. IModMetadata SetApi(object api); - /// Set the update status, indicating no errors happened. + /// Set the update version. /// The latest version. + IModMetadata SetUpdateVersion(ISemanticVersion latestVersion); + + /// Set the preview update version. /// The latest preview version. - IModMetadata SetUpdateStatus(ISemanticVersion latestVersion, ISemanticVersion latestPreviewVersion); + IModMetadata SetPreviewUpdateVersion(ISemanticVersion latestPreviewVersion); - /// Set the update status, indicating an error happened. - /// The error checking for updates, if any. - IModMetadata SetUpdateStatus(string updateCheckError); + /// Set the error that occured while checking for updates. + /// The error checking for updates. + IModMetadata SetUpdateError(string updateCheckError); /// Whether the mod manifest was loaded (regardless of whether the mod itself was loaded). bool HasManifest(); diff --git a/src/SMAPI/Framework/ModLoading/ModMetadata.cs b/src/SMAPI/Framework/ModLoading/ModMetadata.cs index 8f544da3..1ead1387 100644 --- a/src/SMAPI/Framework/ModLoading/ModMetadata.cs +++ b/src/SMAPI/Framework/ModLoading/ModMetadata.cs @@ -124,19 +124,25 @@ namespace StardewModdingAPI.Framework.ModLoading return this; } - /// Set the update status. + /// Set the update version. /// The latest version. - /// The latest preview version. - public IModMetadata SetUpdateStatus(ISemanticVersion latestVersion, ISemanticVersion latestPreviewVersion) + public IModMetadata SetUpdateVersion(ISemanticVersion latestVersion) { this.LatestVersion = latestVersion; + return this; + } + + /// Set the preview update version. + /// The latest preview version. + public IModMetadata SetPreviewUpdateVersion(ISemanticVersion latestPreviewVersion) + { this.LatestPreviewVersion = latestPreviewVersion; return this; } - // Set the update status, indicating an error happened. - /// The error checking for updates, if any. - public IModMetadata SetUpdateStatus(string updateCheckError) + /// Set the error that occured while checking for updates. + /// The error checking for updates. + public IModMetadata SetUpdateError(string updateCheckError) { this.UpdateCheckError = updateCheckError; return this; -- cgit