From 0c0f7898f4ff3b2e4afdbdc438674b30be7dacc7 Mon Sep 17 00:00:00 2001 From: TehPers Date: Tue, 28 Jun 2022 16:37:58 -0700 Subject: [PATCH 01/43] Search assembly directory for dependencies --- src/SMAPI/Framework/ModLoading/AssemblyLoader.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs index eb940c41..bd29a159 100644 --- a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs +++ b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs @@ -264,8 +264,18 @@ namespace StardewModdingAPI.Framework.ModLoading if (!file.Exists) yield break; // not a local assembly + // add the assembly's directory temporarily if needed + // this is needed by F# mods which bundle FSharp.Core.dll, for example + string? temporarySearchDir = null; + if (file.DirectoryName is not null && !this.AssemblyDefinitionResolver.GetSearchDirectories().Contains(file.DirectoryName)) + { + this.AssemblyDefinitionResolver.AddSearchDirectory(file.DirectoryName); + temporarySearchDir = file.DirectoryName; + } + // read assembly AssemblyDefinition assembly; + try { byte[] assemblyBytes = File.ReadAllBytes(file.FullName); Stream readStream = this.TrackForDisposal(new MemoryStream(assemblyBytes)); @@ -286,6 +296,12 @@ namespace StardewModdingAPI.Framework.ModLoading assembly = this.TrackForDisposal(AssemblyDefinition.ReadAssembly(readStream, new ReaderParameters(ReadingMode.Immediate) { AssemblyResolver = assemblyResolver, InMemory = true })); } } + finally + { + // clean up temporary search directory + if (temporarySearchDir is not null) + this.AssemblyDefinitionResolver.RemoveSearchDirectory(temporarySearchDir); + } // skip if already visited if (visitedAssemblyNames.Contains(assembly.Name.Name)) From f44a2fbfcfd06ac82c5b77177b0fd9475757d945 Mon Sep 17 00:00:00 2001 From: Chase Warrington Date: Mon, 4 Jul 2022 20:42:27 -0400 Subject: [PATCH 02/43] Add app.manifest, fixing DPI awareness --- src/SMAPI/SMAPI.csproj | 1 + src/SMAPI/app.manifest | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 src/SMAPI/app.manifest diff --git a/src/SMAPI/SMAPI.csproj b/src/SMAPI/SMAPI.csproj index c05512e9..1c745702 100644 --- a/src/SMAPI/SMAPI.csproj +++ b/src/SMAPI/SMAPI.csproj @@ -16,6 +16,7 @@ false + app.manifest diff --git a/src/SMAPI/app.manifest b/src/SMAPI/app.manifest new file mode 100644 index 00000000..d209bf77 --- /dev/null +++ b/src/SMAPI/app.manifest @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true/pm + + + + From dcb3a97727401c2b3704e277bc4062b3bd89448e Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 8 Jul 2022 17:44:27 -0400 Subject: [PATCH 03/43] add log parser warning for PyTK compatibility mode --- docs/release-notes.md | 4 ++++ src/SMAPI.Web/Views/LogParser/Index.cshtml | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 8b258fb3..cf237a82 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -7,6 +7,10 @@ _If needed, you can update to SMAPI 3.15.0 first and then install to the latest version._ --> +## Upcoming release +* For the web UI: + * Added log parser warning about performance of PyTK 1.23.0 or earlier. + ## 3.15.1 Released 06 July 2022 for Stardew Valley 1.5.6 or later. diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index b824b768..57e26ace 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -17,6 +17,7 @@ LogModInfo[] outdatedMods = log?.Mods.Where(mod => mod.HasUpdate).ToArray() ?? Array.Empty(); LogModInfo? errorHandler = log?.Mods.FirstOrDefault(p => p.IsCodeMod && p.Name == "Error Handler"); bool hasOlderErrorHandler = errorHandler?.GetParsedVersion() is not null && log?.ApiVersionParsed is not null && log.ApiVersionParsed.IsNewerThan(errorHandler.GetParsedVersion()); + bool isPyTkCompatibilityMode = log?.ApiVersionParsed?.IsOlderThan("3.15.0") is false && log.Mods.Any(p => p.IsCodeMod && p.Name == "PyTK" && p.GetParsedVersion()?.IsOlderThan("1.23.1") is true); // get filters IDictionary defaultFilters = Enum @@ -242,7 +243,7 @@ else if (log?.IsValid == true) @if (log?.IsValid == true) {
- @if (outdatedMods.Any() || errorHandler is null || hasOlderErrorHandler) + @if (outdatedMods.Any() || errorHandler is null || hasOlderErrorHandler || isPyTkCompatibilityMode) {

Suggested fixes

    @@ -254,6 +255,10 @@ else if (log?.IsValid == true) {
  • Your Error Handler mod is older than SMAPI. You may be missing some game/mod error fixes. You can reinstall SMAPI to update it.
  • } + @if (isPyTkCompatibilityMode) + { +
  • PyTK 1.23.0 or earlier isn't compatible with newer SMAPI performance optimizations. This may increase loading times or in-game lag.
  • + } @if (outdatedMods.Any()) {
  • From 1b25710cf26ccc46485c9475e33980a5490b9561 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 8 Jul 2022 17:48:01 -0400 Subject: [PATCH 04/43] fix installer partly applying color theme before it's selected --- docs/release-notes.md | 3 +++ src/SMAPI.Installer/InteractiveInstaller.cs | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index cf237a82..6c3edb77 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -8,6 +8,9 @@ --> ## Upcoming release +* For players: + * Fixed Linux/macOS installer's color theme question partly unreadable if the terminal background is dark. + * For the web UI: * Added log parser warning about performance of PyTK 1.23.0 or earlier. diff --git a/src/SMAPI.Installer/InteractiveInstaller.cs b/src/SMAPI.Installer/InteractiveInstaller.cs index fd1a6047..d00a5df4 100644 --- a/src/SMAPI.Installer/InteractiveInstaller.cs +++ b/src/SMAPI.Installer/InteractiveInstaller.cs @@ -206,7 +206,7 @@ namespace StardewModdingApi.Installer Console.WriteLine(); // handle choice - string choice = this.InteractivelyChoose("Type 1 or 2, then press enter.", new[] { "1", "2" }); + string choice = this.InteractivelyChoose("Type 1 or 2, then press enter.", new[] { "1", "2" }, printLine: Console.WriteLine); switch (choice) { case "1": @@ -629,22 +629,22 @@ namespace StardewModdingApi.Installer } /// Interactively ask the user to choose a value. - /// A callback which prints a message to the console. + /// A callback which prints a message to the console. /// The message to print. /// The allowed options (not case sensitive). /// The indentation to prefix to output. - private string InteractivelyChoose(string message, string[] options, string indent = "", Action? print = null) + private string InteractivelyChoose(string message, string[] options, string indent = "", Action? printLine = null) { - print ??= this.PrintInfo; + printLine ??= this.PrintInfo; while (true) { - print(indent + message); + printLine(indent + message); Console.Write(indent); string? input = Console.ReadLine()?.Trim().ToLowerInvariant(); if (input == null || !options.Contains(input)) { - print($"{indent}That's not a valid option."); + printLine($"{indent}That's not a valid option."); continue; } return input; From 1b3a1a48d0d0d7e2423db54f3266cabd80a5a9b3 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 8 Jul 2022 19:02:33 -0400 Subject: [PATCH 05/43] refactor assembly resolver to avoid repeatedly copying search directory list --- src/SMAPI/Constants.cs | 4 +- .../ModLoading/AssemblyDefinitionResolver.cs | 70 +++++++++++++++++-- .../Framework/ModLoading/AssemblyLoader.cs | 5 +- 3 files changed, 67 insertions(+), 12 deletions(-) diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 33468717..442f2ec8 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -244,8 +244,8 @@ namespace StardewModdingAPI internal static void ConfigureAssemblyResolver(AssemblyDefinitionResolver resolver) { // add search paths - resolver.AddSearchDirectory(Constants.GamePath); - resolver.AddSearchDirectory(Constants.InternalFilesPath); + resolver.TryAddSearchDirectory(Constants.GamePath); + resolver.TryAddSearchDirectory(Constants.InternalFilesPath); // add SMAPI explicitly // Normally this would be handled automatically by the search paths, but for some reason there's a specific diff --git a/src/SMAPI/Framework/ModLoading/AssemblyDefinitionResolver.cs b/src/SMAPI/Framework/ModLoading/AssemblyDefinitionResolver.cs index b3378ad1..5a850255 100644 --- a/src/SMAPI/Framework/ModLoading/AssemblyDefinitionResolver.cs +++ b/src/SMAPI/Framework/ModLoading/AssemblyDefinitionResolver.cs @@ -4,18 +4,31 @@ using Mono.Cecil; namespace StardewModdingAPI.Framework.ModLoading { /// A minimal assembly definition resolver which resolves references to known assemblies. - internal class AssemblyDefinitionResolver : DefaultAssemblyResolver + internal class AssemblyDefinitionResolver : IAssemblyResolver { /********* ** Fields *********/ + /// The underlying assembly resolver. + private readonly DefaultAssemblyResolverWrapper Resolver = new(); + /// The known assemblies. private readonly IDictionary Lookup = new Dictionary(); + /// The directory paths to search for assemblies. + private readonly HashSet SearchPaths = new(); + /********* ** Public methods *********/ + /// Construct an instance. + public AssemblyDefinitionResolver() + { + foreach (string path in this.Resolver.GetSearchDirectories()) + this.SearchPaths.Add(path); + } + /// Add known assemblies to the resolver. /// The known assemblies. public void Add(params AssemblyDefinition[] assemblies) @@ -29,7 +42,7 @@ namespace StardewModdingAPI.Framework.ModLoading /// The assembly names for which it should be returned. public void AddWithExplicitNames(AssemblyDefinition assembly, params string[] names) { - this.RegisterAssembly(assembly); + this.Resolver.AddAssembly(assembly); foreach (string name in names) this.Lookup[name] = assembly; } @@ -37,18 +50,52 @@ namespace StardewModdingAPI.Framework.ModLoading /// Resolve an assembly reference. /// The assembly name. /// The assembly can't be resolved. - public override AssemblyDefinition Resolve(AssemblyNameReference name) + public AssemblyDefinition Resolve(AssemblyNameReference name) { - return this.ResolveName(name.Name) ?? base.Resolve(name); + return this.ResolveName(name.Name) ?? this.Resolver.Resolve(name); } /// Resolve an assembly reference. /// The assembly name. /// The assembly reader parameters. /// The assembly can't be resolved. - public override AssemblyDefinition Resolve(AssemblyNameReference name, ReaderParameters parameters) + public AssemblyDefinition Resolve(AssemblyNameReference name, ReaderParameters parameters) { - return this.ResolveName(name.Name) ?? base.Resolve(name, parameters); + return this.ResolveName(name.Name) ?? this.Resolver.Resolve(name, parameters); + } + + /// Add a directory path to search for assemblies, if it's non-null and not already added. + /// The path to search. + /// Returns whether the path was successfully added. + public bool TryAddSearchDirectory(string? path) + { + if (path is not null && this.SearchPaths.Add(path)) + { + this.Resolver.AddSearchDirectory(path); + return true; + } + + return false; + } + + /// Remove a directory path to search for assemblies, if it's non-null. + /// The path to remove. + /// Returns whether the path was in the list and removed. + public bool RemoveSearchDirectory(string? path) + { + if (path is not null && this.SearchPaths.Remove(path)) + { + this.Resolver.RemoveSearchDirectory(path); + return true; + } + + return false; + } + + /// + public void Dispose() + { + this.Resolver.Dispose(); } @@ -63,5 +110,16 @@ namespace StardewModdingAPI.Framework.ModLoading ? match : null; } + + /// An internal wrapper around to allow access to its protected methods. + private class DefaultAssemblyResolverWrapper : DefaultAssemblyResolver + { + /// Add an assembly to the resolver. + /// The assembly to add. + public void AddAssembly(AssemblyDefinition assembly) + { + this.RegisterAssembly(assembly); + } + } } } diff --git a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs index bd29a159..01037870 100644 --- a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs +++ b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs @@ -267,11 +267,8 @@ namespace StardewModdingAPI.Framework.ModLoading // add the assembly's directory temporarily if needed // this is needed by F# mods which bundle FSharp.Core.dll, for example string? temporarySearchDir = null; - if (file.DirectoryName is not null && !this.AssemblyDefinitionResolver.GetSearchDirectories().Contains(file.DirectoryName)) - { - this.AssemblyDefinitionResolver.AddSearchDirectory(file.DirectoryName); + if (this.AssemblyDefinitionResolver.TryAddSearchDirectory(file.DirectoryName)) temporarySearchDir = file.DirectoryName; - } // read assembly AssemblyDefinition assembly; From bc71665c1c696f5b99902bd3fc583f750a342fbe Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 8 Jul 2022 19:11:40 -0400 Subject: [PATCH 06/43] apply editorconfig --- src/SMAPI/app.manifest | 56 ++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/src/SMAPI/app.manifest b/src/SMAPI/app.manifest index d209bf77..89aeca70 100644 --- a/src/SMAPI/app.manifest +++ b/src/SMAPI/app.manifest @@ -1,42 +1,40 @@ - - - - - - - - + + + + + + + + - - - - - + + - - + + - - + + - - + + - - + + + + + + + true/pm + - - - - - true/pm - - - From 0c787de2df202eb35c40b24b907619ecf750f051 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 8 Jul 2022 19:13:45 -0400 Subject: [PATCH 07/43] match settings used by the game --- src/SMAPI/app.manifest | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SMAPI/app.manifest b/src/SMAPI/app.manifest index 89aeca70..42faff59 100644 --- a/src/SMAPI/app.manifest +++ b/src/SMAPI/app.manifest @@ -1,6 +1,6 @@ - + @@ -35,6 +35,7 @@ true/pm + permonitorv2,permonitor From 8eeda8b4c496f73d2101c59f5b443bb6c2a2a06b Mon Sep 17 00:00:00 2001 From: Ishan Jalan Date: Fri, 8 Jul 2022 12:28:53 +0530 Subject: [PATCH 08/43] SVGs for pufferchick and pufferchick-cool SVG > PNG --- .gitignore | 4 ++++ src/SMAPI.Web/Views/Index/Index.cshtml | 2 +- src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg | 1 + src/SMAPI.Web/wwwroot/Content/images/pufferchick.svg | 1 + src/SMAPI.Web/wwwroot/Content/js/index.js | 4 ++-- 5 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg create mode 100644 src/SMAPI.Web/wwwroot/Content/images/pufferchick.svg diff --git a/.gitignore b/.gitignore index 527ac6bb..e4cc7c26 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,7 @@ appsettings.Development.json # Azure generated files src/SMAPI.Web/Properties/PublishProfiles/*.pubxml src/SMAPI.Web/Properties/ServiceDependencies/* - Web Deploy/ +src/SMAPI.Web/.DS_Store +src/SMAPI.Web/wwwroot/Content/images/.DS_Store +src/SMAPI.Web/wwwroot/Content/.DS_Store +src/SMAPI.Web/wwwroot/.DS_Store diff --git a/src/SMAPI.Web/Views/Index/Index.cshtml b/src/SMAPI.Web/Views/Index/Index.cshtml index acb8df78..308ed1e5 100644 --- a/src/SMAPI.Web/Views/Index/Index.cshtml +++ b/src/SMAPI.Web/Views/Index/Index.cshtml @@ -15,7 +15,7 @@

    SMAPI - +

    The mod loader for Stardew Valley.

    diff --git a/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg b/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg new file mode 100644 index 00000000..0b4c3ad1 --- /dev/null +++ b/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/SMAPI.Web/wwwroot/Content/images/pufferchick.svg b/src/SMAPI.Web/wwwroot/Content/images/pufferchick.svg new file mode 100644 index 00000000..5e77e493 --- /dev/null +++ b/src/SMAPI.Web/wwwroot/Content/images/pufferchick.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/SMAPI.Web/wwwroot/Content/js/index.js b/src/SMAPI.Web/wwwroot/Content/js/index.js index d0734b02..04db5c2f 100644 --- a/src/SMAPI.Web/wwwroot/Content/js/index.js +++ b/src/SMAPI.Web/wwwroot/Content/js/index.js @@ -3,10 +3,10 @@ $(document).ready(function () { var pufferchick = $("#pufferchick"); $(".cta-dropdown").hover( function () { - pufferchick.attr("src", "Content/images/pufferchick-cool.png"); + pufferchick.attr("src", "Content/images/pufferchick-cool.svg"); }, function () { - pufferchick.attr("src", "Content/images/pufferchick.png"); + pufferchick.attr("src", "Content/images/pufferchick.svg"); } ); From 173bc4f517586a0b0cbbcf3ec6f966800c734bd4 Mon Sep 17 00:00:00 2001 From: Ishan Jalan Date: Fri, 8 Jul 2022 20:50:34 +0530 Subject: [PATCH 09/43] Updated pufferchick cool --- .gitignore | 1 + src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e4cc7c26..daf93b7e 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ src/SMAPI.Web/.DS_Store src/SMAPI.Web/wwwroot/Content/images/.DS_Store src/SMAPI.Web/wwwroot/Content/.DS_Store src/SMAPI.Web/wwwroot/.DS_Store +.DS_Store diff --git a/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg b/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg index 0b4c3ad1..a4985468 100644 --- a/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg +++ b/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file From a52f24307b45e028aa08bc13352a89293567b850 Mon Sep 17 00:00:00 2001 From: Ishan Jalan Date: Fri, 8 Jul 2022 21:03:43 +0530 Subject: [PATCH 10/43] pufferchick-cool updated [2] --- src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg b/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg index a4985468..cb38da73 100644 --- a/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg +++ b/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file From 5da690cbefb34acaecaeaa17110d1b701f3d87ba Mon Sep 17 00:00:00 2001 From: Ishan Jalan Date: Fri, 8 Jul 2022 21:27:54 +0530 Subject: [PATCH 11/43] Update pufferchick-cool.svg --- src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg b/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg index cb38da73..28b03976 100644 --- a/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg +++ b/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file From 72ba455d5afbeaff089a6b5ab57d8009910be5e0 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 8 Jul 2022 19:36:09 -0400 Subject: [PATCH 12/43] simplify .gitignore --- .gitignore | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index daf93b7e..a89ccd21 100644 --- a/.gitignore +++ b/.gitignore @@ -34,8 +34,6 @@ appsettings.Development.json # Azure generated files src/SMAPI.Web/Properties/PublishProfiles/*.pubxml src/SMAPI.Web/Properties/ServiceDependencies/* - Web Deploy/ -src/SMAPI.Web/.DS_Store -src/SMAPI.Web/wwwroot/Content/images/.DS_Store -src/SMAPI.Web/wwwroot/Content/.DS_Store -src/SMAPI.Web/wwwroot/.DS_Store + +# macOS .DS_Store From 477ecbab6ee4f011c68736c821cbe1476b384d29 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 8 Jul 2022 19:36:32 -0400 Subject: [PATCH 13/43] bypass browser cache & delete unused images --- src/SMAPI.Web/Views/Index/Index.cshtml | 2 +- .../wwwroot/Content/images/pufferchick-cool.png | Bin 1099 -> 0 bytes .../wwwroot/Content/images/pufferchick.png | Bin 831 -> 0 bytes 3 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.png delete mode 100644 src/SMAPI.Web/wwwroot/Content/images/pufferchick.png diff --git a/src/SMAPI.Web/Views/Index/Index.cshtml b/src/SMAPI.Web/Views/Index/Index.cshtml index 308ed1e5..d6472fcb 100644 --- a/src/SMAPI.Web/Views/Index/Index.cshtml +++ b/src/SMAPI.Web/Views/Index/Index.cshtml @@ -10,7 +10,7 @@ @section Head { - + }

    diff --git a/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.png b/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.png deleted file mode 100644 index f359146c8470bdb49e3b55683e0c13eb8e555c3c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1099 zcmeAS@N?(olHy`uVBq!ia0vp^mOyO9!3HF`dOm6cDVB6cUq=Rpjs4tz5?O(K&H|6f zVg?4j!ywFfJby(BP*AeOHKHUqKdq!Zu_%?HATcwqL@zJ3M8QPQK+nkVqeA9X1_tI6 zo-U3d8P0E~`eum)inK;w6cH4|9!M-`x z#jJXVM0YT)6^IR_t~s%Q^m1zgWcS#?8|0ea^-Q5 zm?Y1VUE)$6xiDx~hx=s3C5x1Io#vW)DQy1yx1OC*tuMOQgkMm<6?WqD<`A~bMQiso zzu;FC&DDPLGg7PBWTLX%$LGga9QtfqS8LU}_g?#=*Rw;}GL_t8&MdaQpUiR7-Q(Xc zwWwPfde0VyO%P$*@Xx+=cS-H$Qw@UJ2`=8!N00t@J@MguScKyBo?SdShCP4&g?;?| zx{x)Sqxs{@){Ujt6%dUUb2O=oAQ zY>E4~`)9wt`2MM={rI(NrB?f!lNaCo)Es$+FSR`8edq29=MOm_GuV<74oT@fXnbic zc1@(`{oYC6f0;ag|LtktuQ$4y)qnC2TwT;>&T{{nmXq6|RR<#8$=6(2ZaMk!ap~6c z_o`}B+~elFFi)sc(*GhIaP4E;gWFNLCk|97&5n-VB)YS9bD4qV-&yVX2U3b7M`%aYhuoImNP;k7=!nGzo5Lv`t(=nt$HK(o2$%bDqzw zH0S6%nH{qg*BH!u-=_1w#-&2#@DqXQ9|F#uYTUfWUQ{m6AdBN>6SwfB4-9hWlXtAC z(VvxIdvc{>++OJ$ToRH_anmNWG;+2J={<9lTk}0(?^feQ6VILEnwrGg6Va`7uaL0d zBxSwNe2eBYS4+;=w=RF0sFtdG%o|xRd-iX9ivLx$L%gCta=eZ`=XzZ9kwmWy3p+ub!GNs`b?7h`}A#c<Z*}7%- zjsuSo!eN|;pZth5I2-z)_2VDC8PBvn9IB`j_xW6;xOo4(L!VZjy765MnDH4rUHx3v IIVCg!0C~0hegFUf diff --git a/src/SMAPI.Web/wwwroot/Content/images/pufferchick.png b/src/SMAPI.Web/wwwroot/Content/images/pufferchick.png deleted file mode 100644 index 1de9cf472447de7ae754afb34a0aa50085fa0695..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 831 zcmV-F1Hk-=P)Px#1ZP1_K>z@;j|==^1poj7=}AOERA@u(l`(D>K@3L!js}SvMBIRehK>tB&lxxg zReCylBo4s|xBy6;0f`1_VK$!4i}&-yquKu#iRP1D<9KYpNSmCNWjUPpFP|(u`1eO6 zi=!x!7XJOw$l@qUq=kQfG_p7f1-@QgZ7gpz?Dw;dKo&>g(Nof3zn^skvgjEJ1qdbi zi(rq97>|TXRFM{$@Q6R(P8(4@;>U+u_%`~b*!p&=NQ+Fkm`6wTh$(r5B>#L9Yi)*$d8iWc zP(c0M!(Fz%ohn#Rf(2`BhKr}9;Ovr=S$=-m`2OkL273sXWyD@QzeWAL1>bTPZ!o2O zc=VJMZ~+&qBMUrK{k#R=au;tfrG0ob#VAbJ!v#Dj`o@0!{=C6@hUhJCFr|H_q<}qK zz{UTys(OaEWXLW-IP!=Q9YEb|2_&l zk}?^}5+2G~88}P*tB452m?_!8gOMaWfXDL~F00=~3-*&t4~hCiVI^3Yl8;4_P?&Hi z;bI;X!Tt#LtDOZ?+DA!wlwd(EDn!Rcus?$RYG=We_EAzEC0J043ej;9?2ll-+F3BA zeUy|Z6E2GmVm$-jQkZpH-;R> Date: Fri, 8 Jul 2022 19:40:54 -0400 Subject: [PATCH 14/43] update release notes --- docs/release-notes.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 6c3edb77..df3949be 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -9,10 +9,15 @@ ## Upcoming release * For players: - * Fixed Linux/macOS installer's color theme question partly unreadable if the terminal background is dark. + * Fixed SMAPI applying different DPI awareness settings than the game (thanks to spacechase0!). + * Fixed Linux/macOS installer's color scheme question partly unreadable if the terminal background is dark. + +* For mod authors: + * While loading your mod, SMAPI now searches for indirect dependencies in your mod's folder to support edge cases like F# mods (thanks to TehPers)! * For the web UI: * Added log parser warning about performance of PyTK 1.23.0 or earlier. + * Converted pufferchick icons to SVG (thanks to ishan!). ## 3.15.1 Released 06 July 2022 for Stardew Valley 1.5.6 or later. From 521129ad213da58fda5851f181a81bf661dde9b5 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 9 Jul 2022 00:53:11 -0400 Subject: [PATCH 15/43] raise deprecation levels --- docs/release-notes.md | 2 ++ src/SMAPI/Constants.cs | 2 +- src/SMAPI/Framework/Content/AssetInfo.cs | 4 ++-- src/SMAPI/Framework/ModHelpers/CommandHelper.cs | 2 +- src/SMAPI/Framework/ModHelpers/ContentHelper.cs | 8 ++++---- src/SMAPI/Framework/ModHelpers/ModHelper.cs | 2 +- src/SMAPI/Framework/SCore.cs | 6 +++--- src/SMAPI/Utilities/PerScreen.cs | 2 +- 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index df3949be..13c0dce8 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -14,6 +14,8 @@ * For mod authors: * While loading your mod, SMAPI now searches for indirect dependencies in your mod's folder to support edge cases like F# mods (thanks to TehPers)! + * **Raised deprecation message levels.** + _Deprecation warnings are now player-visible in the SMAPI console as grayed-out `DEBUG` messages. They'll be raised to `WARN` level in SMAPI 3.17 next month, which will be the last major release before SMAPI 4.0._ * For the web UI: * Added log parser warning about performance of PyTK 1.23.0 or earlier. diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index c59af612..7aaa33bb 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -90,7 +90,7 @@ namespace StardewModdingAPI source: null, nounPhrase: $"{nameof(Constants)}.{nameof(Constants.ExecutionPath)}", version: "3.14.0", - severity: DeprecationLevel.Notice + severity: DeprecationLevel.Info ); return Constants.GamePath; diff --git a/src/SMAPI/Framework/Content/AssetInfo.cs b/src/SMAPI/Framework/Content/AssetInfo.cs index 43feed27..af000300 100644 --- a/src/SMAPI/Framework/Content/AssetInfo.cs +++ b/src/SMAPI/Framework/Content/AssetInfo.cs @@ -45,7 +45,7 @@ namespace StardewModdingAPI.Framework.Content source: null, nounPhrase: $"{nameof(IAssetInfo)}.{nameof(IAssetInfo.AssetName)}", version: "3.14.0", - severity: DeprecationLevel.Notice, + severity: DeprecationLevel.Info, unlessStackIncludes: new[] { $"{typeof(AssetInterceptorChange).FullName}.{nameof(AssetInterceptorChange.CanIntercept)}", @@ -84,7 +84,7 @@ namespace StardewModdingAPI.Framework.Content source: null, nounPhrase: $"{nameof(IAssetInfo)}.{nameof(IAssetInfo.AssetNameEquals)}", version: "3.14.0", - severity: DeprecationLevel.Notice, + severity: DeprecationLevel.Info, unlessStackIncludes: new[] { $"{typeof(AssetInterceptorChange).FullName}.{nameof(AssetInterceptorChange.CanIntercept)}", diff --git a/src/SMAPI/Framework/ModHelpers/CommandHelper.cs b/src/SMAPI/Framework/ModHelpers/CommandHelper.cs index 21435f62..b7d4861f 100644 --- a/src/SMAPI/Framework/ModHelpers/CommandHelper.cs +++ b/src/SMAPI/Framework/ModHelpers/CommandHelper.cs @@ -43,7 +43,7 @@ namespace StardewModdingAPI.Framework.ModHelpers source: this.Mod, nounPhrase: $"{nameof(IModHelper)}.{nameof(IModHelper.ConsoleCommands)}.{nameof(ICommandHelper.Trigger)}", version: "3.8.1", - severity: DeprecationLevel.Notice + severity: DeprecationLevel.Info ); return this.CommandManager.Trigger(name, arguments); diff --git a/src/SMAPI/Framework/ModHelpers/ContentHelper.cs b/src/SMAPI/Framework/ModHelpers/ContentHelper.cs index 9992cb52..0a1633bf 100644 --- a/src/SMAPI/Framework/ModHelpers/ContentHelper.cs +++ b/src/SMAPI/Framework/ModHelpers/ContentHelper.cs @@ -62,7 +62,7 @@ namespace StardewModdingAPI.Framework.ModHelpers source: this.Mod, nounPhrase: $"{nameof(IContentHelper)}.{nameof(IContentHelper.AssetLoaders)}", version: "3.14.0", - severity: DeprecationLevel.Notice + severity: DeprecationLevel.Info ); return this.ObservableAssetLoaders; @@ -78,7 +78,7 @@ namespace StardewModdingAPI.Framework.ModHelpers source: this.Mod, nounPhrase: $"{nameof(IContentHelper)}.{nameof(IContentHelper.AssetEditors)}", version: "3.14.0", - severity: DeprecationLevel.Notice + severity: DeprecationLevel.Info ); return this.ObservableAssetEditors; @@ -126,7 +126,7 @@ namespace StardewModdingAPI.Framework.ModHelpers this.Mod, "loading assets from the Content folder with a .xnb file extension", "3.14.0", - DeprecationLevel.Notice + DeprecationLevel.Info ); } @@ -150,7 +150,7 @@ namespace StardewModdingAPI.Framework.ModHelpers this.Mod, "loading XNB files from the mod folder without the .xnb file extension", "3.14.0", - DeprecationLevel.Notice + DeprecationLevel.Info ); return data; } diff --git a/src/SMAPI/Framework/ModHelpers/ModHelper.cs b/src/SMAPI/Framework/ModHelpers/ModHelper.cs index caa66bad..1cdd8536 100644 --- a/src/SMAPI/Framework/ModHelpers/ModHelper.cs +++ b/src/SMAPI/Framework/ModHelpers/ModHelper.cs @@ -41,7 +41,7 @@ namespace StardewModdingAPI.Framework.ModHelpers source: this.Mod, nounPhrase: $"{nameof(IModHelper)}.{nameof(IModHelper.Content)}", version: "3.14.0", - severity: DeprecationLevel.Notice + severity: DeprecationLevel.Info ); return this.ContentImpl; diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 46d65f6a..1a1bb9f8 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -1670,7 +1670,7 @@ namespace StardewModdingAPI.Framework source: metadata, nounPhrase: $"{nameof(IAssetEditor)}", version: "3.14.0", - severity: DeprecationLevel.Notice, + severity: DeprecationLevel.Info, logStackTrace: false ); @@ -1683,7 +1683,7 @@ namespace StardewModdingAPI.Framework source: metadata, nounPhrase: $"{nameof(IAssetLoader)}", version: "3.14.0", - severity: DeprecationLevel.Notice, + severity: DeprecationLevel.Info, logStackTrace: false ); @@ -1715,7 +1715,7 @@ namespace StardewModdingAPI.Framework metadata, $"using {name} without bundling it", "3.14.7", - DeprecationLevel.Notice, + DeprecationLevel.Info, logStackTrace: false ); } diff --git a/src/SMAPI/Utilities/PerScreen.cs b/src/SMAPI/Utilities/PerScreen.cs index 54657ade..468df0bd 100644 --- a/src/SMAPI/Utilities/PerScreen.cs +++ b/src/SMAPI/Utilities/PerScreen.cs @@ -59,7 +59,7 @@ namespace StardewModdingAPI.Utilities null, $"calling the {nameof(PerScreen)} constructor with null", "3.14.0", - DeprecationLevel.Notice + DeprecationLevel.Info ); #else throw new ArgumentNullException(nameof(createNewState)); From 6d9dcdc2f850b840c5f2e9ff30698e9eee92670b Mon Sep 17 00:00:00 2001 From: Ishan Jalan Date: Sat, 9 Jul 2022 08:57:02 +0530 Subject: [PATCH 16/43] Update pufferchick-cool.svg --- src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg b/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg index 28b03976..2734c289 100644 --- a/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg +++ b/src/SMAPI.Web/wwwroot/Content/images/pufferchick-cool.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file From 830d2c57cc4f02d0dbc9504bde641a0c3c412234 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 9 Jul 2022 01:06:32 -0400 Subject: [PATCH 17/43] update log parser for new update alert format --- docs/release-notes.md | 1 + src/SMAPI.Web/Framework/LogParsing/LogParser.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 13c0dce8..6ae59ad8 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -20,6 +20,7 @@ * For the web UI: * Added log parser warning about performance of PyTK 1.23.0 or earlier. * Converted pufferchick icons to SVG (thanks to ishan!). + * Updated log parser for new update alert format in SMAPI 3.15.1. ## 3.15.1 Released 06 July 2022 for Stardew Valley 1.5.6 or later. diff --git a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs index 0efa62c5..4a110dcd 100644 --- a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs +++ b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs @@ -42,7 +42,7 @@ namespace StardewModdingAPI.Web.Framework.LogParsing private readonly Regex ModUpdateListStartPattern = new(@"^You can update \d+ mods?:$", RegexOptions.Compiled | RegexOptions.IgnoreCase); /// A regex pattern matching an entry in SMAPI's mod update list. - private readonly Regex ModUpdateListEntryPattern = new(@"^ (?.+) (?[^\s]+): (?.+)$", RegexOptions.Compiled | RegexOptions.IgnoreCase); + private readonly Regex ModUpdateListEntryPattern = new(@"^ (?.+) (?[^\s]+): (?[^\s]+)(?: \(you have [^\)]+\))?$", RegexOptions.Compiled | RegexOptions.IgnoreCase); /// A regex pattern matching SMAPI's update line. private readonly Regex SmapiUpdatePattern = new(@"^You can update SMAPI to (?[^\s]+): (?.+)$", RegexOptions.Compiled | RegexOptions.IgnoreCase); From da1eca369642a128d7c3608b3c5b45d61f05350a Mon Sep 17 00:00:00 2001 From: Ishan Jalan Date: Sun, 17 Jul 2022 09:53:52 +0530 Subject: [PATCH 18/43] Moving Sidebar GIF to SVG --- .../wwwroot/Content/images/sidebar-bg.gif | Bin 1104 -> 0 bytes .../wwwroot/Content/images/sidebar-bg.svg | 1 + 2 files changed, 1 insertion(+) delete mode 100644 src/SMAPI.Web/wwwroot/Content/images/sidebar-bg.gif create mode 100644 src/SMAPI.Web/wwwroot/Content/images/sidebar-bg.svg diff --git a/src/SMAPI.Web/wwwroot/Content/images/sidebar-bg.gif b/src/SMAPI.Web/wwwroot/Content/images/sidebar-bg.gif deleted file mode 100644 index 48e9af5a033ad34ecfe9b737d48a31d1172fe396..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1104 zcmb8o2{+pZ008iRB8em-!5pFPTO17y646y#qa`+Brmt&N>PlLz)k-5B3klLK4cXSY zg4AA2bhWiV>LERl_WnqQpF4sSJ?$XFV2Bq1@baO8 zKy)w|KIU1`HxW1p0?)c3#wUaX*vFt7ZiaIzmN!2K1S^KFZv>#EU?hA)_#33#F*bRS z@abMi-XW=YpvG=c@AS5r&f{=ZU|Wg0kr!T!v~Pa7XL=qir0KEv*#7LHqHn@r;zrp* zKRcnRWB>)gp`4mdy6kfgwhO`#IrO^W+JXbf9J!(8NutjnJcn4G>y7(HaYkx#^)wz0nw6S5LC$B9DO5Jgqu zENe6RGx}1 z4aYUd+7s^XWQQ6Ssz?!KR|E##zDf)b{}J-2&VA)48*#Rk7_uXF#@!AGVg>5nQ*L&o zf%LPtqUNN*ZST;lCg8V;op%nAkX=0G=8E{u3jX8#r8~`tmkV;2Dh^?nZsvu2`A$1)8E>$Y21i5 z_>@q1JpudW?oN7A{^jq?fv6|c8iSlJB?9HX!GU`xYi#S~B|6Ey!x9(b| zDL@O>bU$ozs-Kh**<$dm+_fmF7C7ZjA&gm%R2n*668Ht(Tc#Pm|At1tQ;3+ErBv!4 zoNUVBSJ_<;O=TEm9(DJa5kjfY8uM=jC@v*k)o$Sc$*x3IN?1EdB0+KER;Sx~UX?ciYwesrP{B^(!wAB}W7W^_KL{EXB5(gXp8#ev_E+nN42H7BflUbG_qlE^dZQ&lQUHAXX;))pSK(Y S?U`hczy3Lf2sHr% \ No newline at end of file From 88517715a3551240ce87892950ec513235874857 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 17 Jul 2022 11:04:45 -0400 Subject: [PATCH 19/43] update image reference --- src/SMAPI.Web/wwwroot/Content/css/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SMAPI.Web/wwwroot/Content/css/main.css b/src/SMAPI.Web/wwwroot/Content/css/main.css index a0a407d8..79de9c39 100644 --- a/src/SMAPI.Web/wwwroot/Content/css/main.css +++ b/src/SMAPI.Web/wwwroot/Content/css/main.css @@ -68,7 +68,7 @@ a { margin-top: 3em; min-height: 75%; width: 12em; - background: url("../images/sidebar-bg.gif") no-repeat top right; + background: url("../images/sidebar-bg.svg") no-repeat top right; color: #666; } From 1b7dfb28f2968ccce0ee0669e88a7258f1662e81 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 17 Jul 2022 11:07:53 -0400 Subject: [PATCH 20/43] update release notes --- docs/release-notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 6ae59ad8..40f79d8e 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -19,7 +19,7 @@ * For the web UI: * Added log parser warning about performance of PyTK 1.23.0 or earlier. - * Converted pufferchick icons to SVG (thanks to ishan!). + * Converted images to SVG (thanks to ishan!). * Updated log parser for new update alert format in SMAPI 3.15.1. ## 3.15.1 From 3da5917eed5fc9db3017e2bf0d0f9bf92c295e6a Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 17 Jul 2022 11:29:50 -0400 Subject: [PATCH 21/43] update Pintail --- docs/release-notes.md | 3 ++- src/SMAPI/SMAPI.csproj | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 40f79d8e..cae29411 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -16,6 +16,7 @@ * While loading your mod, SMAPI now searches for indirect dependencies in your mod's folder to support edge cases like F# mods (thanks to TehPers)! * **Raised deprecation message levels.** _Deprecation warnings are now player-visible in the SMAPI console as grayed-out `DEBUG` messages. They'll be raised to `WARN` level in SMAPI 3.17 next month, which will be the last major release before SMAPI 4.0._ + * Updated to Pintail 2.2.1 (see [changes](https://github.com/Nanoray-pl/Pintail/blob/master/docs/release-notes.md#221)). * For the web UI: * Added log parser warning about performance of PyTK 1.23.0 or earlier. @@ -56,7 +57,7 @@ Released 17 June 2022 for Stardew Valley 1.5.6 or later. See [release highlights * Updated dependencies: * Harmony 2.2.1 (see changes in [2.2.0](https://github.com/pardeike/Harmony/releases/tag/v2.2.0.0) and [2.2.1](https://github.com/pardeike/Harmony/releases/tag/v2.2.1.0)); * Newtonsoft.Json 13.0.1 (see [changes](https://github.com/JamesNK/Newtonsoft.Json/releases/tag/13.0.1)); - * Pintail 2.2.0. + * Pintail 2.2.0 (see [changes](https://github.com/Nanoray-pl/Pintail/blob/master/docs/release-notes.md#220)). * Removed transitional `UsePintail` option added in 3.14.0 (now always enabled). * Fixed `onBehalfOf` arguments in the new content API being case-sensitive. * Fixed map edits which change warps sometimes rebuilding the NPC pathfinding cache unnecessarily, which could cause a noticeable delay for players. diff --git a/src/SMAPI/SMAPI.csproj b/src/SMAPI/SMAPI.csproj index 1c745702..36db0545 100644 --- a/src/SMAPI/SMAPI.csproj +++ b/src/SMAPI/SMAPI.csproj @@ -27,7 +27,7 @@ - + From ea4307a282468c20c27c6b8c2722bd46f6d5c64d Mon Sep 17 00:00:00 2001 From: Ishan Jalan <44338423+ishanjalan@users.noreply.github.com> Date: Wed, 20 Jul 2022 22:30:09 +0530 Subject: [PATCH 22/43] Update unix-launcher.sh This will open the default shell. Works for me after testing. --- src/SMAPI.Installer/assets/unix-launcher.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SMAPI.Installer/assets/unix-launcher.sh b/src/SMAPI.Installer/assets/unix-launcher.sh index ae9624e7..cff21bb0 100644 --- a/src/SMAPI.Installer/assets/unix-launcher.sh +++ b/src/SMAPI.Installer/assets/unix-launcher.sh @@ -58,7 +58,7 @@ if [ "$(uname)" == "Darwin" ]; then echo "\"$0\" $@ --use-current-shell" >> /tmp/open-smapi-terminal.sh chmod +x /tmp/open-smapi-terminal.sh cat /tmp/open-smapi-terminal.sh - open -W -a Terminal /tmp/open-smapi-terminal.sh + open -W /tmp/open-smapi-terminal.sh rm /tmp/open-smapi-terminal.sh exit 0 fi From ea4664856dff10cb3371a859dcf09be2f4608299 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Jul 2022 22:46:05 +0000 Subject: [PATCH 23/43] Bump Azure.Storage.Blobs from 12.12.0 to 12.13.0 in /src/SMAPI.Web Bumps [Azure.Storage.Blobs](https://github.com/Azure/azure-sdk-for-net) from 12.12.0 to 12.13.0. - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](https://github.com/Azure/azure-sdk-for-net/compare/Azure.Storage.Blobs_12.12.0...Azure.Storage.Blobs_12.13.0) --- updated-dependencies: - dependency-name: Azure.Storage.Blobs dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- src/SMAPI.Web/SMAPI.Web.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SMAPI.Web/SMAPI.Web.csproj b/src/SMAPI.Web/SMAPI.Web.csproj index 0a460e9e..d26cb6f8 100644 --- a/src/SMAPI.Web/SMAPI.Web.csproj +++ b/src/SMAPI.Web/SMAPI.Web.csproj @@ -15,7 +15,7 @@ - + From fd3850add9ddeccc4dd3d27493b90a98cca786ed Mon Sep 17 00:00:00 2001 From: KediDili <78353874+KediDili@users.noreply.github.com> Date: Fri, 22 Jul 2022 21:24:15 +0300 Subject: [PATCH 24/43] Fix for mistranslation in tr.json Somebody accidentally translated tr.json to Russian. This PR fixes that. --- src/SMAPI/i18n/tr.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SMAPI/i18n/tr.json b/src/SMAPI/i18n/tr.json index e97a48ba..ba0c33c9 100644 --- a/src/SMAPI/i18n/tr.json +++ b/src/SMAPI/i18n/tr.json @@ -2,5 +2,5 @@ // 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}}" + "generic.date-with-year": "{{day}} {{season}} Yıl {{year}}" } From a50a730886e2649472011e5c0eca5113b3774555 Mon Sep 17 00:00:00 2001 From: Ishan Jalan <44338423+ishanjalan@users.noreply.github.com> Date: Sun, 24 Jul 2022 12:01:34 +0530 Subject: [PATCH 25/43] unix-launcher.sh optimisations I ran the file through Rider which used Intellisense(?) to suggest changes in addition to moving from .sh to .command --- src/SMAPI.Installer/assets/unix-launcher.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/SMAPI.Installer/assets/unix-launcher.sh b/src/SMAPI.Installer/assets/unix-launcher.sh index cff21bb0..b9d468a0 100644 --- a/src/SMAPI.Installer/assets/unix-launcher.sh +++ b/src/SMAPI.Installer/assets/unix-launcher.sh @@ -54,12 +54,12 @@ if [ "$(uname)" == "Darwin" ]; then # https://stackoverflow.com/a/29511052/262123 if [ "$USE_CURRENT_SHELL" == "false" ]; then echo "Reopening in the Terminal app..." - echo '#!/bin/sh' > /tmp/open-smapi-terminal.sh - echo "\"$0\" $@ --use-current-shell" >> /tmp/open-smapi-terminal.sh - chmod +x /tmp/open-smapi-terminal.sh - cat /tmp/open-smapi-terminal.sh - open -W /tmp/open-smapi-terminal.sh - rm /tmp/open-smapi-terminal.sh + echo '#!/bin/sh' > /tmp/open-smapi-terminal.command + echo "\"$0\" $@ --use-current-shell" >> /tmp/open-smapi-terminal.command + chmod +x /tmp/open-smapi-terminal.command + cat /tmp/open-smapi-terminal.command + open -W /tmp/open-smapi-terminal.command + rm /tmp/open-smapi-terminal.command exit 0 fi fi From dd2e3e9d933c69aba2a11815191046903c7fa5ee Mon Sep 17 00:00:00 2001 From: Ishan Jalan <44338423+ishanjalan@users.noreply.github.com> Date: Sun, 24 Jul 2022 12:07:38 +0530 Subject: [PATCH 26/43] Jetbrains Rider suggestions I ran the file on Rider and it had a few suggestions image --- src/SMAPI.Installer/assets/unix-launcher.sh | 24 +++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/SMAPI.Installer/assets/unix-launcher.sh b/src/SMAPI.Installer/assets/unix-launcher.sh index b9d468a0..88a3a328 100644 --- a/src/SMAPI.Installer/assets/unix-launcher.sh +++ b/src/SMAPI.Installer/assets/unix-launcher.sh @@ -55,7 +55,7 @@ if [ "$(uname)" == "Darwin" ]; then if [ "$USE_CURRENT_SHELL" == "false" ]; then echo "Reopening in the Terminal app..." echo '#!/bin/sh' > /tmp/open-smapi-terminal.command - echo "\"$0\" $@ --use-current-shell" >> /tmp/open-smapi-terminal.command + echo "\"$0\" $* --use-current-shell" >> /tmp/open-smapi-terminal.command chmod +x /tmp/open-smapi-terminal.command cat /tmp/open-smapi-terminal.command open -W /tmp/open-smapi-terminal.command @@ -71,8 +71,8 @@ fi ########## # script must be run from the game folder if [ ! -f "Stardew Valley.dll" ]; then - echo "Oops! SMAPI must be placed in the Stardew Valley game folder.\nSee instructions: https://stardewvalleywiki.com/Modding:Player_Guide"; - read + printf "Oops! SMAPI must be placed in the Stardew Valley game folder.\nSee instructions: https://stardewvalleywiki.com/Modding:Player_Guide"; + read -r exit 1 fi @@ -102,37 +102,39 @@ else # find the true shell behind x-terminal-emulator if [ "$TERMINAL_NAME" = "x-terminal-emulator" ]; then - export TERMINAL_NAME="$(basename "$(readlink -f $(command -v x-terminal-emulator))")" + TERMINAL_NAME="$(basename "$(readlink -f "$(command -v x-terminal-emulator)")")" + export TERMINAL_NAME fi # run in selected terminal and account for quirks - export TERMINAL_PATH="$(command -v $TERMINAL_NAME)" - if [ -x $TERMINAL_PATH ]; then + TERMINAL_PATH="$(command -v "$TERMINAL_NAME")" + export TERMINAL_PATH + if [ -x "$TERMINAL_PATH" ]; then case $TERMINAL_NAME in terminal|termite) # consumes only one argument after -e # options containing space characters are unsupported - exec $TERMINAL_NAME -e "env TERM=xterm $LAUNCH_FILE $@" + exec "$TERMINAL_NAME" -e "env TERM=xterm $LAUNCH_FILE $*" ;; xterm|konsole|alacritty) # consumes all arguments after -e - exec $TERMINAL_NAME -e env TERM=xterm $LAUNCH_FILE "$@" + exec "$TERMINAL_NAME" -e env TERM=xterm $LAUNCH_FILE "$*" ;; terminator|xfce4-terminal|mate-terminal) # consumes all arguments after -x - exec $TERMINAL_NAME -x env TERM=xterm $LAUNCH_FILE "$@" + exec "$TERMINAL_NAME" -x env TERM=xterm $LAUNCH_FILE "$*" ;; gnome-terminal) # consumes all arguments after -- - exec $TERMINAL_NAME -- env TERM=xterm $LAUNCH_FILE "$@" + exec "$TERMINAL_NAME" -- env TERM=xterm $LAUNCH_FILE "$*" ;; kitty) # consumes all trailing arguments - exec $TERMINAL_NAME env TERM=xterm $LAUNCH_FILE "$@" + exec "$TERMINAL_NAME" env TERM=xterm $LAUNCH_FILE "$*" ;; *) From edf2c5dbea777460ef0eb9d5829089ee18cc17b0 Mon Sep 17 00:00:00 2001 From: lanturnalis <96697794+lanturnalis@users.noreply.github.com> Date: Mon, 25 Jul 2022 21:31:09 -0500 Subject: [PATCH 27/43] Add condition to DebugType to allow for overriding --- src/SMAPI.ModBuildConfig/build/smapi.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SMAPI.ModBuildConfig/build/smapi.targets b/src/SMAPI.ModBuildConfig/build/smapi.targets index b66ec27b..70182125 100644 --- a/src/SMAPI.ModBuildConfig/build/smapi.targets +++ b/src/SMAPI.ModBuildConfig/build/smapi.targets @@ -9,7 +9,7 @@ **********************************************--> - pdbonly + pdbonly true From ab34b6142dcd04e629012a1c30d37bc9c7e5df5e Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 28 Jul 2022 21:47:21 -0400 Subject: [PATCH 28/43] undo $@ to $* change per discussion --- src/SMAPI.Installer/assets/unix-launcher.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/SMAPI.Installer/assets/unix-launcher.sh b/src/SMAPI.Installer/assets/unix-launcher.sh index 88a3a328..778663d7 100644 --- a/src/SMAPI.Installer/assets/unix-launcher.sh +++ b/src/SMAPI.Installer/assets/unix-launcher.sh @@ -55,7 +55,7 @@ if [ "$(uname)" == "Darwin" ]; then if [ "$USE_CURRENT_SHELL" == "false" ]; then echo "Reopening in the Terminal app..." echo '#!/bin/sh' > /tmp/open-smapi-terminal.command - echo "\"$0\" $* --use-current-shell" >> /tmp/open-smapi-terminal.command + echo "\"$0\" $@ --use-current-shell" >> /tmp/open-smapi-terminal.command chmod +x /tmp/open-smapi-terminal.command cat /tmp/open-smapi-terminal.command open -W /tmp/open-smapi-terminal.command @@ -114,27 +114,27 @@ else terminal|termite) # consumes only one argument after -e # options containing space characters are unsupported - exec "$TERMINAL_NAME" -e "env TERM=xterm $LAUNCH_FILE $*" + exec "$TERMINAL_NAME" -e "env TERM=xterm $LAUNCH_FILE $@" ;; xterm|konsole|alacritty) # consumes all arguments after -e - exec "$TERMINAL_NAME" -e env TERM=xterm $LAUNCH_FILE "$*" + exec "$TERMINAL_NAME" -e env TERM=xterm $LAUNCH_FILE "$@" ;; terminator|xfce4-terminal|mate-terminal) # consumes all arguments after -x - exec "$TERMINAL_NAME" -x env TERM=xterm $LAUNCH_FILE "$*" + exec "$TERMINAL_NAME" -x env TERM=xterm $LAUNCH_FILE "$@" ;; gnome-terminal) # consumes all arguments after -- - exec "$TERMINAL_NAME" -- env TERM=xterm $LAUNCH_FILE "$*" + exec "$TERMINAL_NAME" -- env TERM=xterm $LAUNCH_FILE "$@" ;; kitty) # consumes all trailing arguments - exec "$TERMINAL_NAME" env TERM=xterm $LAUNCH_FILE "$*" + exec "$TERMINAL_NAME" env TERM=xterm $LAUNCH_FILE "$@" ;; *) From 7a3b0e180f62e2e3094510e7e12eb64af6089560 Mon Sep 17 00:00:00 2001 From: atravita-mods <94934860+atravita-mods@users.noreply.github.com> Date: Fri, 5 Aug 2022 17:21:53 -0400 Subject: [PATCH 29/43] Adds an error message for an invaild png --- src/SMAPI/Framework/ContentManagers/ModContentManager.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs index f3cf05d9..c825b38c 100644 --- a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs +++ b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs @@ -254,6 +254,8 @@ namespace StardewModdingAPI.Framework.ContentManagers { using FileStream stream = File.OpenRead(file.FullName); using SKBitmap bitmap = SKBitmap.Decode(stream); + if (bitmap is null) + throw new InvalidDataException("{file.FullName} appears not to be a valid image file."); rawPixels = SKPMColor.PreMultiply(bitmap.Pixels); width = bitmap.Width; height = bitmap.Height; From 8c58bdae6f10dfb55d44f900480059f495d5f37e Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 8 Aug 2022 19:32:58 -0400 Subject: [PATCH 30/43] remove DebugType build property The 'portable' format is preferred in newer .NET versions, but it's set by default now so we don't need to override it anymore. --- src/SMAPI.ModBuildConfig/build/smapi.targets | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/SMAPI.ModBuildConfig/build/smapi.targets b/src/SMAPI.ModBuildConfig/build/smapi.targets index 70182125..12619439 100644 --- a/src/SMAPI.ModBuildConfig/build/smapi.targets +++ b/src/SMAPI.ModBuildConfig/build/smapi.targets @@ -8,8 +8,7 @@ ** Set build options **********************************************--> - - pdbonly + true From 08eafe7d898780e22d01b69e820aaa665f3a2d56 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 8 Aug 2022 19:42:40 -0400 Subject: [PATCH 31/43] tweak new error text --- src/SMAPI/Framework/ContentManagers/ModContentManager.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs index c825b38c..8ecbc4cc 100644 --- a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs +++ b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs @@ -254,8 +254,10 @@ namespace StardewModdingAPI.Framework.ContentManagers { using FileStream stream = File.OpenRead(file.FullName); using SKBitmap bitmap = SKBitmap.Decode(stream); + if (bitmap is null) - throw new InvalidDataException("{file.FullName} appears not to be a valid image file."); + throw new InvalidDataException($"Failed to load {file.FullName}. This doesn't seem to be a valid PNG image."); + rawPixels = SKPMColor.PreMultiply(bitmap.Pixels); width = bitmap.Width; height = bitmap.Height; From 1749a82947c84fec253f7ca6016e8428cdcd87b1 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 8 Aug 2022 19:50:29 -0400 Subject: [PATCH 32/43] update release notes --- docs/release-notes.md | 6 +++++- docs/technical/mod-package.md | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index cae29411..3591c375 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -9,8 +9,12 @@ ## Upcoming release * For players: - * Fixed SMAPI applying different DPI awareness settings than the game (thanks to spacechase0!). + * Fixed SMAPI on Windows applying different DPI awareness settings than the game (thanks to spacechase0!). * Fixed Linux/macOS installer's color scheme question partly unreadable if the terminal background is dark. + * Fixed error message when a mod loads an invalid PNG file (thanks to atravita!). + * Fixed macOS launcher using Terminal regardless of the system's default terminal (thanks to ishan!). + * Fixed best practices in Linux/macOS launcher scripts (thanks to ishan!). + * Improved translations. Thanks to KediDili (updated Turkish)! * For mod authors: * While loading your mod, SMAPI now searches for indirect dependencies in your mod's folder to support edge cases like F# mods (thanks to TehPers)! diff --git a/docs/technical/mod-package.md b/docs/technical/mod-package.md index dd65a992..ca78be55 100644 --- a/docs/technical/mod-package.md +++ b/docs/technical/mod-package.md @@ -412,6 +412,9 @@ The NuGet package is generated automatically in `StardewModdingAPI.ModBuildConfi when you compile it. ## Release notes +### Upcoming release +* Switched to the newer crossplatform `portable` debug symbols (thanks to lanturnalis!). + ### 4.0.1 Released 14 April 2022. From 352fa4759e0b52ad25bd5d210639f57eabad6c89 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 8 Aug 2022 19:54:07 -0400 Subject: [PATCH 33/43] fix error when a mod is both duplicated and missing the DLL --- docs/release-notes.md | 1 + src/SMAPI/Framework/ModLoading/ModResolver.cs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 3591c375..080a4f20 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -12,6 +12,7 @@ * Fixed SMAPI on Windows applying different DPI awareness settings than the game (thanks to spacechase0!). * Fixed Linux/macOS installer's color scheme question partly unreadable if the terminal background is dark. * Fixed error message when a mod loads an invalid PNG file (thanks to atravita!). + * Fixed error message when a mod is duplicated, but one of the copies is also missing the DLL file. This now shows the duplicate-mod message instead of the missing-DLL message. * Fixed macOS launcher using Terminal regardless of the system's default terminal (thanks to ishan!). * Fixed best practices in Linux/macOS launcher scripts (thanks to ishan!). * Improved translations. Thanks to KediDili (updated Turkish)! diff --git a/src/SMAPI/Framework/ModLoading/ModResolver.cs b/src/SMAPI/Framework/ModLoading/ModResolver.cs index abc46d47..a487ba28 100644 --- a/src/SMAPI/Framework/ModLoading/ModResolver.cs +++ b/src/SMAPI/Framework/ModLoading/ModResolver.cs @@ -47,7 +47,7 @@ namespace StardewModdingAPI.Framework.ModLoading IModMetadata metadata = new ModMetadata(folder.DisplayName, folder.Directory.FullName, rootPath, manifest, dataRecord, isIgnored: shouldIgnore); if (shouldIgnore) metadata.SetStatus(status, ModFailReason.DisabledByDotConvention, "disabled by dot convention"); - else + else if (metadata.Status == ModMetadataStatus.Failed) metadata.SetStatus(status, ModFailReason.InvalidManifest, folder.ManifestParseErrorText); yield return metadata; @@ -223,8 +223,8 @@ namespace StardewModdingAPI.Framework.ModLoading { foreach (IModMetadata mod in group) { - if (mod.Status == ModMetadataStatus.Failed) - continue; // don't replace metadata error + if (mod.Status == ModMetadataStatus.Failed && mod.FailReason != ModFailReason.InvalidManifest) + continue; string folderList = string.Join(", ", group.Select(p => p.GetRelativePathWithRoot()).OrderBy(p => p)); mod.SetStatus(ModMetadataStatus.Failed, ModFailReason.Duplicate, $"you have multiple copies of this mod installed. To fix this, delete these folders and reinstall the mod: {folderList}."); From e376386d250780c50f17c40f82419128b4e7beab Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 8 Aug 2022 21:43:46 -0400 Subject: [PATCH 34/43] set error code on exit (#868) --- docs/release-notes.md | 2 ++ src/SMAPI/Framework/ExitState.cs | 15 +++++++++ src/SMAPI/Framework/SCore.cs | 54 +++++++++++++++++++++----------- 3 files changed, 53 insertions(+), 18 deletions(-) create mode 100644 src/SMAPI/Framework/ExitState.cs diff --git a/docs/release-notes.md b/docs/release-notes.md index 080a4f20..14421c1a 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -9,6 +9,8 @@ ## Upcoming release * For players: + * SMAPI now sets a success/error code when the game exits. + _This is used by your OS (like Windows) to decide whether to keep the console window open when the game ends._ * Fixed SMAPI on Windows applying different DPI awareness settings than the game (thanks to spacechase0!). * Fixed Linux/macOS installer's color scheme question partly unreadable if the terminal background is dark. * Fixed error message when a mod loads an invalid PNG file (thanks to atravita!). diff --git a/src/SMAPI/Framework/ExitState.cs b/src/SMAPI/Framework/ExitState.cs new file mode 100644 index 00000000..bc022d91 --- /dev/null +++ b/src/SMAPI/Framework/ExitState.cs @@ -0,0 +1,15 @@ +namespace StardewModdingAPI.Framework +{ + /// The SMAPI exit state. + internal enum ExitState + { + /// SMAPI didn't trigger an explicit exit. + None, + + /// The game is exiting normally. + GameExit, + + /// The game is exiting due to an error. + Crash + } +} diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 1a1bb9f8..cbb559c1 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; @@ -50,6 +49,7 @@ using StardewModdingAPI.Utilities; using StardewValley; using StardewValley.Menus; using StardewValley.Objects; +using StardewValley.SDKs; using xTile.Display; using LanguageCode = StardewValley.LocalizedContentManager.LanguageCode; using MiniMonoModHotfix = MonoMod.Utils.MiniMonoModHotfix; @@ -67,8 +67,11 @@ namespace StardewModdingAPI.Framework /**** ** Low-level components ****/ + /// A state which indicates whether SMAPI should exit immediately and any pending initialization should be cancelled. + private ExitState ExitState; + /// Whether the game should exit immediately and any pending initialization should be cancelled. - private bool IsExiting; + private bool IsExiting => this.ExitState != ExitState.None; /// Manages the SMAPI console window and log file. private readonly LogManager LogManager; @@ -297,22 +300,13 @@ namespace StardewModdingAPI.Framework this.IsGameRunning = true; StardewValley.Program.releaseBuild = true; // game's debug logic interferes with SMAPI opening the game window this.Game.Run(); + this.Dispose(isError: false); } catch (Exception ex) { this.LogManager.LogFatalLaunchError(ex); this.LogManager.PressAnyKeyToExit(); - } - finally - { - try - { - this.Dispose(); - } - catch (Exception ex) - { - this.Monitor.Log($"The game ended, but SMAPI wasn't able to dispose correctly. Technical details: {ex}", LogLevel.Error); - } + this.Dispose(isError: true); } } @@ -327,6 +321,14 @@ namespace StardewModdingAPI.Framework /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. [SuppressMessage("ReSharper", "ConditionalAccessQualifierIsNonNullableAccordingToAPIContract", Justification = "May be disposed before SMAPI is fully initialized.")] public void Dispose() + { + this.Dispose(isError: true); // if we got here, SMAPI didn't detect the exit before it happened + } + + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// Whether the process is exiting due to an error or crash. + [SuppressMessage("ReSharper", "ConditionalAccessQualifierIsNonNullableAccordingToAPIContract", Justification = "May be disposed before SMAPI is fully initialized.")] + public void Dispose(bool isError) { // skip if already disposed if (this.IsDisposed) @@ -349,13 +351,29 @@ namespace StardewModdingAPI.Framework // dispose core components this.IsGameRunning = false; - this.IsExiting = true; + if (this.ExitState == ExitState.None || isError) + this.ExitState = isError ? ExitState.Crash : ExitState.GameExit; this.ContentCore?.Dispose(); this.Game?.Dispose(); this.LogManager.Dispose(); // dispose last to allow for any last-second log messages - // end game (moved from Game1.OnExiting to let us clean up first) - Process.GetCurrentProcess().Kill(); + // clean up SDK + // This avoids Steam connection errors when it exits unexpectedly. The game avoids this + // by killing the entire process, but we can't set the error code if we do that. + try + { + FieldInfo? field = typeof(StardewValley.Program).GetField("_sdk", BindingFlags.NonPublic | BindingFlags.Static); + SDKHelper? sdk = field?.GetValue(null) as SDKHelper; + sdk?.Shutdown(); + } + catch + { + // well, at least we tried + } + + // end game with error code + // This helps the OS decide whether to keep the window open (e.g. Windows may keep it open on error). + Environment.Exit(this.ExitState == ExitState.Crash ? 1 : 0); } @@ -1250,7 +1268,7 @@ namespace StardewModdingAPI.Framework private void OnGameExiting() { this.Multiplayer.Disconnect(StardewValley.Multiplayer.DisconnectType.ClosedGame); - this.Dispose(); + this.Dispose(isError: false); } /// Raised when a mod network message is received. @@ -2239,7 +2257,7 @@ namespace StardewModdingAPI.Framework this.Monitor.LogFatal(message); this.LogManager.WriteCrashLog(); - this.IsExiting = true; + this.ExitState = ExitState.Crash; this.Game.Exit(); } From d813c4e2c8522584beaf1432725b4cdd2cc251b5 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 8 Aug 2022 22:27:07 -0400 Subject: [PATCH 35/43] fix log parsing for invalid content packs (#860) --- docs/release-notes.md | 1 + .../Framework/LogParsing/LogParser.cs | 10 +++---- .../Framework/LogParsing/Models/LogModInfo.cs | 22 +++++++-------- .../Framework/LogParsing/Models/ModType.cs | 15 +++++++++++ src/SMAPI.Web/ViewModels/LogParserModel.cs | 2 +- src/SMAPI.Web/Views/LogParser/Index.cshtml | 27 ++++++++++++++----- 6 files changed, 52 insertions(+), 25 deletions(-) create mode 100644 src/SMAPI.Web/Framework/LogParsing/Models/ModType.cs diff --git a/docs/release-notes.md b/docs/release-notes.md index 14421c1a..46d910a9 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -29,6 +29,7 @@ * Added log parser warning about performance of PyTK 1.23.0 or earlier. * Converted images to SVG (thanks to ishan!). * Updated log parser for new update alert format in SMAPI 3.15.1. + * Fixed parsing for invalid content packs. ## 3.15.1 Released 06 July 2022 for Stardew Valley 1.5.6 or later. diff --git a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs index 4a110dcd..18ba754c 100644 --- a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs +++ b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs @@ -36,7 +36,7 @@ namespace StardewModdingAPI.Web.Framework.LogParsing private readonly Regex ContentPackListStartPattern = new(@"^Loaded \d+ content packs:$", RegexOptions.Compiled | RegexOptions.IgnoreCase); /// A regex pattern matching an entry in SMAPI's content pack list. - private readonly Regex ContentPackListEntryPattern = new(@"^ (?.+?) (?[^\s]+)(?: by (?[^\|]+))? \| for (?[^\|]+)(?: \| (?.+))?$", RegexOptions.Compiled | RegexOptions.IgnoreCase); + private readonly Regex ContentPackListEntryPattern = new(@"^ (?.+?) (?[^\s]+)(?: by (?[^\|]+))? \| for (?[^\|]*)(?: \| (?.+))?$", RegexOptions.Compiled | RegexOptions.IgnoreCase); /// A regex pattern matching the start of SMAPI's mod update list. private readonly Regex ModUpdateListStartPattern = new(@"^You can update \d+ mods?:$", RegexOptions.Compiled | RegexOptions.IgnoreCase); @@ -77,8 +77,8 @@ namespace StardewModdingAPI.Web.Framework.LogParsing }; // parse log messages - LogModInfo smapiMod = new(name: "SMAPI", author: "Pathoschild", version: "", description: "", loaded: true, isMod: false); - LogModInfo gameMod = new(name: "game", author: "", version: "", description: "", loaded: true, isMod: false); + LogModInfo smapiMod = new(ModType.Special, name: "SMAPI", author: "Pathoschild", version: "", description: "", loaded: true); + LogModInfo gameMod = new(ModType.Special, name: "game", author: "", version: "", description: "", loaded: true); IDictionary> mods = new Dictionary>(); bool inModList = false; bool inContentPackList = false; @@ -133,7 +133,7 @@ namespace StardewModdingAPI.Web.Framework.LogParsing if (!mods.TryGetValue(name, out List? entries)) mods[name] = entries = new List(); - entries.Add(new LogModInfo(name: name, author: author, version: version, description: description, loaded: true)); + entries.Add(new LogModInfo(ModType.CodeMod, name: name, author: author, version: version, description: description, loaded: true)); message.Section = LogSection.ModsList; } @@ -156,7 +156,7 @@ namespace StardewModdingAPI.Web.Framework.LogParsing if (!mods.TryGetValue(name, out List? entries)) mods[name] = entries = new List(); - entries.Add(new LogModInfo(name: name, author: author, version: version, description: description, contentPackFor: forMod, loaded: true)); + entries.Add(new LogModInfo(ModType.ContentPack, name: name, author: author, version: version, description: description, contentPackFor: forMod, loaded: true)); message.Section = LogSection.ContentPackList; } diff --git a/src/SMAPI.Web/Framework/LogParsing/Models/LogModInfo.cs b/src/SMAPI.Web/Framework/LogParsing/Models/LogModInfo.cs index 557f08ff..c81942e4 100644 --- a/src/SMAPI.Web/Framework/LogParsing/Models/LogModInfo.cs +++ b/src/SMAPI.Web/Framework/LogParsing/Models/LogModInfo.cs @@ -48,21 +48,24 @@ namespace StardewModdingAPI.Web.Framework.LogParsing.Models [MemberNotNullWhen(true, nameof(LogModInfo.UpdateVersion), nameof(LogModInfo.UpdateLink))] public bool HasUpdate => this.UpdateVersion != null && this.Version != this.UpdateVersion; + /// The mod type. + public ModType ModType { get; } + /// Whether this is an actual mod (rather than a special entry for SMAPI or the game itself). - public bool IsMod { get; } + public bool IsMod => this.ModType != ModType.Special; /// Whether this is a C# code mod. - public bool IsCodeMod { get; } + public bool IsCodeMod => this.ModType == ModType.CodeMod; /// Whether this is a content pack for another mod. - [MemberNotNullWhen(true, nameof(LogModInfo.ContentPackFor))] - public bool IsContentPack { get; } + public bool IsContentPack => this.ModType == ModType.ContentPack; /********* ** Public methods *********/ /// Construct an instance. + /// The mod type. /// The mod name. /// The mod author. /// The mod version. @@ -72,9 +75,9 @@ namespace StardewModdingAPI.Web.Framework.LogParsing.Models /// The name of the mod for which this is a content pack (if applicable). /// The number of errors logged by this mod. /// Whether the mod was loaded into the game. - /// Whether this is an actual mod (instead of a special entry for SMAPI or the game). - public LogModInfo(string name, string author, string version, string description, string? updateVersion = null, string? updateLink = null, string? contentPackFor = null, int errors = 0, bool loaded = true, bool isMod = true) + public LogModInfo(ModType modType, string name, string author, string version, string description, string? updateVersion = null, string? updateLink = null, string? contentPackFor = null, int errors = 0, bool loaded = true) { + this.ModType = modType; this.Name = name; this.Author = author; this.Description = description; @@ -84,13 +87,6 @@ namespace StardewModdingAPI.Web.Framework.LogParsing.Models this.Errors = errors; this.Loaded = loaded; - if (isMod) - { - this.IsMod = true; - this.IsContentPack = !string.IsNullOrWhiteSpace(this.ContentPackFor); - this.IsCodeMod = !this.IsContentPack; - } - this.OverrideVersion(version); } diff --git a/src/SMAPI.Web/Framework/LogParsing/Models/ModType.cs b/src/SMAPI.Web/Framework/LogParsing/Models/ModType.cs new file mode 100644 index 00000000..363aaaec --- /dev/null +++ b/src/SMAPI.Web/Framework/LogParsing/Models/ModType.cs @@ -0,0 +1,15 @@ +namespace StardewModdingAPI.Web.Framework.LogParsing.Models +{ + /// The type for a instance. + public enum ModType + { + /// A special non-mod entry (e.g. for SMAPI or the game itself). + Special, + + /// A C# mod. + CodeMod, + + /// A content pack loaded by a C# mod. + ContentPack + } +} diff --git a/src/SMAPI.Web/ViewModels/LogParserModel.cs b/src/SMAPI.Web/ViewModels/LogParserModel.cs index c39a9b0a..34d0b4df 100644 --- a/src/SMAPI.Web/ViewModels/LogParserModel.cs +++ b/src/SMAPI.Web/ViewModels/LogParserModel.cs @@ -107,7 +107,7 @@ namespace StardewModdingAPI.Web.ViewModels // group by mod return mods .Where(mod => mod.IsContentPack) - .GroupBy(mod => mod.ContentPackFor!) + .GroupBy(mod => mod.ContentPackFor ?? "") .ToDictionary(group => group.Key, group => group.ToArray()); } diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index 57e26ace..f71c6ac1 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -352,16 +352,31 @@ else if (log?.IsValid == true) toggle content packs in list } - @foreach (var mod in log.Mods.Where(p => p.Loaded && !p.IsContentPack)) - { - if (contentPacks == null || !contentPacks.TryGetValue(mod.Name, out LogModInfo[]? contentPackList)) - contentPackList = null; + @{ + var modsWithContentPacks = log.Mods + .Where(mod => mod.Loaded && !mod.IsContentPack) + .Select(mod => ( + Mod: mod, + ContentPacks: contentPacks?.TryGetValue(mod.Name, out LogModInfo[]? contentPackList) == true ? contentPackList : Array.Empty() + )) + .ToList(); + if (contentPacks?.TryGetValue("", out LogModInfo[] invalidPacks) == true) + { + modsWithContentPacks.Add(( + Mod: new LogModInfo(ModType.CodeMod, "", "", "", ""), + ContentPacks: invalidPacks + )); + } + } + + @foreach ((LogModInfo mod, LogModInfo[] contentPackList) in modsWithContentPacks) + { @mod.Name @mod.Version - @if (contentPackList != null) + @if (contentPackList.Any()) {
    @foreach (var contentPack in contentPackList) @@ -374,7 +389,7 @@ else if (log?.IsValid == true) @mod.Author - @if (contentPackList != null) + @if (contentPackList.Any()) {
    @foreach (var contentPack in contentPackList) From 4d9384b8288fa5dcd36a9c8cbd66574a2896605f Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 14 Aug 2022 19:17:21 -0400 Subject: [PATCH 36/43] switch SMAPI to portable PDB format --- build/common.targets | 1 - docs/release-notes.md | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/build/common.targets b/build/common.targets index 230bef41..026b56df 100644 --- a/build/common.targets +++ b/build/common.targets @@ -12,7 +12,6 @@ repo. It imports the other MSBuild files as needed. latest $(AssemblySearchPaths);{GAC} $(DefineConstants);SMAPI_DEPRECATED - pdbonly true diff --git a/docs/release-notes.md b/docs/release-notes.md index 46d910a9..7526e655 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -24,6 +24,7 @@ * **Raised deprecation message levels.** _Deprecation warnings are now player-visible in the SMAPI console as grayed-out `DEBUG` messages. They'll be raised to `WARN` level in SMAPI 3.17 next month, which will be the last major release before SMAPI 4.0._ * Updated to Pintail 2.2.1 (see [changes](https://github.com/Nanoray-pl/Pintail/blob/master/docs/release-notes.md#221)). + * Switched SMAPI's `.pdb` file to the newer 'portable' format. This has no effect on mods. * For the web UI: * Added log parser warning about performance of PyTK 1.23.0 or earlier. From 5ab87efaa07a0972fd59c88c8aab456a6133329d Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 16 Aug 2022 22:03:21 -0400 Subject: [PATCH 37/43] log error if mod files are detected directly under Mods folder --- docs/release-notes.md | 1 + src/SMAPI/Framework/SCore.cs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/docs/release-notes.md b/docs/release-notes.md index 7526e655..1734ca2d 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -9,6 +9,7 @@ ## Upcoming release * For players: + * Added error message if mod files are detected directly under `Mods` (instead of each mod having its own subfolder). * SMAPI now sets a success/error code when the game exits. _This is used by your OS (like Windows) to decide whether to keep the console window open when the game ends._ * Fixed SMAPI on Windows applying different DPI awareness settings than the game (thanks to spacechase0!). diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index cbb559c1..0f86ed6b 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -405,7 +405,14 @@ namespace StardewModdingAPI.Framework { string[] looseFiles = new DirectoryInfo(this.ModsPath).GetFiles().Select(p => p.Name).ToArray(); if (looseFiles.Any()) + { + if (looseFiles.Any(name => name.Equals("manifest.json", StringComparison.OrdinalIgnoreCase) || name.EndsWith(".dll", StringComparison.OrdinalIgnoreCase))) + { + this.Monitor.Log($"Detected mod files directly inside the '{Path.GetFileName(this.ModsPath)}' folder. These will be ignored. Each mod must have its own subfolder instead.", LogLevel.Error); + } + this.Monitor.Log($" Ignored loose files: {string.Join(", ", looseFiles.OrderBy(p => p, StringComparer.OrdinalIgnoreCase))}"); + } } // load manifests From f23cd450a0cca3ede1dacb198b4dd6432a44bf16 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 16 Aug 2022 22:03:22 -0400 Subject: [PATCH 38/43] clarify docs --- docs/technical/smapi.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/technical/smapi.md b/docs/technical/smapi.md index 90990ee4..b8a1683b 100644 --- a/docs/technical/smapi.md +++ b/docs/technical/smapi.md @@ -33,14 +33,15 @@ argument | purpose `--uninstall` | Preselects the uninstall action, skipping the prompt asking what the user wants to do. `--game-path "path"` | Specifies the full path to the folder containing the Stardew Valley executable, skipping automatic detection and any prompt to choose a path. If the path is not valid, the installer displays an error. -SMAPI itself recognises five arguments **on Windows only**, but these are intended for internal use -or testing and may change without warning. On Linux/macOS, see _environment variables_ below. +SMAPI itself recognises five arguments, but these are meant for internal use or testing, and might +change without warning. **On Linux/macOS**, command-line arguments won't work; see _environment +variables_ below instead. argument | purpose -------- | ------- `--developer-mode`
    `--developer-mode-off` | Enable or disable features intended for mod developers. Currently this only makes `TRACE`-level messages appear in the console. -`--no-terminal` | The SMAPI launcher won't try to open a terminal window, and SMAPI won't log anything to the console. (Messages will still be written to the log file.) -`--use-current-shell` | The SMAPI launcher won't try to open a terminal window, but SMAPI will still log to the console. (Messages will still be written to the log file.) +`--no-terminal` | SMAPI won't log anything to the console. On Linux/macOS only, this will also prevent the launch script from trying to open a terminal window. (Messages will still be written to the log file.) +`--use-current-shell` | On Linux/macOS only, the launch script won't try to open a terminal window. All console output will be sent to the shell running the launch script. `--mods-path` | The path to search for mods, if not the standard `Mods` folder. This can be a path relative to the game folder (like `--mods-path "Mods (test)"`) or an absolute path. ### Environment variables From c51a593e93ba4d7e41971ed64cfa413449d501e3 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 16 Aug 2022 22:03:22 -0400 Subject: [PATCH 39/43] fix log parser error if a mod logged a null character --- docs/release-notes.md | 3 ++- src/SMAPI.Web/Controllers/LogParserController.cs | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 1734ca2d..5626dcc8 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -31,7 +31,8 @@ * Added log parser warning about performance of PyTK 1.23.0 or earlier. * Converted images to SVG (thanks to ishan!). * Updated log parser for new update alert format in SMAPI 3.15.1. - * Fixed parsing for invalid content packs. + * Fixed log parsing for invalid content packs. + * Fixed log parsing if a mod logged a null character. ## 3.15.1 Released 06 July 2022 for Stardew Valley 1.5.6 or later. diff --git a/src/SMAPI.Web/Controllers/LogParserController.cs b/src/SMAPI.Web/Controllers/LogParserController.cs index 33af5a81..a3bcf4c3 100644 --- a/src/SMAPI.Web/Controllers/LogParserController.cs +++ b/src/SMAPI.Web/Controllers/LogParserController.cs @@ -1,7 +1,9 @@ using System; -using System.Linq; +using System.Collections.Specialized; +using System.IO; using System.Text; using System.Threading.Tasks; +using System.Web; using Microsoft.AspNetCore.Mvc; using StardewModdingAPI.Toolkit.Utilities; using StardewModdingAPI.Web.Framework; @@ -87,9 +89,15 @@ namespace StardewModdingAPI.Web.Controllers public async Task PostAsync() { // get raw log text - string? input = this.Request.Form["input"].FirstOrDefault(); - if (string.IsNullOrWhiteSpace(input)) - return this.View("Index", this.GetModel(null, uploadError: "The log file seems to be empty.")); + // note: avoid this.Request.Form, which fails if any mod logged a null character. + string? input; + { + using StreamReader reader = new StreamReader(this.Request.Body); + NameValueCollection parsed = HttpUtility.ParseQueryString(await reader.ReadToEndAsync()); + input = parsed["input"]; + if (string.IsNullOrWhiteSpace(input)) + return this.View("Index", this.GetModel(null, uploadError: "The log file seems to be empty.")); + } // upload log UploadResult uploadResult = await this.Storage.SaveAsync(input); From b2103bbfa6691cd6726d626fbf8c0567b8092746 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 18 Aug 2022 22:39:37 -0400 Subject: [PATCH 40/43] update schema for Content Patcher 1.28.0 --- docs/release-notes.md | 1 + src/SMAPI.Web/wwwroot/schemas/content-patcher.json | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 5626dcc8..87693512 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -31,6 +31,7 @@ * Added log parser warning about performance of PyTK 1.23.0 or earlier. * Converted images to SVG (thanks to ishan!). * Updated log parser for new update alert format in SMAPI 3.15.1. + * Updated the JSON validator/schema for Content Patcher 1.28.0. * Fixed log parsing for invalid content packs. * Fixed log parsing if a mod logged a null character. diff --git a/src/SMAPI.Web/wwwroot/schemas/content-patcher.json b/src/SMAPI.Web/wwwroot/schemas/content-patcher.json index 631fbc63..a00403c0 100644 --- a/src/SMAPI.Web/wwwroot/schemas/content-patcher.json +++ b/src/SMAPI.Web/wwwroot/schemas/content-patcher.json @@ -14,9 +14,9 @@ "title": "Format version", "description": "The format version. You should always use the latest version to enable the latest features, avoid obsolete behavior, and reduce load times.", "type": "string", - "pattern": "^1\\.27\\.[0-9]+$", + "pattern": "^1\\.28\\.[0-9]+$", "@errorMessages": { - "pattern": "Incorrect value '@value'. You should always use the latest format version (currently 1.27.0) to enable the latest features, avoid obsolete behavior, and reduce load times." + "pattern": "Incorrect value '@value'. You should always use the latest format version (currently 1.28.0) to enable the latest features, avoid obsolete behavior, and reduce load times." } }, "ConfigSchema": { From 263130bafcf10e5ce2527eb8643b00052a41f9b5 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 20 Aug 2022 16:15:29 -0400 Subject: [PATCH 41/43] fix deprecation notices split into two messages unnecessarily --- src/SMAPI/Framework/Deprecations/DeprecationManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SMAPI/Framework/Deprecations/DeprecationManager.cs b/src/SMAPI/Framework/Deprecations/DeprecationManager.cs index 4597a764..f58f085e 100644 --- a/src/SMAPI/Framework/Deprecations/DeprecationManager.cs +++ b/src/SMAPI/Framework/Deprecations/DeprecationManager.cs @@ -124,7 +124,7 @@ namespace StardewModdingAPI.Framework.Deprecations } // log message - if (level == LogLevel.Trace) + if (level is LogLevel.Trace or LogLevel.Debug) { if (warning.LogStackTrace) message += $"\n{this.GetSimplifiedStackTrace(warning.StackTrace, warning.Mod)}"; From f780d140f0c87de9f10d6f55d501c958316548d0 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 20 Aug 2022 16:36:15 -0400 Subject: [PATCH 42/43] fix early mod load errors incorrectly suppressed --- src/SMAPI/Framework/ModLoading/ModResolver.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SMAPI/Framework/ModLoading/ModResolver.cs b/src/SMAPI/Framework/ModLoading/ModResolver.cs index a487ba28..c5648c74 100644 --- a/src/SMAPI/Framework/ModLoading/ModResolver.cs +++ b/src/SMAPI/Framework/ModLoading/ModResolver.cs @@ -47,7 +47,7 @@ namespace StardewModdingAPI.Framework.ModLoading IModMetadata metadata = new ModMetadata(folder.DisplayName, folder.Directory.FullName, rootPath, manifest, dataRecord, isIgnored: shouldIgnore); if (shouldIgnore) metadata.SetStatus(status, ModFailReason.DisabledByDotConvention, "disabled by dot convention"); - else if (metadata.Status == ModMetadataStatus.Failed) + else if (status == ModMetadataStatus.Failed) metadata.SetStatus(status, ModFailReason.InvalidManifest, folder.ManifestParseErrorText); yield return metadata; From f3a79219e85c9af18f2f6d8b2aaa794afa08578d Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 20 Aug 2022 17:01:07 -0400 Subject: [PATCH 43/43] prepare for release --- build/common.targets | 2 +- docs/release-notes.md | 14 ++++++++------ 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, 16 insertions(+), 14 deletions(-) diff --git a/build/common.targets b/build/common.targets index 026b56df..383e258b 100644 --- a/build/common.targets +++ b/build/common.targets @@ -7,7 +7,7 @@ repo. It imports the other MSBuild files as needed. - 3.15.1 + 3.16.0 SMAPI latest $(AssemblySearchPaths);{GAC} diff --git a/docs/release-notes.md b/docs/release-notes.md index 87693512..ca7d6e6e 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -4,10 +4,12 @@ -## Upcoming release +## 3.16.0 +Released 22 August 2022 for Stardew Valley 1.5.6 or later. See [release highlights](https://www.patreon.com/posts/70797008). + * For players: * Added error message if mod files are detected directly under `Mods` (instead of each mod having its own subfolder). * SMAPI now sets a success/error code when the game exits. @@ -21,16 +23,16 @@ * Improved translations. Thanks to KediDili (updated Turkish)! * For mod authors: - * While loading your mod, SMAPI now searches for indirect dependencies in your mod's folder to support edge cases like F# mods (thanks to TehPers)! + * While loading your mod, SMAPI now searches for indirect dependencies in your mod's folder (thanks to TehPers)! This mainly enables F# mods. * **Raised deprecation message levels.** - _Deprecation warnings are now player-visible in the SMAPI console as grayed-out `DEBUG` messages. They'll be raised to `WARN` level in SMAPI 3.17 next month, which will be the last major release before SMAPI 4.0._ + _Deprecation warnings are now player-visible in the SMAPI console as faded `DEBUG` messages._ * Updated to Pintail 2.2.1 (see [changes](https://github.com/Nanoray-pl/Pintail/blob/master/docs/release-notes.md#221)). - * Switched SMAPI's `.pdb` file to the newer 'portable' format. This has no effect on mods. + * Switched SMAPI's `.pdb` files to the newer 'portable' format. This has no effect on mods. * For the web UI: * Added log parser warning about performance of PyTK 1.23.0 or earlier. * Converted images to SVG (thanks to ishan!). - * Updated log parser for new update alert format in SMAPI 3.15.1. + * Updated log parser for the new update alert format in SMAPI 3.15.1. * Updated the JSON validator/schema for Content Patcher 1.28.0. * Fixed log parsing for invalid content packs. * Fixed log parsing if a mod logged a null character. diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json index 3c2dec19..adc45ec3 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.15.1", + "Version": "3.16.0", "Description": "Adds SMAPI console commands that let you manipulate the game.", "UniqueID": "SMAPI.ConsoleCommands", "EntryDll": "ConsoleCommands.dll", - "MinimumApiVersion": "3.15.1" + "MinimumApiVersion": "3.16.0" } diff --git a/src/SMAPI.Mods.ErrorHandler/manifest.json b/src/SMAPI.Mods.ErrorHandler/manifest.json index 28b4b149..3a3c9283 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.15.1", + "Version": "3.16.0", "Description": "Handles some common vanilla errors to log more useful info or avoid breaking the game.", "UniqueID": "SMAPI.ErrorHandler", "EntryDll": "ErrorHandler.dll", - "MinimumApiVersion": "3.15.1" + "MinimumApiVersion": "3.16.0" } diff --git a/src/SMAPI.Mods.SaveBackup/manifest.json b/src/SMAPI.Mods.SaveBackup/manifest.json index 1944575b..eb98aa32 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.15.1", + "Version": "3.16.0", "Description": "Automatically backs up all your saves once per day into its folder.", "UniqueID": "SMAPI.SaveBackup", "EntryDll": "SaveBackup.dll", - "MinimumApiVersion": "3.15.1" + "MinimumApiVersion": "3.16.0" } diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 7aaa33bb..c79a72ef 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -52,7 +52,7 @@ namespace StardewModdingAPI internal static int? LogScreenId { get; set; } /// SMAPI's current raw semantic version. - internal static string RawApiVersion = "3.15.1"; + internal static string RawApiVersion = "3.16.0"; } /// Contains SMAPI's constants and assumptions.