add friendly errors when using SMAPI 3.12.x with Stardew Valley 1.5.5+

This commit is contained in:
Jesse Plamondon-Willard 2021-09-01 21:48:08 -04:00
parent cf1d800b58
commit 5848a355ba
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
4 changed files with 14 additions and 1 deletions

View File

@ -3,6 +3,7 @@
# Release notes # Release notes
## Upcoming release ## Upcoming release
* For players: * For players:
* Added friendly error when using SMAPI 3.2._x_ with Stardew Valley 1.5.5 or later.
* Improved mod compatibility in 64-bit mode (thanks to spacechase0!). * Improved mod compatibility in 64-bit mode (thanks to spacechase0!).
* Reducing load time when scanning/rewriting many mods for compatibility. * Reducing load time when scanning/rewriting many mods for compatibility.
* Updated compatibility list. * Updated compatibility list.

View File

@ -298,6 +298,14 @@ namespace StardewModdingApi.Installer
return; return;
} }
// not Stardew Valley 1.5.5+
if (File.Exists(Path.Combine(paths.GamePath, "Stardew Valley.dll")))
{
this.PrintError($"Oops! The detected game install path seems to be Stardew Valley 1.5.5 or later, but this version of SMAPI is only compatible up to Stardew Valley 1.5.4. Please check for a newer version of SMAPI: https://smapi.io.");
Console.ReadLine();
return;
}
// game folder doesn't contain paths beyond the max limit // game folder doesn't contain paths beyond the max limit
{ {
string[] tooLongPaths = PathUtilities.GetTooLongPaths(Path.Combine(paths.GamePath, "Mods")).ToArray(); string[] tooLongPaths = PathUtilities.GetTooLongPaths(Path.Combine(paths.GamePath, "Mods")).ToArray();

View File

@ -81,7 +81,7 @@ namespace StardewModdingAPI
public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.5.4"); public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.5.4");
/// <summary>The maximum supported version of Stardew Valley.</summary> /// <summary>The maximum supported version of Stardew Valley.</summary>
public static ISemanticVersion MaximumGameVersion { get; } = null; public static ISemanticVersion MaximumGameVersion { get; } = new GameVersion("1.5.4");
/// <summary>The target game platform.</summary> /// <summary>The target game platform.</summary>
public static GamePlatform TargetPlatform { get; } = EarlyConstants.Platform; public static GamePlatform TargetPlatform { get; } = EarlyConstants.Platform;

View File

@ -88,6 +88,10 @@ namespace StardewModdingAPI
if (!File.Exists(Path.Combine(EarlyConstants.ExecutionPath, $"{EarlyConstants.GameAssemblyName}.exe"))) if (!File.Exists(Path.Combine(EarlyConstants.ExecutionPath, $"{EarlyConstants.GameAssemblyName}.exe")))
Program.PrintErrorAndExit("Oops! SMAPI can't find the game. Make sure you're running StardewModdingAPI.exe in your game folder."); Program.PrintErrorAndExit("Oops! SMAPI can't find the game. Make sure you're running StardewModdingAPI.exe in your game folder.");
// Stardew Valley 1.5.5+
if (File.Exists(Path.Combine(EarlyConstants.ExecutionPath, "Stardew Valley.dll")))
Program.PrintErrorAndExit("Oops! You're running Stardew Valley 1.5.5 or later, but this version of SMAPI is only compatible up to Stardew Valley 1.5.4. Please check for a newer version of SMAPI: https://smapi.io.");
// can't load file // can't load file
Program.PrintErrorAndExit( Program.PrintErrorAndExit(
message: "Oops! SMAPI couldn't load the game executable. The technical details below may have more info.", message: "Oops! SMAPI couldn't load the game executable. The technical details below may have more info.",