From 1a8bb63e0d08552525e09130c4928c0c4526e901 Mon Sep 17 00:00:00 2001 From: ELL Date: Thu, 16 Sep 2021 11:41:13 +0700 Subject: Add Thai translations --- src/SMAPI.Mods.ErrorHandler/i18n/th.json | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/SMAPI.Mods.ErrorHandler/i18n/th.json (limited to 'src/SMAPI.Mods.ErrorHandler') diff --git a/src/SMAPI.Mods.ErrorHandler/i18n/th.json b/src/SMAPI.Mods.ErrorHandler/i18n/th.json new file mode 100644 index 00000000..e2a67dda --- /dev/null +++ b/src/SMAPI.Mods.ErrorHandler/i18n/th.json @@ -0,0 +1,4 @@ +{ + // warning messages + "warn.invalid-content-removed": "ทำการลบเนื้อหาที่ไม่ถูกต้องออก เพื่อป้องกันไฟล์เกมเสียหาย (ดูรายละเอียดที่หน้าคอลโซลของ SMAPI)" +} -- cgit From 8263a4406be34b438d295220b99c48502a6636bd Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 7 Oct 2021 18:46:41 -0400 Subject: add key to duplicate-dictionary-key exceptions --- docs/release-notes.md | 1 + .../Patches/DictionaryPatcher.cs | 33 ++++++++++++++++++---- 2 files changed, 29 insertions(+), 5 deletions(-) (limited to 'src/SMAPI.Mods.ErrorHandler') diff --git a/docs/release-notes.md b/docs/release-notes.md index 65a2e93b..a7a5e6dd 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -6,6 +6,7 @@ * Fixed mod edits to the farmhouse shifting the player down one tile in some cases. * 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. diff --git a/src/SMAPI.Mods.ErrorHandler/Patches/DictionaryPatcher.cs b/src/SMAPI.Mods.ErrorHandler/Patches/DictionaryPatcher.cs index 6ad64e16..8ceafcc5 100644 --- a/src/SMAPI.Mods.ErrorHandler/Patches/DictionaryPatcher.cs +++ b/src/SMAPI.Mods.ErrorHandler/Patches/DictionaryPatcher.cs @@ -48,6 +48,11 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches 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)) + ); } } } @@ -63,13 +68,31 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches private static Exception Finalize_GetItem(object key, Exception __exception) { if (__exception is KeyNotFoundException) - { - DictionaryPatcher.Reflection - .GetField(__exception, "_message") - .SetValue($"{__exception.Message}\nkey: '{key}'"); - } + DictionaryPatcher.AddKey(__exception, key); return __exception; } + + /// The method to call after a dictionary insert throws an exception. + /// The dictionary key being inserted. + /// The exception thrown by the wrapped method, if any. + /// Returns the exception to throw, if any. + private static Exception Finalize_Add(object key, Exception __exception) + { + if (__exception is ArgumentException) + DictionaryPatcher.AddKey(__exception, key); + + return __exception; + } + + /// Add the dictionary key to an exception message. + /// The exception whose message to edit. + /// The dictionary key. + private static void AddKey(Exception exception, object key) + { + DictionaryPatcher.Reflection + .GetField(exception, "_message") + .SetValue($"{exception.Message}\nkey: '{key}'"); + } } } -- cgit From 08ba5dc52053a62be1fe3319ab3428a2c41fee28 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 8 Oct 2021 19:41:26 -0400 Subject: bump to .NET Framework 4.5.2 --- build/common.targets | 4 ++-- build/prepare-install-package.targets | 2 +- src/SMAPI.Installer/SMAPI.Installer.csproj | 2 +- src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj | 2 +- src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj | 2 +- src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj | 2 +- src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj | 2 +- src/SMAPI.Tests/SMAPI.Tests.csproj | 2 +- src/SMAPI.Toolkit.CoreInterfaces/SMAPI.Toolkit.CoreInterfaces.csproj | 2 +- src/SMAPI.Toolkit/SMAPI.Toolkit.csproj | 2 +- src/SMAPI/SMAPI.csproj | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/SMAPI.Mods.ErrorHandler') diff --git a/build/common.targets b/build/common.targets index 1f6cf0b6..11584d33 100644 --- a/build/common.targets +++ b/build/common.targets @@ -54,13 +54,13 @@ - + - + diff --git a/build/prepare-install-package.targets b/build/prepare-install-package.targets index 88e565f9..601f6496 100644 --- a/build/prepare-install-package.targets +++ b/build/prepare-install-package.targets @@ -14,7 +14,7 @@ $(SolutionDir)\..\bin $(BuildRootPath)\SMAPI\bin\$(Configuration) - $(BuildRootPath)\SMAPI.Toolkit\bin\$(Configuration)\net4.5 + $(BuildRootPath)\SMAPI.Toolkit\bin\$(Configuration)\net452 $(BuildRootPath)\SMAPI.Mods.ConsoleCommands\bin\$(Configuration) $(BuildRootPath)\SMAPI.Mods.ErrorHandler\bin\$(Configuration) $(BuildRootPath)\SMAPI.Mods.SaveBackup\bin\$(Configuration) diff --git a/src/SMAPI.Installer/SMAPI.Installer.csproj b/src/SMAPI.Installer/SMAPI.Installer.csproj index 1777be5f..c47f3e6e 100644 --- a/src/SMAPI.Installer/SMAPI.Installer.csproj +++ b/src/SMAPI.Installer/SMAPI.Installer.csproj @@ -2,7 +2,7 @@ StardewModdingAPI.Installer The SMAPI installer for players. - net45 + net452 Exe false diff --git a/src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj b/src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj index b18e79d5..93769650 100644 --- a/src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj +++ b/src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj @@ -2,7 +2,7 @@ StardewModdingAPI.ModBuildConfig - net45 + net452 latest true diff --git a/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj b/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj index a187c1ff..528348a0 100644 --- a/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj +++ b/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj @@ -2,7 +2,7 @@ ConsoleCommands StardewModdingAPI.Mods.ConsoleCommands - net45 + net452 false diff --git a/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj b/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj index eb878bc5..182a978e 100644 --- a/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj +++ b/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj @@ -2,7 +2,7 @@ ErrorHandler StardewModdingAPI.Mods.ErrorHandler - net45 + net452 false diff --git a/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj b/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj index a6f76781..079beb08 100644 --- a/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj +++ b/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj @@ -2,7 +2,7 @@ SaveBackup StardewModdingAPI.Mods.SaveBackup - net45 + net452 false diff --git a/src/SMAPI.Tests/SMAPI.Tests.csproj b/src/SMAPI.Tests/SMAPI.Tests.csproj index 27520baf..8f7bfab4 100644 --- a/src/SMAPI.Tests/SMAPI.Tests.csproj +++ b/src/SMAPI.Tests/SMAPI.Tests.csproj @@ -2,7 +2,7 @@ SMAPI.Tests SMAPI.Tests - net45 + net452 false latest diff --git a/src/SMAPI.Toolkit.CoreInterfaces/SMAPI.Toolkit.CoreInterfaces.csproj b/src/SMAPI.Toolkit.CoreInterfaces/SMAPI.Toolkit.CoreInterfaces.csproj index d36a1882..0e1e40b2 100644 --- a/src/SMAPI.Toolkit.CoreInterfaces/SMAPI.Toolkit.CoreInterfaces.csproj +++ b/src/SMAPI.Toolkit.CoreInterfaces/SMAPI.Toolkit.CoreInterfaces.csproj @@ -2,7 +2,7 @@ StardewModdingAPI Provides toolkit interfaces which are available to SMAPI mods. - net4.5;netstandard2.0 + net452;netstandard2.0 true diff --git a/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj b/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj index 0e051c84..3d87c169 100644 --- a/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj +++ b/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj @@ -2,7 +2,7 @@ StardewModdingAPI.Toolkit A library which encapsulates mod-handling logic for mod managers and tools. Not intended for use by mods. - net4.5;netstandard2.0 + net452;netstandard2.0 true diff --git a/src/SMAPI/SMAPI.csproj b/src/SMAPI/SMAPI.csproj index 0f1b0516..c147e7dc 100644 --- a/src/SMAPI/SMAPI.csproj +++ b/src/SMAPI/SMAPI.csproj @@ -3,7 +3,7 @@ StardewModdingAPI StardewModdingAPI The modding API for Stardew Valley. - net45 + net452 x86 Exe true -- cgit From db89ff0fcdbecf5dc69033157f03f586e2311ad7 Mon Sep 17 00:00:00 2001 From: Zangorr <91568890+Zangorr@users.noreply.github.com> Date: Wed, 29 Sep 2021 05:55:27 +0200 Subject: Add Polish translation --- src/SMAPI.Mods.ErrorHandler/i18n/pl.json | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/SMAPI.Mods.ErrorHandler/i18n/pl.json (limited to 'src/SMAPI.Mods.ErrorHandler') diff --git a/src/SMAPI.Mods.ErrorHandler/i18n/pl.json b/src/SMAPI.Mods.ErrorHandler/i18n/pl.json new file mode 100644 index 00000000..05a9d411 --- /dev/null +++ b/src/SMAPI.Mods.ErrorHandler/i18n/pl.json @@ -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)." +} -- cgit From f8c9a2929bb42ef7f71fa3a2d258c5566960aa69 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 17 Oct 2021 19:53:24 -0400 Subject: prepare for release --- build/common.targets | 2 +- docs/release-notes.md | 6 ++++-- src/SMAPI.Mods.ConsoleCommands/manifest.json | 4 ++-- src/SMAPI.Mods.ErrorHandler/manifest.json | 4 ++-- src/SMAPI.Mods.SaveBackup/manifest.json | 4 ++-- src/SMAPI/Constants.cs | 2 +- 6 files changed, 12 insertions(+), 10 deletions(-) (limited to 'src/SMAPI.Mods.ErrorHandler') diff --git a/build/common.targets b/build/common.targets index 11584d33..02142351 100644 --- a/build/common.targets +++ b/build/common.targets @@ -1,7 +1,7 @@ - 3.12.7 + 3.12.8 SMAPI latest $(AssemblySearchPaths);{GAC} diff --git a/docs/release-notes.md b/docs/release-notes.md index 422435a6..25b0d740 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,11 +1,13 @@ ← [README](README.md) # Release notes -## Upcoming release +## 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.)_ + _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.) diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json index e53bf991..9af3ce5d 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.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" } diff --git a/src/SMAPI.Mods.ErrorHandler/manifest.json b/src/SMAPI.Mods.ErrorHandler/manifest.json index 37a7e9bf..cfbaa661 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.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" } diff --git a/src/SMAPI.Mods.SaveBackup/manifest.json b/src/SMAPI.Mods.SaveBackup/manifest.json index 28c7ec14..1efd1d89 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.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" } diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index fbc00d1d..42c3b21b 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -54,7 +54,7 @@ namespace StardewModdingAPI internal static int? LogScreenId { get; set; } /// SMAPI's current raw semantic version. - internal static string RawApiVersion = "3.12.7"; + internal static string RawApiVersion = "3.12.8"; } /// Contains SMAPI's constants and assumptions. -- cgit