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 ++++ src/SMAPI/i18n/th.json | 6 ++++++ 2 files changed, 10 insertions(+) create mode 100644 src/SMAPI.Mods.ErrorHandler/i18n/th.json create mode 100644 src/SMAPI/i18n/th.json (limited to 'src') 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)" +} diff --git a/src/SMAPI/i18n/th.json b/src/SMAPI/i18n/th.json new file mode 100644 index 00000000..361b7aa7 --- /dev/null +++ b/src/SMAPI/i18n/th.json @@ -0,0 +1,6 @@ +{ + // short date format for SDate + // tokens: {{day}} (like 15), {{season}} (like Spring), {{seasonLowercase}} (like spring), {{year}} (like 2) + "generic.date": "วันที่ {{day}} {{season}}", + "generic.date-with-year": "วันที่ {{day}} {{season}} ปีที่ {{year}}" +} -- cgit From 87536fbd9a9572d2b11bc429ecab91c5f8aeefa3 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 25 Sep 2021 00:52:08 -0400 Subject: remove obsolete buildmsg redirect --- src/SMAPI.Web/Startup.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/SMAPI.Web/Startup.cs b/src/SMAPI.Web/Startup.cs index 2556936c..4b22ca67 100644 --- a/src/SMAPI.Web/Startup.cs +++ b/src/SMAPI.Web/Startup.cs @@ -205,15 +205,20 @@ namespace StardewModdingAPI.Web // shortcut paths .Add(new RedirectPathsToUrlsRule(new Dictionary { + // wiki pages [@"^/3\.0\.?$"] = "https://stardewvalleywiki.com/Modding:Migrate_to_SMAPI_3.0", - [@"^/(?:buildmsg|package)(?:/?(.*))$"] = "https://github.com/Pathoschild/SMAPI/blob/develop/docs/technical/mod-package.md#$1", // buildmsg deprecated, remove when SDV 1.4 is released [@"^/community\.?$"] = "https://stardewvalleywiki.com/Modding:Community", - [@"^/compat\.?$"] = "https://smapi.io/mods", [@"^/docs\.?$"] = "https://stardewvalleywiki.com/Modding:Index", [@"^/help\.?$"] = "https://stardewvalleywiki.com/Modding:Help", [@"^/install\.?$"] = "https://stardewvalleywiki.com/Modding:Player_Guide/Getting_Started#Install_SMAPI", [@"^/troubleshoot(.*)$"] = "https://stardewvalleywiki.com/Modding:Player_Guide/Troubleshooting$1", - [@"^/xnb\.?$"] = "https://stardewvalleywiki.com/Modding:Using_XNB_mods" + [@"^/xnb\.?$"] = "https://stardewvalleywiki.com/Modding:Using_XNB_mods", + + // GitHub docs + [@"^/package(?:/?(.*))$"] = "https://github.com/Pathoschild/SMAPI/blob/develop/docs/technical/mod-package.md#$1", + + // legacy redirects + [@"^/compat\.?$"] = "https://smapi.io/mods" })) // legacy paths -- cgit From 0e3e4f565ad4cda17759f2ebf9a8d35d4a8252b8 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 25 Sep 2021 00:52:21 -0400 Subject: add redirect for SMAPI release notes --- src/SMAPI.Web/Startup.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/SMAPI.Web/Startup.cs b/src/SMAPI.Web/Startup.cs index 4b22ca67..d8561172 100644 --- a/src/SMAPI.Web/Startup.cs +++ b/src/SMAPI.Web/Startup.cs @@ -216,6 +216,7 @@ namespace StardewModdingAPI.Web // GitHub docs [@"^/package(?:/?(.*))$"] = "https://github.com/Pathoschild/SMAPI/blob/develop/docs/technical/mod-package.md#$1", + [@"^/release(?:/?(.*))$"] = "https://github.com/Pathoschild/SMAPI/blob/develop/docs/release-notes.md#$1", // legacy redirects [@"^/compat\.?$"] = "https://smapi.io/mods" -- cgit From 31e31538f128f2a79b553a2cc20fe8a6f13e8a06 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 25 Sep 2021 20:22:26 -0400 Subject: fix farmhouse edits shifting player down one tile --- docs/release-notes.md | 4 ++++ src/SMAPI/Metadata/CoreAssetPropagator.cs | 11 +++++++++++ 2 files changed, 15 insertions(+) (limited to 'src') diff --git a/docs/release-notes.md b/docs/release-notes.md index 8ed155bd..25698ffa 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,6 +1,10 @@ ← [README](README.md) # Release notes +## Upcoming release +* For players: + * Fixed mod edits to the farmhouse shifting the player down one tile in some cases. + ## 3.12.7 Released 18 September 2021 for Stardew Valley 1.5.4. diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index 35ae26b3..8bf7a32b 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using StardewModdingAPI.Framework.ContentManagers; using StardewModdingAPI.Framework.Reflection; @@ -908,6 +909,8 @@ namespace StardewModdingAPI.Metadata /// The location whose map to reload. private void ReloadMap(GameLocation location) { + Vector2? playerPos = Game1.player?.Position; + if (this.AggressiveMemoryOptimizations) location.map.DisposeTileSheets(Game1.mapDisplayDevice); @@ -926,6 +929,14 @@ namespace StardewModdingAPI.Metadata // update for changes location.updateWarps(); location.updateDoors(); + + // reset player position + // The game may move the player as part of the map changes, even if they're not in that + // location. That's not needed in this case, and it can have weird effects like players + // warping onto the wrong tile (or even off-screen) if a patch changes the farmhouse + // map on location change. + if (playerPos.HasValue) + Game1.player.Position = playerPos.Value; } /// Reload the disposition data for matching NPCs. -- cgit From ab8599583e549bda59bc3e0783bd5e1657ef7b1b Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 27 Sep 2021 17:06:15 -0400 Subject: fix SMAPI's display device not hooked correctly in split-screen mode --- docs/release-notes.md | 3 +++ src/SMAPI/Framework/SCore.cs | 6 +++--- src/SMAPI/Framework/SGame.cs | 14 +++++++++++++- src/SMAPI/Framework/SGameRunner.cs | 10 +--------- 4 files changed, 20 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/docs/release-notes.md b/docs/release-notes.md index 25698ffa..c03b6005 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -5,6 +5,9 @@ * For players: * Fixed mod edits to the farmhouse shifting the player down one tile in some cases. +* For mod authors: + * Fixed map tile rotations/flips not working for farmhands in split-screen mode. + ## 3.12.7 Released 18 September 2021 for Stardew Valley 1.5.4. diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 86b69239..6dffb1de 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -247,7 +247,7 @@ namespace StardewModdingAPI.Framework multiplayer: this.Multiplayer, exitGameImmediately: this.ExitGameImmediately, - onGameContentLoaded: this.OnGameContentLoaded, + onGameContentLoaded: this.OnInstanceContentLoaded, onGameUpdating: this.OnGameUpdating, onPlayerInstanceUpdating: this.OnPlayerInstanceUpdating, onGameExiting: this.OnGameExiting @@ -429,8 +429,8 @@ namespace StardewModdingAPI.Framework ).Start(); } - /// Raised after the game finishes loading its initial content. - private void OnGameContentLoaded() + /// Raised after an instance finishes loading its initial content. + private void OnInstanceContentLoaded() { // override map display device Game1.mapDisplayDevice = new SDisplayDevice(Game1.content, Game1.game1.GraphicsDevice); diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs index 55ab8377..4e134455 100644 --- a/src/SMAPI/Framework/SGame.cs +++ b/src/SMAPI/Framework/SGame.cs @@ -54,6 +54,9 @@ namespace StardewModdingAPI.Framework /// Raised when the instance is updating its state (roughly 60 times per second). private readonly Action OnUpdating; + /// Raised after the instance finishes loading its initial content. + private readonly Action OnContentLoaded; + /********* ** Accessors @@ -106,7 +109,8 @@ namespace StardewModdingAPI.Framework /// The core multiplayer logic. /// Immediately exit the game without saving. This should only be invoked when an irrecoverable fatal error happens that risks save corruption or game-breaking bugs. /// Raised when the instance is updating its state (roughly 60 times per second). - public SGame(PlayerIndex playerIndex, int instanceIndex, Monitor monitor, Reflector reflection, EventManager eventManager, SInputState input, SModHooks modHooks, SMultiplayer multiplayer, Action exitGameImmediately, Action onUpdating) + /// Raised after the game finishes loading its initial content. + public SGame(PlayerIndex playerIndex, int instanceIndex, Monitor monitor, Reflector reflection, EventManager eventManager, SInputState input, SModHooks modHooks, SMultiplayer multiplayer, Action exitGameImmediately, Action onUpdating, Action onContentLoaded) : base(playerIndex, instanceIndex) { // init XNA @@ -124,6 +128,7 @@ namespace StardewModdingAPI.Framework this.Reflection = reflection; this.ExitGameImmediately = exitGameImmediately; this.OnUpdating = onUpdating; + this.OnContentLoaded = onContentLoaded; } /// Get the current input state for a button. @@ -138,6 +143,13 @@ namespace StardewModdingAPI.Framework return input.GetState(button); } + /// + protected override void LoadContent() + { + base.LoadContent(); + + this.OnContentLoaded(); + } /********* ** Protected methods diff --git a/src/SMAPI/Framework/SGameRunner.cs b/src/SMAPI/Framework/SGameRunner.cs index 45e7369c..b816bb7c 100644 --- a/src/SMAPI/Framework/SGameRunner.cs +++ b/src/SMAPI/Framework/SGameRunner.cs @@ -94,7 +94,7 @@ namespace StardewModdingAPI.Framework public override Game1 CreateGameInstance(PlayerIndex playerIndex = PlayerIndex.One, int instanceIndex = 0) { SInputState inputState = new SInputState(); - return new SGame(playerIndex, instanceIndex, this.Monitor, this.Reflection, this.Events, inputState, this.ModHooks, this.Multiplayer, this.ExitGameImmediately, this.OnPlayerInstanceUpdating); + return new SGame(playerIndex, instanceIndex, this.Monitor, this.Reflection, this.Events, inputState, this.ModHooks, this.Multiplayer, this.ExitGameImmediately, this.OnPlayerInstanceUpdating, this.OnGameContentLoaded); } /// @@ -129,14 +129,6 @@ namespace StardewModdingAPI.Framework /********* ** Protected methods *********/ - /// Load content when the game is launched. - protected override void LoadContent() - { - base.LoadContent(); - - this.OnGameContentLoaded(); - } - /// Perform cleanup logic when the game exits. /// The event sender. /// The event args. -- cgit From 0888f71a5c7fe2bbf815409a70834ac85013c7f8 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 29 Sep 2021 20:48:51 -0400 Subject: show separate beta stats in mod compatibility list --- docs/release-notes.md | 3 +++ src/SMAPI.Web/Views/Mods/Index.cshtml | 12 +++++++++--- src/SMAPI.Web/wwwroot/Content/js/mods.js | 30 ++++++++++++++++++++++-------- 3 files changed, 34 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/docs/release-notes.md b/docs/release-notes.md index c03b6005..6573e602 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -8,6 +8,9 @@ * For mod authors: * Fixed map tile rotations/flips not working for farmhands in split-screen mode. +* For the web UI: + * 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. diff --git a/src/SMAPI.Web/Views/Mods/Index.cshtml b/src/SMAPI.Web/Views/Mods/Index.cshtml index 5df49afb..8a764803 100644 --- a/src/SMAPI.Web/Views/Mods/Index.cshtml +++ b/src/SMAPI.Web/Views/Mods/Index.cshtml @@ -16,7 +16,7 @@ - +