summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/SMAPI.Installer/Framework/InstallerContext.cs7
-rw-r--r--src/SMAPI.Installer/InteractiveInstaller.cs63
-rw-r--r--src/SMAPI.Installer/SMAPI.Installer.csproj1
-rw-r--r--src/SMAPI.Installer/assets/README.txt18
-rw-r--r--src/SMAPI.Installer/assets/install on Linux.sh4
-rw-r--r--src/SMAPI.Installer/assets/install on Windows.bat (renamed from src/SMAPI.Installer/assets/windows-install.bat)37
-rw-r--r--src/SMAPI.Installer/assets/install on macOS.command6
-rw-r--r--src/SMAPI.Installer/assets/runtimeconfig.json (renamed from src/SMAPI.Installer/assets/runtimeconfig.unix.json)6
-rw-r--r--src/SMAPI.Installer/assets/runtimeconfig.windows.json12
-rw-r--r--src/SMAPI.Installer/assets/unix-install.sh14
-rw-r--r--src/SMAPI.Installer/assets/unix-launcher.sh9
-rw-r--r--src/SMAPI.ModBuildConfig.Analyzer/NetFieldAnalyzer.cs2
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/manifest.json4
-rw-r--r--src/SMAPI.Mods.ErrorHandler/i18n/pl.json8
-rw-r--r--src/SMAPI.Mods.ErrorHandler/manifest.json4
-rw-r--r--src/SMAPI.Mods.SaveBackup/manifest.json4
-rw-r--r--src/SMAPI.Toolkit/Framework/GameScanning/GameFolderType.cs21
-rw-r--r--src/SMAPI.Toolkit/Framework/GameScanning/GameScanner.cs55
-rw-r--r--src/SMAPI.Web/wwwroot/SMAPI.metadata.json5
-rw-r--r--src/SMAPI.Web/wwwroot/schemas/content-patcher.json6
-rw-r--r--src/SMAPI.sln26
-rw-r--r--src/SMAPI/Constants.cs2
-rw-r--r--src/SMAPI/Framework/ModLoading/RewriteFacades/AccessToolsFacade.cs2
-rw-r--r--src/SMAPI/Framework/ModLoading/RewriteFacades/HarmonyInstanceFacade.cs2
-rw-r--r--src/SMAPI/Framework/ModLoading/RewriteFacades/HarmonyMethodFacade.cs2
-rw-r--r--src/SMAPI/Framework/ModLoading/RewriteFacades/SpriteBatchFacade.cs3
-rw-r--r--src/SMAPI/Framework/SGame.cs8
-rw-r--r--src/SMAPI/SButton.cs2
-rw-r--r--src/SMAPI/SMAPI.csproj3
-rw-r--r--src/SMAPI/Utilities/Keybind.cs2
-rw-r--r--src/SMAPI/i18n/pl.json12
31 files changed, 231 insertions, 119 deletions
diff --git a/src/SMAPI.Installer/Framework/InstallerContext.cs b/src/SMAPI.Installer/Framework/InstallerContext.cs
index 95df32ca..bb973230 100644
--- a/src/SMAPI.Installer/Framework/InstallerContext.cs
+++ b/src/SMAPI.Installer/Framework/InstallerContext.cs
@@ -54,5 +54,12 @@ namespace StardewModdingAPI.Installer.Framework
{
return this.GameScanner.LooksLikeGameFolder(dir);
}
+
+ /// <summary>Get whether a folder seems to contain the game, and which version it contains if so.</summary>
+ /// <param name="dir">The folder to check.</param>
+ public GameFolderType GetGameFolderType(DirectoryInfo dir)
+ {
+ return this.GameScanner.GetGameFolderType(dir);
+ }
}
}
diff --git a/src/SMAPI.Installer/InteractiveInstaller.cs b/src/SMAPI.Installer/InteractiveInstaller.cs
index d8c27a2d..1257f12b 100644
--- a/src/SMAPI.Installer/InteractiveInstaller.cs
+++ b/src/SMAPI.Installer/InteractiveInstaller.cs
@@ -10,6 +10,7 @@ using StardewModdingAPI.Installer.Framework;
using StardewModdingAPI.Internal.ConsoleWriting;
using StardewModdingAPI.Toolkit;
using StardewModdingAPI.Toolkit.Framework;
+using StardewModdingAPI.Toolkit.Framework.GameScanning;
using StardewModdingAPI.Toolkit.Framework.ModScanning;
using StardewModdingAPI.Toolkit.Utilities;
@@ -633,18 +634,39 @@ namespace StardewModdingApi.Installer
// use specified path
if (specifiedPath != null)
{
+ string errorPrefix = $"You specified --game-path \"{specifiedPath}\", but";
+
var dir = new DirectoryInfo(specifiedPath);
if (!dir.Exists)
{
- this.PrintError($"You specified --game-path \"{specifiedPath}\", but that folder doesn't exist.");
+ this.PrintError($"{errorPrefix} that folder doesn't exist.");
return null;
}
- if (!context.LooksLikeGameFolder(dir))
+
+ switch (context.GetGameFolderType(dir))
{
- this.PrintError($"You specified --game-path \"{specifiedPath}\", but that folder doesn't contain the Stardew Valley executable.");
- return null;
+ case GameFolderType.Valid:
+ return dir;
+
+ case GameFolderType.Legacy154OrEarlier:
+ this.PrintWarning($"{errorPrefix} that directory seems to have Stardew Valley 1.5.4 or earlier.");
+ this.PrintWarning("Please update your game to the latest version to use SMAPI.");
+ return null;
+
+ case GameFolderType.LegacyCompatibilityBranch:
+ this.PrintWarning($"{errorPrefix} that directory seems to have the Stardew Valley legacy 'compatibility' branch.");
+ this.PrintWarning("Unfortunately SMAPI is only compatible with the modern version of the game.");
+ this.PrintWarning("Please update your game to the main branch to use SMAPI.");
+ return null;
+
+ case GameFolderType.NoGameFound:
+ this.PrintWarning($"{errorPrefix} that directory doesn't contain a Stardew Valley executable.");
+ return null;
+
+ default:
+ this.PrintWarning($"{errorPrefix} that directory doesn't seem to contain a valid game install.");
+ return null;
}
- return dir;
}
// let user choose detected path
@@ -702,15 +724,32 @@ namespace StardewModdingApi.Installer
this.PrintWarning("That directory doesn't seem to exist.");
continue;
}
- if (!context.LooksLikeGameFolder(directory))
+
+ switch (context.GetGameFolderType(directory))
{
- this.PrintWarning("That directory doesn't contain a Stardew Valley executable.");
- continue;
- }
+ case GameFolderType.Valid:
+ this.PrintInfo(" OK!");
+ return directory;
+
+ case GameFolderType.Legacy154OrEarlier:
+ this.PrintWarning("That directory seems to have Stardew Valley 1.5.4 or earlier.");
+ this.PrintWarning("Please update your game to the latest version to use SMAPI.");
+ continue;
- // looks OK
- this.PrintInfo(" OK!");
- return directory;
+ case GameFolderType.LegacyCompatibilityBranch:
+ this.PrintWarning("That directory seems to have the Stardew Valley legacy 'compatibility' branch.");
+ this.PrintWarning("Unfortunately SMAPI is only compatible with the modern version of the game.");
+ this.PrintWarning("Please update your game to the main branch to use SMAPI.");
+ continue;
+
+ case GameFolderType.NoGameFound:
+ this.PrintWarning("That directory doesn't contain a Stardew Valley executable.");
+ continue;
+
+ default:
+ this.PrintWarning("That directory doesn't seem to contain a valid game install.");
+ continue;
+ }
}
}
diff --git a/src/SMAPI.Installer/SMAPI.Installer.csproj b/src/SMAPI.Installer/SMAPI.Installer.csproj
index e3e01467..928e5c18 100644
--- a/src/SMAPI.Installer/SMAPI.Installer.csproj
+++ b/src/SMAPI.Installer/SMAPI.Installer.csproj
@@ -17,5 +17,4 @@
<Import Project="..\SMAPI.Internal\SMAPI.Internal.projitems" Label="Shared" />
<Import Project="..\..\build\common.targets" />
- <Import Project="..\..\build\prepare-install-package.targets" />
</Project>
diff --git a/src/SMAPI.Installer/assets/README.txt b/src/SMAPI.Installer/assets/README.txt
index 5c20529a..08e99887 100644
--- a/src/SMAPI.Installer/assets/README.txt
+++ b/src/SMAPI.Installer/assets/README.txt
@@ -14,22 +14,27 @@
SMAPI lets you run Stardew Valley with mods. Don't forget to download mods separately.
-Player's guide
+Automated install
--------------------------------
See https://stardewvalleywiki.com/Modding:Player_Guide for help installing SMAPI, adding mods, etc.
Manual install
--------------------------------
-THIS IS NOT RECOMMENDED FOR MOST PLAYERS. See instructions above instead.
+THIS IS NOT RECOMMENDED FOR MOST PLAYERS. See the instructions above instead.
If you really want to install SMAPI manually, here's how.
-1. Unzip "internal/windows/install.dat" (on Windows) or "internal/unix/install.dat" (on
- Linux/macOS). You can change '.dat' to '.zip', it's just a normal zip file renamed to prevent
+1. Unzip "internal/windows/install.dat" (on Windows) or "internal/unix/install.dat" (on Linux or
+ macOS). You can change '.dat' to '.zip', it's just a normal zip file renamed to prevent
confusion.
+
2. Copy the files from the folder you just unzipped into your game folder. The
`StardewModdingAPI.exe` file should be right next to the game's executable.
-3.
+
+3. Copy `Stardew Valley.deps.json` in the game folder, and rename the copy to
+ `StardewModdingAPI.deps.json`.
+
+4.
- Windows only: if you use Steam, see the install guide above to enable achievements and
overlay. Otherwise, just run StardewModdingAPI.exe in your game folder to play with mods.
@@ -38,8 +43,5 @@ If you really want to install SMAPI manually, here's how.
play with mods.
When installing on Linux or macOS:
-- Make sure Mono is installed (normally the installer checks for you). While it's not required,
- many mods won't work correctly without it. (Specifically, mods which load PNG images may crash or
- freeze the game.)
- To configure the color scheme, edit the `smapi-internal/config.json` file and see instructions
there for the 'ColorScheme' setting.
diff --git a/src/SMAPI.Installer/assets/install on Linux.sh b/src/SMAPI.Installer/assets/install on Linux.sh
new file mode 100644
index 00000000..3b7eae9c
--- /dev/null
+++ b/src/SMAPI.Installer/assets/install on Linux.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+cd "`dirname "$0"`"
+internal/linux/SMAPI.Installer
diff --git a/src/SMAPI.Installer/assets/windows-install.bat b/src/SMAPI.Installer/assets/install on Windows.bat
index e34b9554..b0d9ae81 100644
--- a/src/SMAPI.Installer/assets/windows-install.bat
+++ b/src/SMAPI.Installer/assets/install on Windows.bat
@@ -12,47 +12,24 @@ if %ERRORLEVEL% EQU 0 (
exit
)
-REM make sure .NET 5 is installed
-SET hasNet5=1
-WHERE dotnet /q
-if !ERRORLEVEL! NEQ 0 (
- SET hasNet5=0
-) else (
- dotnet --info | findstr /C:"Microsoft.WindowsDesktop.App 5." 1>nul
- if !ERRORLEVEL! NEQ 0 (
- SET hasNet5=0
- )
-)
-if "%hasNet5%" == "0" (
- echo Oops! You don't have the required .NET version installed.
- echo.
- echo To install it:
- echo 1. Go to https://dotnet.microsoft.com/download/dotnet/5.0/runtime
-
- if "%PROCESSOR_ARCHITECTURE%" == "ARM64" (
- echo 2. Under "Run desktop apps", click "Download Arm64".
- ) else (
- echo 2. Under "Run desktop apps", click "Download x64".
- )
-
- echo 3. Run the downloaded installer.
- echo 4. Restart your computer.
+REM make sure an antivirus hasn't deleted the installer DLL
+if not exist %installerDir%"internal\windows\SMAPI.Installer.dll" (
+ echo Oops! SMAPI is missing one of its files. Your antivirus might have deleted it.
+ echo Missing file: %installerDir%internal\windows\SMAPI.Installer.dll
echo.
pause
exit
)
-
-REM make sure an antivirus hasn't deleted the installer DLL
-if not exist %installerDir%"internal\windows\SMAPI.Installer.dll" (
+if not exist %installerDir%"internal\windows\SMAPI.Installer.exe" (
echo Oops! SMAPI is missing one of its files. Your antivirus might have deleted it.
- echo Missing file: %installerDir%internal\windows\SMAPI.Installer.dll
+ echo Missing file: %installerDir%internal\windows\SMAPI.Installer.exe
echo.
pause
exit
)
REM start installer
-dotnet internal\windows\SMAPI.Installer.dll
+internal\windows\SMAPI.Installer.exe
REM keep window open if it failed
if %ERRORLEVEL% NEQ 0 (
diff --git a/src/SMAPI.Installer/assets/install on macOS.command b/src/SMAPI.Installer/assets/install on macOS.command
new file mode 100644
index 00000000..abd21dc8
--- /dev/null
+++ b/src/SMAPI.Installer/assets/install on macOS.command
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+cd "`dirname "$0"`"
+
+xattr -r -d com.apple.quarantine internal
+internal/macOS/SMAPI.Installer
diff --git a/src/SMAPI.Installer/assets/runtimeconfig.unix.json b/src/SMAPI.Installer/assets/runtimeconfig.json
index 8a01ceb1..34018b8a 100644
--- a/src/SMAPI.Installer/assets/runtimeconfig.unix.json
+++ b/src/SMAPI.Installer/assets/runtimeconfig.json
@@ -4,11 +4,13 @@
"includedFrameworks": [
{
"name": "Microsoft.NETCore.App",
- "version": "5.0.7"
+ "version": "5.0.0",
+ "rollForward": "latestMinor"
}
],
"configProperties": {
- "System.Runtime.TieredCompilation": false
+ "System.Runtime.TieredCompilation": false,
+ "System.Reflection.Metadata.MetadataUpdater.IsSupported": false
}
}
}
diff --git a/src/SMAPI.Installer/assets/runtimeconfig.windows.json b/src/SMAPI.Installer/assets/runtimeconfig.windows.json
deleted file mode 100644
index b693d809..00000000
--- a/src/SMAPI.Installer/assets/runtimeconfig.windows.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "runtimeOptions": {
- "tfm": "net5.0",
- "framework": {
- "name": "Microsoft.NETCore.App",
- "version": "5.0.0"
- },
- "configProperties": {
- "System.Runtime.TieredCompilation": false
- }
- }
-}
diff --git a/src/SMAPI.Installer/assets/unix-install.sh b/src/SMAPI.Installer/assets/unix-install.sh
deleted file mode 100644
index 07df4e6c..00000000
--- a/src/SMAPI.Installer/assets/unix-install.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-# Move to script's directory
-cd "`dirname "$0"`"
-
-# make sure .NET 5 is installed
-if ! command -v dotnet >/dev/null 2>&1; then
- echo "Oops! You must have .NET 5 installed to use SMAPI: https://dotnet.microsoft.com/download";
- read
- exit 1
-fi
-
-# run installer
-dotnet internal/unix/SMAPI.Installer.dll
diff --git a/src/SMAPI.Installer/assets/unix-launcher.sh b/src/SMAPI.Installer/assets/unix-launcher.sh
index 58f7a5ae..e8b9ae62 100644
--- a/src/SMAPI.Installer/assets/unix-launcher.sh
+++ b/src/SMAPI.Installer/assets/unix-launcher.sh
@@ -49,20 +49,13 @@ if [ ! -f "Stardew Valley.dll" ]; then
exit 1
fi
-# .NET 5 must be installed
-if ! command -v dotnet >/dev/null 2>&1; then
- echo "Oops! You must have .NET 5 installed to use SMAPI: https://dotnet.microsoft.com/download";
- read
- exit 1
-fi
-
##########
## Launch SMAPI
##########
# macOS
if [ "$(uname)" == "Darwin" ]; then
- dotnet StardewModdingAPI.dll "$@"
+ ./StardewModdingAPI "$@"
# Linux
else
diff --git a/src/SMAPI.ModBuildConfig.Analyzer/NetFieldAnalyzer.cs b/src/SMAPI.ModBuildConfig.Analyzer/NetFieldAnalyzer.cs
index 1efc1616..e03c72de 100644
--- a/src/SMAPI.ModBuildConfig.Analyzer/NetFieldAnalyzer.cs
+++ b/src/SMAPI.ModBuildConfig.Analyzer/NetFieldAnalyzer.cs
@@ -315,7 +315,7 @@ namespace StardewModdingAPI.ModBuildConfig.Analyzer
return false;
// conversion to implemented interface is OK
- if (fromType.AllInterfaces.Contains(toType))
+ if (fromType.AllInterfaces.Contains(toType, SymbolEqualityComparer.Default))
return false;
// avoid any other conversions
diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json
index ac6ff6ea..216a4c32 100644
--- a/src/SMAPI.Mods.ConsoleCommands/manifest.json
+++ b/src/SMAPI.Mods.ConsoleCommands/manifest.json
@@ -1,9 +1,9 @@
{
"Name": "Console Commands",
"Author": "SMAPI",
- "Version": "3.13.1",
+ "Version": "3.13.2",
"Description": "Adds SMAPI console commands that let you manipulate the game.",
"UniqueID": "SMAPI.ConsoleCommands",
"EntryDll": "ConsoleCommands.dll",
- "MinimumApiVersion": "3.13.1"
+ "MinimumApiVersion": "3.13.2"
}
diff --git a/src/SMAPI.Mods.ErrorHandler/i18n/pl.json b/src/SMAPI.Mods.ErrorHandler/i18n/pl.json
index 05a9d411..f080bcd4 100644
--- a/src/SMAPI.Mods.ErrorHandler/i18n/pl.json
+++ b/src/SMAPI.Mods.ErrorHandler/i18n/pl.json
@@ -1,4 +1,4 @@
-{
- // warning messages
- "warn.invalid-content-removed": "Nieprawidłowa zawartość została usunięta, aby zapobiec awarii (zobacz konsolę SMAPI po więcej informacji)."
-}
+{
+ // warning messages
+ "warn.invalid-content-removed": "Nieprawidłowa zawartość została usunięta, aby zapobiec awarii (zobacz konsolę SMAPI po więcej informacji)."
+}
diff --git a/src/SMAPI.Mods.ErrorHandler/manifest.json b/src/SMAPI.Mods.ErrorHandler/manifest.json
index e19a6a7f..beb52020 100644
--- a/src/SMAPI.Mods.ErrorHandler/manifest.json
+++ b/src/SMAPI.Mods.ErrorHandler/manifest.json
@@ -1,9 +1,9 @@
{
"Name": "Error Handler",
"Author": "SMAPI",
- "Version": "3.13.1",
+ "Version": "3.13.2",
"Description": "Handles some common vanilla errors to log more useful info or avoid breaking the game.",
"UniqueID": "SMAPI.ErrorHandler",
"EntryDll": "ErrorHandler.dll",
- "MinimumApiVersion": "3.13.1"
+ "MinimumApiVersion": "3.13.2"
}
diff --git a/src/SMAPI.Mods.SaveBackup/manifest.json b/src/SMAPI.Mods.SaveBackup/manifest.json
index 3e55ce42..2bd20a63 100644
--- a/src/SMAPI.Mods.SaveBackup/manifest.json
+++ b/src/SMAPI.Mods.SaveBackup/manifest.json
@@ -1,9 +1,9 @@
{
"Name": "Save Backup",
"Author": "SMAPI",
- "Version": "3.13.1",
+ "Version": "3.13.2",
"Description": "Automatically backs up all your saves once per day into its folder.",
"UniqueID": "SMAPI.SaveBackup",
"EntryDll": "SaveBackup.dll",
- "MinimumApiVersion": "3.13.1"
+ "MinimumApiVersion": "3.13.2"
}
diff --git a/src/SMAPI.Toolkit/Framework/GameScanning/GameFolderType.cs b/src/SMAPI.Toolkit/Framework/GameScanning/GameFolderType.cs
new file mode 100644
index 00000000..d18af59b
--- /dev/null
+++ b/src/SMAPI.Toolkit/Framework/GameScanning/GameFolderType.cs
@@ -0,0 +1,21 @@
+namespace StardewModdingAPI.Toolkit.Framework.GameScanning
+{
+ /// <summary>The detected validity for a Stardew Valley game folder based on file structure heuristics.</summary>
+ public enum GameFolderType
+ {
+ /// <summary>The folder seems to contain a valid Stardew Valley 1.5.5+ install.</summary>
+ Valid,
+
+ /// <summary>The folder doesn't contain Stardew Valley.</summary>
+ NoGameFound,
+
+ /// <summary>The folder contains Stardew Valley 1.5.4 or earlier. This version uses XNA Framework and 32-bit .NET Framework 4.5.2 on Windows and Mono on Linux/macOS, and isn't compatible with current versions of SMAPI.</summary>
+ Legacy154OrEarlier,
+
+ /// <summary>The folder contains Stardew Valley from the game's legacy compatibility branch, which backports newer changes to the <see cref="Legacy154OrEarlier"/> format.</summary>
+ LegacyCompatibilityBranch,
+
+ /// <summary>The folder seems to contain Stardew Valley files, but they failed to load for unknown reasons (e.g. corrupted executable).</summary>
+ InvalidUnknown
+ }
+}
diff --git a/src/SMAPI.Toolkit/Framework/GameScanning/GameScanner.cs b/src/SMAPI.Toolkit/Framework/GameScanning/GameScanner.cs
index 7553c07f..37e4f263 100644
--- a/src/SMAPI.Toolkit/Framework/GameScanning/GameScanner.cs
+++ b/src/SMAPI.Toolkit/Framework/GameScanning/GameScanner.cs
@@ -5,6 +5,7 @@ using System.Linq;
using System.Xml.Linq;
using System.Xml.XPath;
using StardewModdingAPI.Toolkit.Utilities;
+using System.Reflection;
#if SMAPI_FOR_WINDOWS
using Microsoft.Win32;
#endif
@@ -54,11 +55,59 @@ namespace StardewModdingAPI.Toolkit.Framework.GameScanning
/// <param name="dir">The folder to check.</param>
public bool LooksLikeGameFolder(DirectoryInfo dir)
{
- return
- dir.Exists
- && dir.EnumerateFiles("Stardew Valley.dll").Any();
+ return this.GetGameFolderType(dir) == GameFolderType.Valid;
}
+ /// <summary>Detect the validity of a game folder based on file structure heuristics.</summary>
+ /// <param name="dir">The folder to check.</param>
+ public GameFolderType GetGameFolderType(DirectoryInfo dir)
+ {
+ // no such folder
+ if (!dir.Exists)
+ return GameFolderType.NoGameFound;
+
+ // apparently valid
+ if (dir.EnumerateFiles("Stardew Valley.dll").Any())
+ return GameFolderType.Valid;
+
+ // doesn't contain any version of Stardew Valley
+ FileInfo executable = new(Path.Combine(dir.FullName, "Stardew Valley.exe"));
+ if (!executable.Exists)
+ executable = new(Path.Combine(dir.FullName, "StardewValley.exe")); // pre-1.5.5 Linux/macOS executable
+ if (!executable.Exists)
+ return GameFolderType.NoGameFound;
+
+ // get assembly version
+ Version version;
+ try
+ {
+ version = AssemblyName.GetAssemblyName(executable.FullName).Version;
+ }
+ catch
+ {
+ // The executable exists but it doesn't seem to be a valid assembly. This would
+ // happen with Stardew Valley 1.5.5+, but that should have been flagged as a valid
+ // folder before this point.
+ return GameFolderType.InvalidUnknown;
+ }
+
+ // ignore Stardew Valley 1.5.5+ at this point
+ if (version.Major == 1 && version.Minor == 3 && version.Build == 37)
+ return GameFolderType.InvalidUnknown;
+
+ // incompatible version
+ if (version.Major == 1 && version.Minor < 4)
+ {
+ // Stardew Valley 1.5.4 and earlier have assembly versions <= 1.3.7853.31734
+ if (version.Minor < 3 || version.Build <= 7853)
+ return GameFolderType.Legacy154OrEarlier;
+
+ // Stardew Valley 1.5.5+ legacy compatibility branch
+ return GameFolderType.LegacyCompatibilityBranch;
+ }
+
+ return GameFolderType.InvalidUnknown;
+ }
/*********
** Private methods
diff --git a/src/SMAPI.Web/wwwroot/SMAPI.metadata.json b/src/SMAPI.Web/wwwroot/SMAPI.metadata.json
index bb166017..eb76b29a 100644
--- a/src/SMAPI.Web/wwwroot/SMAPI.metadata.json
+++ b/src/SMAPI.Web/wwwroot/SMAPI.metadata.json
@@ -215,6 +215,11 @@
"~0.4.1 | Status": "AssumeBroken",
"~0.4.1 | StatusReasonDetails": "causes freeze during game launch"
},
+ "UI Info Suite": {
+ "ID": "Cdaragorn.UiInfoSuite",
+ "~2.0.0 | Status": "AssumeBroken",
+ "~2.0.0 | StatusReasonDetails": "causes lag, errors, or crashes in-game"
+ },
"Video Player": {
"ID": "aedenthorn.VideoPlayer",
"~0.2.5 | Status": "AssumeBroken",
diff --git a/src/SMAPI.Web/wwwroot/schemas/content-patcher.json b/src/SMAPI.Web/wwwroot/schemas/content-patcher.json
index d39574ef..6b80f260 100644
--- a/src/SMAPI.Web/wwwroot/schemas/content-patcher.json
+++ b/src/SMAPI.Web/wwwroot/schemas/content-patcher.json
@@ -214,7 +214,7 @@
},
"FromFile": {
"title": "Source file",
- "description": "The relative file path in your content pack folder to load instead (like 'assets/dinosaur.png'), or multiple comma-delimited values. This can be a .json (data), .png (image), .tbin or .tmx (map), or .xnb file. This field supports tokens and capitalization doesn't matter.",
+ "description": "The relative file path in your content pack folder to load instead (like 'assets/dinosaur.png'), or multiple comma-delimited values. This can be a .fnt (font), .json (data), .png (image), .tbin or .tmx (map), or .xnb file. This field supports tokens and capitalization doesn't matter.",
"type": "string",
"allOf": [
{
@@ -223,12 +223,12 @@
}
},
{
- "pattern": "\\.(json|png|tbin|tmx|xnb) *$"
+ "pattern": "\\.(fnt|json|png|tbin|tmx|xnb) *$"
}
],
"@errorMessages": {
"allOf:indexes: 0": "Invalid value; must not contain directory climbing (like '../').",
- "allOf:indexes: 1": "Invalid value; must be a file path ending with .json, .png, .tbin, .tmx, or .xnb."
+ "allOf:indexes: 1": "Invalid value; must be a file path ending with .fnt, .json, .png, .tbin, .tmx, or .xnb."
}
},
"FromArea": {
diff --git a/src/SMAPI.sln b/src/SMAPI.sln
index 92c6cb24..be5326f7 100644
--- a/src/SMAPI.sln
+++ b/src/SMAPI.sln
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.28729.10
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.31912.275
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".root", ".root", "{86C452BE-D2D8-45B4-B63F-E329EB06CEDA}"
ProjectSection(SolutionItems) = preProject
@@ -28,7 +28,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{09CF91E5
ProjectSection(SolutionItems) = preProject
..\build\common.targets = ..\build\common.targets
..\build\find-game-folder.targets = ..\build\find-game-folder.targets
- ..\build\prepare-install-package.targets = ..\build\prepare-install-package.targets
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{EB35A917-67B9-4EFA-8DFC-4FB49B3949BB}"
@@ -84,6 +83,24 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SMAPI.Toolkit.CoreInterface
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SMAPI.Web", "SMAPI.Web\SMAPI.Web.csproj", "{80EFD92F-728F-41E0-8A5B-9F6F49A91899}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "windows", "windows", "{4D661178-38FB-43E4-AA5F-9B0406919344}"
+ ProjectSection(SolutionItems) = preProject
+ ..\build\windows\finalize-install-package.sh = ..\build\windows\finalize-install-package.sh
+ ..\build\windows\prepare-install-package.ps1 = ..\build\windows\prepare-install-package.ps1
+ ..\build\windows\set-smapi-version.ps1 = ..\build\windows\set-smapi-version.ps1
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unix", "unix", "{CAA1488E-842B-433D-994D-1D3D0B5DD125}"
+ ProjectSection(SolutionItems) = preProject
+ ..\build\unix\prepare-install-package.sh = ..\build\unix\prepare-install-package.sh
+ ..\build\unix\set-smapi-version.sh = ..\build\unix\set-smapi-version.sh
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lib", "lib", "{3B5BF14D-F612-4C83-9EF6-E3EBFCD08766}"
+ ProjectSection(SolutionItems) = preProject
+ ..\build\windows\lib\in-place-regex.ps1 = ..\build\windows\lib\in-place-regex.ps1
+ EndProjectSection
+EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
SMAPI.Internal\SMAPI.Internal.projitems*{0634ea4c-3b8f-42db-aea6-ca9e4ef6e92f}*SharedItemsImports = 5
@@ -167,6 +184,9 @@ Global
{0634EA4C-3B8F-42DB-AEA6-CA9E4EF6E92F} = {AE9A4D46-E910-4293-8BC4-673F85FFF6A5}
{491E775B-EAD0-44D4-B6CA-F1FC3E316D33} = {AE9A4D46-E910-4293-8BC4-673F85FFF6A5}
{CD53AD6F-97F4-4872-A212-50C2A0FD3601} = {AE9A4D46-E910-4293-8BC4-673F85FFF6A5}
+ {4D661178-38FB-43E4-AA5F-9B0406919344} = {09CF91E5-5BAB-4650-A200-E5EA9A633046}
+ {CAA1488E-842B-433D-994D-1D3D0B5DD125} = {09CF91E5-5BAB-4650-A200-E5EA9A633046}
+ {3B5BF14D-F612-4C83-9EF6-E3EBFCD08766} = {4D661178-38FB-43E4-AA5F-9B0406919344}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {70143042-A862-47A8-A677-7C819DDC90DC}
diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs
index c5ad215c..5de28f84 100644
--- a/src/SMAPI/Constants.cs
+++ b/src/SMAPI/Constants.cs
@@ -49,7 +49,7 @@ namespace StardewModdingAPI
internal static int? LogScreenId { get; set; }
/// <summary>SMAPI's current raw semantic version.</summary>
- internal static string RawApiVersion = "3.13.1";
+ internal static string RawApiVersion = "3.13.2";
}
/// <summary>Contains SMAPI's constants and assumptions.</summary>
diff --git a/src/SMAPI/Framework/ModLoading/RewriteFacades/AccessToolsFacade.cs b/src/SMAPI/Framework/ModLoading/RewriteFacades/AccessToolsFacade.cs
index 8e4320b3..be2a1c58 100644
--- a/src/SMAPI/Framework/ModLoading/RewriteFacades/AccessToolsFacade.cs
+++ b/src/SMAPI/Framework/ModLoading/RewriteFacades/AccessToolsFacade.cs
@@ -4,6 +4,8 @@ using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using HarmonyLib;
+#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member: This is internal code to support rewriters that shouldn't be called directly.
+
namespace StardewModdingAPI.Framework.ModLoading.RewriteFacades
{
/// <summary>Maps Harmony 1.x <see cref="AccessTools"/> methods to Harmony 2.x to avoid breaking older mods.</summary>
diff --git a/src/SMAPI/Framework/ModLoading/RewriteFacades/HarmonyInstanceFacade.cs b/src/SMAPI/Framework/ModLoading/RewriteFacades/HarmonyInstanceFacade.cs
index 54b91679..135bd218 100644
--- a/src/SMAPI/Framework/ModLoading/RewriteFacades/HarmonyInstanceFacade.cs
+++ b/src/SMAPI/Framework/ModLoading/RewriteFacades/HarmonyInstanceFacade.cs
@@ -5,6 +5,8 @@ using System.Reflection;
using System.Reflection.Emit;
using HarmonyLib;
+#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member: This is internal code to support rewriters that shouldn't be called directly.
+
namespace StardewModdingAPI.Framework.ModLoading.RewriteFacades
{
/// <summary>Maps Harmony 1.x <code>HarmonyInstance</code> methods to Harmony 2.x's <see cref="Harmony"/> to avoid breaking older mods.</summary>
diff --git a/src/SMAPI/Framework/ModLoading/RewriteFacades/HarmonyMethodFacade.cs b/src/SMAPI/Framework/ModLoading/RewriteFacades/HarmonyMethodFacade.cs
index 44c97401..5162dda4 100644
--- a/src/SMAPI/Framework/ModLoading/RewriteFacades/HarmonyMethodFacade.cs
+++ b/src/SMAPI/Framework/ModLoading/RewriteFacades/HarmonyMethodFacade.cs
@@ -3,6 +3,8 @@ using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using HarmonyLib;
+#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member: This is internal code to support rewriters that shouldn't be called directly.
+
namespace StardewModdingAPI.Framework.ModLoading.RewriteFacades
{
/// <summary>Maps Harmony 1.x <see cref="HarmonyMethod"/> methods to Harmony 2.x to avoid breaking older mods.</summary>
diff --git a/src/SMAPI/Framework/ModLoading/RewriteFacades/SpriteBatchFacade.cs b/src/SMAPI/Framework/ModLoading/RewriteFacades/SpriteBatchFacade.cs
index a064f503..5f68f8d9 100644
--- a/src/SMAPI/Framework/ModLoading/RewriteFacades/SpriteBatchFacade.cs
+++ b/src/SMAPI/Framework/ModLoading/RewriteFacades/SpriteBatchFacade.cs
@@ -2,6 +2,9 @@ using System.Diagnostics.CodeAnalysis;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
+#pragma warning disable CS0109 // Member does not hide an inherited member, new keyword is not required: This is deliberate to support legacy XNA Framework platforms.
+#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member: This is internal code to support rewriters that shouldn't be called directly.
+
namespace StardewModdingAPI.Framework.ModLoading.RewriteFacades
{
/// <summary>Provides <see cref="SpriteBatch"/> method signatures that can be injected into mod code for compatibility with mods written for XNA Framework before Stardew Valley 1.5.5.</summary>
diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs
index 898ed1f5..104cf330 100644
--- a/src/SMAPI/Framework/SGame.cs
+++ b/src/SMAPI/Framework/SGame.cs
@@ -776,10 +776,10 @@ namespace StardewModdingAPI.Framework
}
if (!Game1.eventUp && Game1.farmEvent == null && Game1.currentBillboard == 0 && Game1.gameMode == 3 && !this.takingMapScreenshot && Game1.isOutdoorMapSmallerThanViewport())
{
- Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle(0, 0, -Math.Min(Game1.viewport.X, GameRunner.MaxTextureSize), Game1.graphics.GraphicsDevice.Viewport.Height), Color.Black);
- Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle(-Game1.viewport.X + Game1.currentLocation.map.Layers[0].LayerWidth * 64, 0, Math.Min(GameRunner.MaxTextureSize, Game1.graphics.GraphicsDevice.Viewport.Width - (-Game1.viewport.X + Game1.currentLocation.map.Layers[0].LayerWidth * 64)), Game1.graphics.GraphicsDevice.Viewport.Height), Color.Black);
- Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle(0, 0, Game1.graphics.GraphicsDevice.Viewport.Width, -Math.Min(Game1.viewport.Y, GameRunner.MaxTextureSize)), Color.Black);
- Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle(0, -Game1.viewport.Y + Game1.currentLocation.map.Layers[0].LayerHeight * 64, Game1.graphics.GraphicsDevice.Viewport.Width, Math.Min(GameRunner.MaxTextureSize, Game1.graphics.GraphicsDevice.Viewport.Height - (-Game1.viewport.Y + Game1.currentLocation.map.Layers[0].LayerHeight * 64))), Color.Black);
+ Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle(0, 0, -Game1.viewport.X, Game1.graphics.GraphicsDevice.Viewport.Height), Color.Black);
+ Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle(-Game1.viewport.X + Game1.currentLocation.map.Layers[0].LayerWidth * 64, 0, Game1.graphics.GraphicsDevice.Viewport.Width - (-Game1.viewport.X + Game1.currentLocation.map.Layers[0].LayerWidth * 64), Game1.graphics.GraphicsDevice.Viewport.Height), Color.Black);
+ Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle(0, 0, Game1.graphics.GraphicsDevice.Viewport.Width, -Game1.viewport.Y), Color.Black);
+ Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle(0, -Game1.viewport.Y + Game1.currentLocation.map.Layers[0].LayerHeight * 64, Game1.graphics.GraphicsDevice.Viewport.Width, Game1.graphics.GraphicsDevice.Viewport.Height - (-Game1.viewport.Y + Game1.currentLocation.map.Layers[0].LayerHeight * 64)), Color.Black);
}
Game1.spriteBatch.End();
Game1.PushUIMode();
diff --git a/src/SMAPI/SButton.cs b/src/SMAPI/SButton.cs
index cc412946..ae825696 100644
--- a/src/SMAPI/SButton.cs
+++ b/src/SMAPI/SButton.cs
@@ -6,7 +6,7 @@ using StardewValley;
namespace StardewModdingAPI
{
/// <summary>A unified button constant which includes all controller, keyboard, and mouse buttons.</summary>
- /// <remarks>Derived from <see cref="Keys"/>, <see cref="Buttons"/>, and <see cref="System.Windows.Forms.MouseButtons"/>.</remarks>
+ /// <remarks>Derived from <see cref="Keys"/>, <see cref="Buttons"/>, and <c>System.Windows.Forms.MouseButtons</c>.</remarks>
public enum SButton
{
/// <summary>No valid key.</summary>
diff --git a/src/SMAPI/SMAPI.csproj b/src/SMAPI/SMAPI.csproj
index b99028da..f07ede87 100644
--- a/src/SMAPI/SMAPI.csproj
+++ b/src/SMAPI/SMAPI.csproj
@@ -13,6 +13,9 @@
<!--copy dependency DLLs to bin folder so we can include them in installer bundle -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
+
+ <!-- tiered compilation breaks Harmony -->
+ <TieredCompilation>false</TieredCompilation>
</PropertyGroup>
<Import Project="..\..\build\common.targets" />
diff --git a/src/SMAPI/Utilities/Keybind.cs b/src/SMAPI/Utilities/Keybind.cs
index dd8d2861..87b867a9 100644
--- a/src/SMAPI/Utilities/Keybind.cs
+++ b/src/SMAPI/Utilities/Keybind.cs
@@ -105,7 +105,9 @@ namespace StardewModdingAPI.Utilities
/// <summary>Get the keybind state relative to the previous tick.</summary>
public SButtonState GetState()
{
+#pragma warning disable CS0618 // Type or member is obsolete: deliberate call to GetButtonState() for unit tests
SButtonState[] states = this.Buttons.Select(this.GetButtonState).Distinct().ToArray();
+#pragma warning restore CS0618
// single state
if (states.Length == 1)
diff --git a/src/SMAPI/i18n/pl.json b/src/SMAPI/i18n/pl.json
index b9c788fc..fa4650a2 100644
--- a/src/SMAPI/i18n/pl.json
+++ b/src/SMAPI/i18n/pl.json
@@ -1,6 +1,6 @@
-{
- // short date format for SDate
- // tokens: {{day}} (like 15), {{season}} (like Spring), {{seasonLowercase}} (like spring), {{year}} (like 2)
- "generic.date": "{{day}} {{seasonLowercase}}",
- "generic.date-with-year": "{{day}} {{seasonLowercase}} w roku {{year}}"
-}
+{
+ // short date format for SDate
+ // tokens: {{day}} (like 15), {{season}} (like Spring), {{seasonLowercase}} (like spring), {{year}} (like 2)
+ "generic.date": "{{day}} {{seasonLowercase}}",
+ "generic.date-with-year": "{{day}} {{seasonLowercase}} w roku {{year}}"
+}