From 7521570341b79ea78c590a202fbda55bd6fe06b7 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 19 Feb 2017 20:12:15 -0500 Subject: make mod-not-compatible messages shorter --- src/StardewModdingAPI/Program.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/StardewModdingAPI') diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs index de07e8ad..b14240ca 100644 --- a/src/StardewModdingAPI/Program.cs +++ b/src/StardewModdingAPI/Program.cs @@ -418,11 +418,14 @@ namespace StardewModdingAPI { if (!compatibility.IsCompatible(manifest.Version)) { - 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)) + bool hasOfficialUrl = !string.IsNullOrWhiteSpace(compatibility.UpdateUrl); + bool hasUnofficialUrl = !string.IsNullOrWhiteSpace(compatibility.UnofficialUpdateUrl); + + string reasonPhrase = compatibility.ReasonPhrase ?? "it isn't compatible with the latest version of the game"; + string warning = $"Skipped {compatibility.Name} because {reasonPhrase}. Please check for a version newer than {compatibility.UpperVersion} here:"; + if (hasOfficialUrl) + warning += !hasUnofficialUrl ? $" {compatibility.UpdateUrl}" : $"{Environment.NewLine}- official mod: {compatibility.UpdateUrl}"; + if (hasUnofficialUrl) warning += $"{Environment.NewLine}- unofficial update: {compatibility.UnofficialUpdateUrl}"; this.Monitor.Log(warning, LogLevel.Error); -- cgit