From daa6ad3b95b3e8bec96629dc06fe25f330b99e95 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 17 Sep 2020 23:50:30 +0200 Subject: Allow for negative values in Rectangle --- src/SMAPI/Framework/Serialization/RectangleConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/SMAPI') diff --git a/src/SMAPI/Framework/Serialization/RectangleConverter.cs b/src/SMAPI/Framework/Serialization/RectangleConverter.cs index a5780d8a..8f7318b3 100644 --- a/src/SMAPI/Framework/Serialization/RectangleConverter.cs +++ b/src/SMAPI/Framework/Serialization/RectangleConverter.cs @@ -37,7 +37,7 @@ namespace StardewModdingAPI.Framework.Serialization if (string.IsNullOrWhiteSpace(str)) return Rectangle.Empty; - var match = Regex.Match(str, @"^\{X:(?\d+) Y:(?\d+) Width:(?\d+) Height:(?\d+)\}$", RegexOptions.IgnoreCase); + var match = Regex.Match(str, @"^\{X:(?-?\d+) Y:(?-?\d+) Width:(?-?\d+) Height:(?-?\d+)\}$", RegexOptions.IgnoreCase); if (!match.Success) throw new SParseException($"Can't parse {nameof(Rectangle)} from invalid value '{str}' (path: {path})."); -- cgit From e0b3f97f9e7fee838d53f020ec4ddc29a2d194e1 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 19 Sep 2020 12:46:32 -0400 Subject: fix asset propagation for Data\MoviesReactions --- src/SMAPI/Metadata/CoreAssetPropagator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/SMAPI') diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index 71199d59..701bc9f2 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -263,7 +263,7 @@ namespace StardewModdingAPI.Metadata case "data\\farmanimals": // FarmAnimal constructor return this.ReloadFarmAnimalData(); - case "data\\moviereactions": // MovieTheater.GetMovieReactions + case "data\\moviesreactions": // MovieTheater.GetMovieReactions this.Reflection .GetField>(typeof(MovieTheater), "_genericReactions") .SetValue(content.Load>(key)); -- cgit From d5c98bf2df2baff4ed048c35d903424b8e1ce2e2 Mon Sep 17 00:00:00 2001 From: Marcos Miller Dantas Date: Mon, 21 Sep 2020 10:04:21 -0300 Subject: Performance tuning on an old laptop i've noticed that the thread was consuming alot of resources. --- src/SMAPI/Framework/Logging/LogManager.cs | 14 +++++++------- src/SMAPI/Framework/SCore.cs | 7 ++++--- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'src/SMAPI') diff --git a/src/SMAPI/Framework/Logging/LogManager.cs b/src/SMAPI/Framework/Logging/LogManager.cs index 094dd749..d83a5c0b 100644 --- a/src/SMAPI/Framework/Logging/LogManager.cs +++ b/src/SMAPI/Framework/Logging/LogManager.cs @@ -138,15 +138,15 @@ namespace StardewModdingAPI.Framework.Logging Thread inputThread = new Thread(() => { while (true) - { + { // get input - string input = Console.ReadLine(); - if (string.IsNullOrWhiteSpace(input)) - continue; + string input = Console.ReadLine(); + if (string.IsNullOrWhiteSpace(input)) + continue; - // handle command - this.Monitor.LogUserInput(input); - handleInput(input); + // handle command + this.Monitor.LogUserInput(input); + handleInput(input); } }); inputThread.Start(); diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index e64c2801..e2a9463b 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -278,15 +278,16 @@ namespace StardewModdingAPI.Framework ); // add exit handler - new Thread(() => + this.CancellationToken.Token.Register(() => { - this.CancellationToken.Token.WaitHandle.WaitOne(); if (this.IsGameRunning) { + this.inputThread.Abort(); this.LogManager.WriteCrashLog(); this.Game.Exit(); } - }).Start(); + }); + // set window titles this.SetWindowTitles( -- cgit From b5573a93313fae18cafb2a78765ede168f19f634 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 22 Sep 2020 18:27:08 -0400 Subject: update release notes, format code --- src/SMAPI/Framework/Logging/LogManager.cs | 14 +++++++------- src/SMAPI/Framework/SCore.cs | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src/SMAPI') diff --git a/src/SMAPI/Framework/Logging/LogManager.cs b/src/SMAPI/Framework/Logging/LogManager.cs index d83a5c0b..094dd749 100644 --- a/src/SMAPI/Framework/Logging/LogManager.cs +++ b/src/SMAPI/Framework/Logging/LogManager.cs @@ -138,15 +138,15 @@ namespace StardewModdingAPI.Framework.Logging Thread inputThread = new Thread(() => { while (true) - { + { // get input - string input = Console.ReadLine(); - if (string.IsNullOrWhiteSpace(input)) - continue; + string input = Console.ReadLine(); + if (string.IsNullOrWhiteSpace(input)) + continue; - // handle command - this.Monitor.LogUserInput(input); - handleInput(input); + // handle command + this.Monitor.LogUserInput(input); + handleInput(input); } }); inputThread.Start(); diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index e2a9463b..776e32da 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -288,7 +288,6 @@ namespace StardewModdingAPI.Framework } }); - // set window titles this.SetWindowTitles( game: $"Stardew Valley {Constants.GameVersion} - running SMAPI {Constants.ApiVersion}", -- cgit From 05727acb9b6a90fd4911e74800fe5ea0ea02050d Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 22 Sep 2020 18:40:07 -0400 Subject: fix reference to nonexistent field It's not really needed anyway, since managed threads will end when SMAPI exits. --- src/SMAPI/Framework/SCore.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'src/SMAPI') diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 776e32da..f07e41f0 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -282,7 +282,6 @@ namespace StardewModdingAPI.Framework { if (this.IsGameRunning) { - this.inputThread.Abort(); this.LogManager.WriteCrashLog(); this.Game.Exit(); } -- cgit From 4eff88fe73760ef89423de76cae80ffeee235240 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 24 Sep 2020 19:41:36 -0400 Subject: fix error in case-insensitive content pack code when mod passes in a null path --- src/SMAPI/Framework/ContentPack.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/SMAPI') diff --git a/src/SMAPI/Framework/ContentPack.cs b/src/SMAPI/Framework/ContentPack.cs index 161fdbe4..a6835dbe 100644 --- a/src/SMAPI/Framework/ContentPack.cs +++ b/src/SMAPI/Framework/ContentPack.cs @@ -119,7 +119,7 @@ namespace StardewModdingAPI.Framework if (!PathUtilities.IsSafeRelativePath(relativePath)) throw new InvalidOperationException($"You must call {nameof(IContentPack)} methods with a relative path."); - return this.RelativePaths.TryGetValue(relativePath, out string caseInsensitivePath) + return !string.IsNullOrWhiteSpace(relativePath) && this.RelativePaths.TryGetValue(relativePath, out string caseInsensitivePath) ? caseInsensitivePath : relativePath; } -- cgit From d8f5e0bdf2da76677636e3e60979bb54da6339a7 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 3 Oct 2020 20:24:54 -0400 Subject: update dependencies --- src/SMAPI/SMAPI.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/SMAPI') diff --git a/src/SMAPI/SMAPI.csproj b/src/SMAPI/SMAPI.csproj index 7d2b8199..969071cf 100644 --- a/src/SMAPI/SMAPI.csproj +++ b/src/SMAPI/SMAPI.csproj @@ -14,9 +14,9 @@ - + - + -- cgit From 68e9733a856b41c2b74d5c35a4b812e68157fbca Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 3 Oct 2020 20:27:29 -0400 Subject: prepare for release --- src/SMAPI/Constants.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/SMAPI') diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 48428420..3927d477 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -51,7 +51,7 @@ namespace StardewModdingAPI ** Public ****/ /// SMAPI's current semantic version. - public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("3.7.3"); + public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("3.7.4"); /// The minimum supported version of Stardew Valley. public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.4.1"); -- cgit