Skip to content

Commit

Permalink
Merge branch 'develop' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Pathoschild committed Oct 17, 2021
2 parents ebe4118 + f8c9a29 commit d578345
Show file tree
Hide file tree
Showing 40 changed files with 721 additions and 164 deletions.
6 changes: 3 additions & 3 deletions build/common.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!--set general build properties -->
<Version>3.12.7</Version>
<Version>3.12.8</Version>
<Product>SMAPI</Product>
<LangVersion>latest</LangVersion>
<AssemblySearchPaths>$(AssemblySearchPaths);{GAC}</AssemblySearchPaths>
Expand Down Expand Up @@ -54,13 +54,13 @@
<Copy SourceFiles="@(TranslationFiles)" DestinationFolder="$(GamePath)\Mods\$(AssemblyName)\i18n" />
</Target>

<Target Name="CopyToolkit" Condition="'$(MSBuildProjectName)' == 'SMAPI.Toolkit' AND $(TargetFramework) == 'net4.5'" AfterTargets="PostBuildEvent">
<Target Name="CopyToolkit" Condition="'$(MSBuildProjectName)' == 'SMAPI.Toolkit' AND $(TargetFramework) == 'net452'" AfterTargets="PostBuildEvent">
<Copy SourceFiles="$(TargetDir)\$(TargetName).dll" DestinationFolder="$(GamePath)\smapi-internal" />
<Copy SourceFiles="$(TargetDir)\$(TargetName).pdb" DestinationFolder="$(GamePath)\smapi-internal" />
<Copy SourceFiles="$(TargetDir)\$(TargetName).xml" DestinationFolder="$(GamePath)\smapi-internal" />
</Target>

<Target Name="CopyToolkitCoreInterfaces" Condition="'$(MSBuildProjectName)' == 'SMAPI.Toolkit.CoreInterfaces' AND $(TargetFramework) == 'net4.5'" AfterTargets="PostBuildEvent">
<Target Name="CopyToolkitCoreInterfaces" Condition="'$(MSBuildProjectName)' == 'SMAPI.Toolkit.CoreInterfaces' AND $(TargetFramework) == 'net452'" AfterTargets="PostBuildEvent">
<Copy SourceFiles="$(TargetDir)\$(TargetName).dll" DestinationFolder="$(GamePath)\smapi-internal" />
<Copy SourceFiles="$(TargetDir)\$(TargetName).pdb" DestinationFolder="$(GamePath)\smapi-internal" />
<Copy SourceFiles="$(TargetDir)\$(TargetName).xml" DestinationFolder="$(GamePath)\smapi-internal" />
Expand Down
2 changes: 1 addition & 1 deletion build/prepare-install-package.targets
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<OutRootPath>$(SolutionDir)\..\bin</OutRootPath>

<SmapiBin>$(BuildRootPath)\SMAPI\bin\$(Configuration)</SmapiBin>
<ToolkitBin>$(BuildRootPath)\SMAPI.Toolkit\bin\$(Configuration)\net4.5</ToolkitBin>
<ToolkitBin>$(BuildRootPath)\SMAPI.Toolkit\bin\$(Configuration)\net452</ToolkitBin>
<ConsoleCommandsBin>$(BuildRootPath)\SMAPI.Mods.ConsoleCommands\bin\$(Configuration)</ConsoleCommandsBin>
<ErrorHandlerBin>$(BuildRootPath)\SMAPI.Mods.ErrorHandler\bin\$(Configuration)</ErrorHandlerBin>
<SaveBackupBin>$(BuildRootPath)\SMAPI.Mods.SaveBackup\bin\$(Configuration)</SaveBackupBin>
Expand Down
5 changes: 5 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ Hungarian | ✓ [fully translated](../src/SMAPI/i18n/hu.json)
Italian | ✓ [fully translated](../src/SMAPI/i18n/it.json)
Japanese | ✓ [fully translated](../src/SMAPI/i18n/ja.json)
Korean | ✓ [fully translated](../src/SMAPI/i18n/ko.json)
Polish¹ | ✓ [fully translated](../src/SMAPI/i18n/pl.json)
Portuguese | ✓ [fully translated](../src/SMAPI/i18n/pt.json)
Russian | ✓ [fully translated](../src/SMAPI/i18n/ru.json)
Spanish | ✓ [fully translated](../src/SMAPI/i18n/es.json)
Thai¹ | ✓ [fully translated](../src/SMAPI/i18n/th.json)
Turkish | ✓ [fully translated](../src/SMAPI/i18n/tr.json)

¹ This is a custom language provided by a mod (see [Polish](https://www.nexusmods.com/stardewvalley/mods/3616)
and [Thai](https://www.nexusmods.com/stardewvalley/mods/7052)).
17 changes: 17 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
[README](README.md)

# Release notes
## 3.12.8
Released 18 October 2021 for Stardew Valley 1.5.4.

* For players:
* Fixed mod edits to the farmhouse shifting the player down one tile in some cases.
* Improved translations. Thanks to ellipszist (added Thai) and Zangorr (added Polish)!
_These are custom languages which require Stardew Valley 1.5.5 and the [Polish](https://www.nexusmods.com/stardewvalley/mods/3616) or [Thai](https://www.nexusmods.com/stardewvalley/mods/7052) mod._

* For mod authors:
* SMAPI now intercepts dictionary duplicate-key errors and adds the key to the error message to simplify troubleshooting. (Due to Harmony limitations, this only works for the dictionary types used by the game.)
* Fixed map tile rotations/flips not working for farmhands in split-screen mode.
* Fixed barn/coop exit warps being reset when you edit their interior map.

* For the web UI:
* Added support for unified [mod data overrides](https://stardewvalleywiki.com/Modding:Mod_compatibility#Mod_data_overrides) defined on the wiki.
* The mod compatibility list now shows separate beta stats when 'show advanced info' is enabled.

## 3.12.7
Released 18 September 2021 for Stardew Valley 1.5.4.

Expand Down
50 changes: 44 additions & 6 deletions docs/technical/smapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,48 @@ the debugger attached, so you can intercept errors and step through the code bei
doesn't work in MonoDevelop on Linux, unfortunately.

### Preparing a release
To prepare a crossplatform SMAPI release, you'll need to compile it on two platforms. See
[crossplatforming info](https://stardewvalleywiki.com/Modding:Modder_Guide/Test_and_Troubleshoot#Testing_on_all_platforms)
on the wiki for the first-time setup.

To prepare a crossplatform SMAPI release, you'll need to compile it on two platforms: Windows and
Linux. The instructions below assume you have Windows 11, but you can adapt them for
a different setup if needed.

#### Initial setup
First-time setup on Windows:
1. [Install Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/install).
2. Install the needed software in WSL:
1. Run `sudo apt update` to update the package list.
2. Install [the .NET 5 SDK](https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu)
(for Stardew Valley 1.5.5+) or [`mono-complete`](https://www.mono-project.com/download/stable/)
(for earlier versions).
_You can run `lsb_release -a` to get the Ubuntu version number._
3. [Install Steam](https://linuxconfig.org/how-to-install-steam-on-ubuntu-20-04-focal-fossa-linux).
4. Launch `steam` and install the game like usual.
5. Download and install your preferred IDE. For the [latest standalone Rider
version](https://www.jetbrains.com/help/rider/Installation_guide.html#prerequisites):
```sh
wget "<download url here>" -O rider-install.tar.gz
sudo tar -xzvf rider-install.tar.gz -C /opt
ln -s "/opt/JetBrains Rider-<version>/bin/rider.sh"
./rider.sh
```
3. Clone the SMAPI repo in WSL:
```sh
git clone https://github.com/Pathoschild/SMAPI.git
```

To compile SMAPI in WSL:
1. Run `./rider.sh` to open the Rider GUI.
2. Use the GUI to compile the solution.

To launch the game:
1. Open a WSL terminal.
2. Run these commands to start Steam:
```sh
export TERM=xterm
steam
```
3. Launch the game through the Steam UI.

#### Prepare the release
1. Update the version numbers in `build/common.targets`, `Constants`, and the `manifest.json` for
bundled mods. Make sure you use a [semantic version](https://semver.org). Recommended format:

Expand All @@ -90,8 +128,8 @@ on the wiki for the first-time setup.
release | `<version>` | `3.0.0`
2. In Windows:
1. Rebuild the solution with the _release_ solution configuration.
2. Copy the `bin/SMAPI installer` and `bin/SMAPI installer for developers` folders to Linux/macOS.
4. In Linux/macOS:
2. Copy the `bin/SMAPI installer` and `bin/SMAPI installer for developers` folders to Linux.
4. In Linux:
1. Rebuild the solution with the _release_ solution configuration.
2. Add the `windows-install.*` files from Windows to the `bin/SMAPI installer` and
`bin/SMAPI installer for developers` folders compiled on Linux.
Expand Down
2 changes: 1 addition & 1 deletion src/SMAPI.Installer/SMAPI.Installer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<RootNamespace>StardewModdingAPI.Installer</RootNamespace>
<Description>The SMAPI installer for players.</Description>
<TargetFramework>net45</TargetFramework>
<TargetFramework>net452</TargetFramework>
<OutputType>Exe</OutputType>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/SMAPI.Internal/ExceptionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static string SimplifyExtensionMessage(string message)

// remove unneeded root build paths for SMAPI and Stardew Valley
message = message
.Replace(@"C:\source\_Stardew\SMAPI\src\", "")
.Replace(@"E:\source\_Stardew\SMAPI\src\", "")
.Replace(@"C:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\", "");

// remove placeholder info in Linux/macOS stack traces
Expand Down
2 changes: 1 addition & 1 deletion src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<!--build-->
<RootNamespace>StardewModdingAPI.ModBuildConfig</RootNamespace>
<TargetFramework>net45</TargetFramework>
<TargetFramework>net452</TargetFramework>
<LangVersion>latest</LangVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<AssemblyName>ConsoleCommands</AssemblyName>
<RootNamespace>StardewModdingAPI.Mods.ConsoleCommands</RootNamespace>
<TargetFramework>net45</TargetFramework>
<TargetFramework>net452</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/SMAPI.Mods.ConsoleCommands/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Name": "Console Commands",
"Author": "SMAPI",
"Version": "3.12.7",
"Version": "3.12.8",
"Description": "Adds SMAPI console commands that let you manipulate the game.",
"UniqueID": "SMAPI.ConsoleCommands",
"EntryDll": "ConsoleCommands.dll",
"MinimumApiVersion": "3.12.7"
"MinimumApiVersion": "3.12.8"
}
33 changes: 28 additions & 5 deletions src/SMAPI.Mods.ErrorHandler/Patches/DictionaryPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public override void Apply(Harmony harmony, IMonitor monitor)
original: AccessTools.Method(dictionaryType, "get_Item") ?? throw new InvalidOperationException($"Can't find method {PatchHelper.GetMethodString(dictionaryType, "get_Item")} to patch."),
finalizer: this.GetHarmonyMethod(nameof(DictionaryPatcher.Finalize_GetItem))
);

harmony.Patch(
original: AccessTools.Method(dictionaryType, "Add") ?? throw new InvalidOperationException($"Can't find method {PatchHelper.GetMethodString(dictionaryType, "Add")} to patch."),
finalizer: this.GetHarmonyMethod(nameof(DictionaryPatcher.Finalize_Add))
);
}
}
}
Expand All @@ -63,13 +68,31 @@ public override void Apply(Harmony harmony, IMonitor monitor)
private static Exception Finalize_GetItem(object key, Exception __exception)
{
if (__exception is KeyNotFoundException)
{
DictionaryPatcher.Reflection
.GetField<string>(__exception, "_message")
.SetValue($"{__exception.Message}\nkey: '{key}'");
}
DictionaryPatcher.AddKey(__exception, key);

return __exception;
}

/// <summary>The method to call after a dictionary insert throws an exception.</summary>
/// <param name="key">The dictionary key being inserted.</param>
/// <param name="__exception">The exception thrown by the wrapped method, if any.</param>
/// <returns>Returns the exception to throw, if any.</returns>
private static Exception Finalize_Add(object key, Exception __exception)
{
if (__exception is ArgumentException)
DictionaryPatcher.AddKey(__exception, key);

return __exception;
}

/// <summary>Add the dictionary key to an exception message.</summary>
/// <param name="exception">The exception whose message to edit.</param>
/// <param name="key">The dictionary key.</param>
private static void AddKey(Exception exception, object key)
{
DictionaryPatcher.Reflection
.GetField<string>(exception, "_message")
.SetValue($"{exception.Message}\nkey: '{key}'");
}
}
}
2 changes: 1 addition & 1 deletion src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<AssemblyName>ErrorHandler</AssemblyName>
<RootNamespace>StardewModdingAPI.Mods.ErrorHandler</RootNamespace>
<TargetFramework>net45</TargetFramework>
<TargetFramework>net452</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

Expand Down
4 changes: 4 additions & 0 deletions src/SMAPI.Mods.ErrorHandler/i18n/pl.json
Original file line number Diff line number Diff line change
@@ -0,0 +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)."
}
4 changes: 4 additions & 0 deletions src/SMAPI.Mods.ErrorHandler/i18n/th.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
// warning messages
"warn.invalid-content-removed": "ทำการลบเนื้อหาที่ไม่ถูกต้องออก เพื่อป้องกันไฟล์เกมเสียหาย (ดูรายละเอียดที่หน้าคอลโซลของ SMAPI)"
}
4 changes: 2 additions & 2 deletions src/SMAPI.Mods.ErrorHandler/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Name": "Error Handler",
"Author": "SMAPI",
"Version": "3.12.7",
"Version": "3.12.8",
"Description": "Handles some common vanilla errors to log more useful info or avoid breaking the game.",
"UniqueID": "SMAPI.ErrorHandler",
"EntryDll": "ErrorHandler.dll",
"MinimumApiVersion": "3.12.7"
"MinimumApiVersion": "3.12.8"
}
2 changes: 1 addition & 1 deletion src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<AssemblyName>SaveBackup</AssemblyName>
<RootNamespace>StardewModdingAPI.Mods.SaveBackup</RootNamespace>
<TargetFramework>net45</TargetFramework>
<TargetFramework>net452</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/SMAPI.Mods.SaveBackup/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Name": "Save Backup",
"Author": "SMAPI",
"Version": "3.12.7",
"Version": "3.12.8",
"Description": "Automatically backs up all your saves once per day into its folder.",
"UniqueID": "SMAPI.SaveBackup",
"EntryDll": "SaveBackup.dll",
"MinimumApiVersion": "3.12.7"
"MinimumApiVersion": "3.12.8"
}
2 changes: 1 addition & 1 deletion src/SMAPI.Tests/SMAPI.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<AssemblyName>SMAPI.Tests</AssemblyName>
<RootNamespace>SMAPI.Tests</RootNamespace>
<TargetFramework>net45</TargetFramework>
<TargetFramework>net452</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down
Loading

0 comments on commit d578345

Please sign in to comment.