summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release-notes.md1
-rw-r--r--src/StardewModdingAPI/Framework/Models/IncompatibleMod.cs4
-rw-r--r--src/StardewModdingAPI/Program.cs3
3 files changed, 7 insertions, 1 deletions
diff --git a/release-notes.md b/release-notes.md
index 6c667c31..bede8849 100644
--- a/release-notes.md
+++ b/release-notes.md
@@ -10,6 +10,7 @@ For players:
For SMAPI developers:
* Added support for specifying a lower bound in mod incompatibility data.
+ * Added support for custom incompatible-mod-version error text.
## 1.5
See [log](https://github.com/Pathoschild/SMAPI/compare/1.4...1.5).
diff --git a/src/StardewModdingAPI/Framework/Models/IncompatibleMod.cs b/src/StardewModdingAPI/Framework/Models/IncompatibleMod.cs
index bcc62bb4..bcf5639c 100644
--- a/src/StardewModdingAPI/Framework/Models/IncompatibleMod.cs
+++ b/src/StardewModdingAPI/Framework/Models/IncompatibleMod.cs
@@ -29,6 +29,10 @@ namespace StardewModdingAPI.Framework.Models
/// <summary>A regular expression matching version strings to consider compatible, even if they technically precede <see cref="UpperVersion"/>.</summary>
public string ForceCompatibleVersion { get; set; }
+ /// <summary>The reason phrase to show in the warning, or <c>null</c> to use the default value.</summary>
+ /// <example>"this version is incompatible with the latest version of the game"</example>
+ public string ReasonPhrase { get; set; }
+
/*********
** Public methods
diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs
index 9d08c823..e5c27e71 100644
--- a/src/StardewModdingAPI/Program.cs
+++ b/src/StardewModdingAPI/Program.cs
@@ -402,7 +402,8 @@ namespace StardewModdingAPI
{
if (!compatibility.IsCompatible(manifest.Version))
{
- string warning = $"Skipped {compatibility.Name} {manifest.Version} because this version is not compatible with the latest version of the game. Please check for a newer version of the mod here:";
+ string reasonPhrase = compatibility.ReasonPhrase ?? "this version is not compatible with the latest version of the game";
+ string warning = $"Skipped {compatibility.Name} {manifest.Version} because {reasonPhrase}. Please check for a newer version of the mod here:";
if (!string.IsNullOrWhiteSpace(compatibility.UpdateUrl))
warning += $"{Environment.NewLine}- official mod: {compatibility.UpdateUrl}";
if (!string.IsNullOrWhiteSpace(compatibility.UnofficialUpdateUrl))