From 8ee555c07aaaaa31fe4ceee9e98efa4408192db1 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 22 Jan 2023 10:18:37 -0500 Subject: [PATCH 01/15] suppress findstr installer error for some players --- docs/release-notes.md | 4 ++++ src/SMAPI.Installer/assets/install on Windows.bat | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 9eb55b36..d09e9d63 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -7,6 +7,10 @@ _If needed, you can update to SMAPI 3.16.0 first and then install the latest version._ --> +## Upcoming release +* For players: + * Fixed `findstr` error in installer for some players. + ## 3.18.2 Released 09 January 2023 for Stardew Valley 1.5.6 or later. diff --git a/src/SMAPI.Installer/assets/install on Windows.bat b/src/SMAPI.Installer/assets/install on Windows.bat index b0d9ae81..c61a801e 100644 --- a/src/SMAPI.Installer/assets/install on Windows.bat +++ b/src/SMAPI.Installer/assets/install on Windows.bat @@ -4,7 +4,9 @@ setlocal enabledelayedexpansion SET installerDir="%~dp0" REM make sure we're not running within a zip folder -echo %installerDir% | findstr /C:"%TEMP%" 1>nul +REM The error level is usually 0 (install dir contains temp path), 1 (it doesn't), or 9009 (findstr doesn't exist due to a Windows issue). +REM If the command doesn't exist, just skip this check. +echo %installerDir% | findstr /C:"%TEMP%" 1>nul 2>null if %ERRORLEVEL% EQU 0 ( echo Oops! It looks like you're running the installer from inside a zip file. Make sure you unzip the download first. echo. From b9fe45b091484381d2f60220fb09fe7341b20b73 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 28 Jan 2023 16:40:52 -0500 Subject: [PATCH 02/15] rework GitHub issue templates to further discourage creating support issues --- .github/ISSUE_TEMPLATE/bug_report.md | 30 ------------------ .github/ISSUE_TEMPLATE/config.yml | 8 +++++ .github/ISSUE_TEMPLATE/custom.md | 37 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 12 -------- .github/ISSUE_TEMPLATE/general.md | 12 -------- src/SMAPI.sln | 5 ++- 6 files changed, 47 insertions(+), 57 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/custom.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .github/ISSUE_TEMPLATE/general.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index c51d164b..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -name: Bug report -about: Report a problem with SMAPI. - ---- - - - -**Describe the bug** -A clear and concise description of what the bug is. Provide any other details you think might be relevant here. - -**To Reproduce** -Exact steps which reproduce the bug, if possible. For example: -1. Load save '...'. -2. Walk to '....'. -3. Click '....'. -4. Error occurs. - -**Log file** -Upload your SMAPI log to https://smapi.io/log and post a link here. - -**Screenshots** -If applicable, add screenshots to help explain your problem. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..63d7bb67 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Troubleshooting guide for players + url: https://smapi.io/troubleshoot + about: See if your question is already answered first! + - name: Get help or discuss + url: https://smapi.io/help + about: Ask for help from the community, or join the Stardew Valley Discord to ask questions, report issues, or discuss with the SMAPI developer, players, and mod authors. The SMAPI developer is @Pathoschild#0001 on Discord. diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md new file mode 100644 index 00000000..11306e7f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/custom.md @@ -0,0 +1,37 @@ +--- +name: Create a development task +about: DON'T DO THIS BEFORE READING. This is for specific changes to the code or technical bug reports. See below if something isn't working, you have questions or ideas, or you want to discuss something. + +--- + + + +**Describe the bug** +A clear and concise description of what the bug is. Provide any other details you think might be relevant here. + +**To Reproduce** +Exact steps which reproduce the bug, if possible. For example: +1. Load save '...'. +2. Walk to '....'. +3. Click '....'. +4. Error occurs. + +**Log file** +Upload your SMAPI log to https://smapi.io/log and post a link here. + +**Screenshots** +If applicable, add screenshots to help explain your problem. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 8d935dc8..00000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for SMAPI. - ---- - - diff --git a/.github/ISSUE_TEMPLATE/general.md b/.github/ISSUE_TEMPLATE/general.md deleted file mode 100644 index f02d3c9a..00000000 --- a/.github/ISSUE_TEMPLATE/general.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -name: General -about: Create a ticket about something else. - ---- - - diff --git a/src/SMAPI.sln b/src/SMAPI.sln index 8bf86487..99b9dc83 100644 --- a/src/SMAPI.sln +++ b/src/SMAPI.sln @@ -19,9 +19,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{4B1C EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEMPLATE", "{F4453AB6-D7D6-447F-A973-956CC777968F}" ProjectSection(SolutionItems) = preProject - ..\.github\ISSUE_TEMPLATE\bug_report.md = ..\.github\ISSUE_TEMPLATE\bug_report.md - ..\.github\ISSUE_TEMPLATE\feature_request.md = ..\.github\ISSUE_TEMPLATE\feature_request.md - ..\.github\ISSUE_TEMPLATE\general.md = ..\.github\ISSUE_TEMPLATE\general.md + ..\.github\ISSUE_TEMPLATE\config.yml = ..\.github\ISSUE_TEMPLATE\config.yml + ..\.github\ISSUE_TEMPLATE\custom.md = ..\.github\ISSUE_TEMPLATE\custom.md EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{09CF91E5-5BAB-4650-A200-E5EA9A633046}" From eb2a9b69bc1cc7503e9548972d104c114675c252 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 4 Feb 2023 11:51:03 -0500 Subject: [PATCH 03/15] remove LargeAddressAware flag This isn't needed anymore since SMAPI is 64-bit now. --- docs/release-notes.md | 1 + src/SMAPI/SMAPI.csproj | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index d09e9d63..c090cab1 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -10,6 +10,7 @@ ## Upcoming release * For players: * Fixed `findstr` error in installer for some players. + * Removed `LargeAddressAware` flag on SMAPI (no longer needed since it's 64-bit now). ## 3.18.2 Released 09 January 2023 for Stardew Valley 1.5.6 or later. diff --git a/src/SMAPI/SMAPI.csproj b/src/SMAPI/SMAPI.csproj index 59ad47f0..e00dd46e 100644 --- a/src/SMAPI/SMAPI.csproj +++ b/src/SMAPI/SMAPI.csproj @@ -8,7 +8,6 @@ Exe true false - true icon.ico @@ -22,7 +21,6 @@ - From 072efba6dcd28a2b65fba9689b96c0352e7f40d0 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 6 Feb 2023 00:10:33 -0500 Subject: [PATCH 04/15] add NuGet package readme note about using constants before they're defined --- docs/technical/mod-package.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/technical/mod-package.md b/docs/technical/mod-package.md index 23f0b221..ab8a2c95 100644 --- a/docs/technical/mod-package.md +++ b/docs/technical/mod-package.md @@ -99,6 +99,10 @@ There are two places you can put them: 2. Open the `.csproj` file in a text editor (Notepad is fine). 3. Add the properties between the first `` and `` tags you find. +**Note:** you can't use a property before it's defined. That mainly means that when setting +`GameModsPath`, you'll need to either specify `GamePath` manually or put the full path in +`GameModsPath`. + ### Available properties These are the options you can set: From 7f7561469fd74d461b8dc4a1e934eed98d2c808b Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 18 Feb 2023 15:08:00 -0500 Subject: [PATCH 05/15] update to FluentHttpClient 4.3.0 --- docs/release-notes.md | 1 + src/SMAPI.Toolkit/SMAPI.Toolkit.csproj | 2 +- src/SMAPI.Web/SMAPI.Web.csproj | 2 +- src/SMAPI/SMAPI.csproj | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index c090cab1..6915cb3c 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -10,6 +10,7 @@ ## Upcoming release * For players: * Fixed `findstr` error in installer for some players. + * Updated to [FluentHttpClient](https://github.com/Pathoschild/FluentHttpClient#readme) 4.3.0 (see [changes](https://github.com/Pathoschild/FluentHttpClient/blob/develop/RELEASE-NOTES.md#430)). * Removed `LargeAddressAware` flag on SMAPI (no longer needed since it's 64-bit now). ## 3.18.2 diff --git a/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj b/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj index 9529241f..2a9a8294 100644 --- a/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj +++ b/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/SMAPI.Web/SMAPI.Web.csproj b/src/SMAPI.Web/SMAPI.Web.csproj index 1c0e4e42..1e568572 100644 --- a/src/SMAPI.Web/SMAPI.Web.csproj +++ b/src/SMAPI.Web/SMAPI.Web.csproj @@ -25,7 +25,7 @@ - + diff --git a/src/SMAPI/SMAPI.csproj b/src/SMAPI/SMAPI.csproj index e00dd46e..530b75aa 100644 --- a/src/SMAPI/SMAPI.csproj +++ b/src/SMAPI/SMAPI.csproj @@ -24,7 +24,7 @@ - + From 7b5566d0751bec14c5bf93b727fa66e7c58fbf00 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 18 Feb 2023 15:09:18 -0500 Subject: [PATCH 06/15] add PerScreen.IsActiveForScreen() --- docs/release-notes.md | 3 +++ src/SMAPI/Utilities/PerScreen.cs | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/docs/release-notes.md b/docs/release-notes.md index 6915cb3c..a61d024c 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -13,6 +13,9 @@ * Updated to [FluentHttpClient](https://github.com/Pathoschild/FluentHttpClient#readme) 4.3.0 (see [changes](https://github.com/Pathoschild/FluentHttpClient/blob/develop/RELEASE-NOTES.md#430)). * Removed `LargeAddressAware` flag on SMAPI (no longer needed since it's 64-bit now). +* For mod authors: + * Added `IsActiveForScreen()` method to `PerScreen`. + ## 3.18.2 Released 09 January 2023 for Stardew Valley 1.5.6 or later. diff --git a/src/SMAPI/Utilities/PerScreen.cs b/src/SMAPI/Utilities/PerScreen.cs index 87bf2027..674ec760 100644 --- a/src/SMAPI/Utilities/PerScreen.cs +++ b/src/SMAPI/Utilities/PerScreen.cs @@ -101,6 +101,12 @@ namespace StardewModdingAPI.Utilities this.RemoveScreens(_ => true); } + /// Get whether the current screen has a value created yet. + public bool IsActiveForScreen() + { + return this.States.ContainsKey(Context.ScreenId); + } + /********* ** Private methods From 5e578725bf21662ca5e61fad92a46cd09be6af89 Mon Sep 17 00:00:00 2001 From: ORMEEHYUNGKEUN CHA Date: Fri, 13 Jan 2023 14:34:36 +0900 Subject: [PATCH 07/15] Update ko.json fixed blatantly wrong translation --- src/SMAPI/i18n/ko.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SMAPI/i18n/ko.json b/src/SMAPI/i18n/ko.json index 8d267e5e..8122a9e2 100644 --- a/src/SMAPI/i18n/ko.json +++ b/src/SMAPI/i18n/ko.json @@ -1,6 +1,6 @@ { // short date format for SDate // tokens: {{day}} (like 15), {{season}} (like Spring), {{seasonLowercase}} (like spring), {{year}} (like 2) - "generic.date": "{{season}} {{day}}", - "generic.date-with-year": "{{year}} 학년 {{season}} {{day}}" + "generic.date": "{{season}} {{day}}일", + "generic.date-with-year": "{{year}}년차 {{season}} {{day}}일" } From fe43ec51d095160456f9dee94e161e64ee645d6d Mon Sep 17 00:00:00 2001 From: Freya Arbjerg Date: Tue, 7 Mar 2023 23:20:13 +0100 Subject: [PATCH 08/15] Use more portable shebangs --- build/unix/prepare-install-package.sh | 2 +- build/unix/set-smapi-version.sh | 2 +- build/windows/finalize-install-package.sh | 2 +- src/SMAPI.Installer/assets/install on Linux.sh | 2 +- src/SMAPI.Installer/assets/install on macOS.command | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/unix/prepare-install-package.sh b/build/unix/prepare-install-package.sh index 1d805e00..304579b9 100755 --- a/build/unix/prepare-install-package.sh +++ b/build/unix/prepare-install-package.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # diff --git a/build/unix/set-smapi-version.sh b/build/unix/set-smapi-version.sh index 0c0cbeb0..02b5e615 100755 --- a/build/unix/set-smapi-version.sh +++ b/build/unix/set-smapi-version.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # diff --git a/build/windows/finalize-install-package.sh b/build/windows/finalize-install-package.sh index 0996e3ed..117e33e5 100755 --- a/build/windows/finalize-install-package.sh +++ b/build/windows/finalize-install-package.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash ########## ## Read config diff --git a/src/SMAPI.Installer/assets/install on Linux.sh b/src/SMAPI.Installer/assets/install on Linux.sh index 3b7eae9c..70b21521 100644 --- a/src/SMAPI.Installer/assets/install on Linux.sh +++ b/src/SMAPI.Installer/assets/install on Linux.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash cd "`dirname "$0"`" internal/linux/SMAPI.Installer diff --git a/src/SMAPI.Installer/assets/install on macOS.command b/src/SMAPI.Installer/assets/install on macOS.command index abd21dc8..e85230ed 100644 --- a/src/SMAPI.Installer/assets/install on macOS.command +++ b/src/SMAPI.Installer/assets/install on macOS.command @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash cd "`dirname "$0"`" From 58ccaf9a1e3a9e374f07f23b5c3043dd3c0566ba Mon Sep 17 00:00:00 2001 From: atravita-mods <94934860+atravita-mods@users.noreply.github.com> Date: Thu, 23 Mar 2023 22:04:21 -0400 Subject: [PATCH 09/15] avoid resolving empty folders. --- src/SMAPI/Framework/ModLoading/ModResolver.cs | 1 + src/SMAPI/Framework/SCore.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SMAPI/Framework/ModLoading/ModResolver.cs b/src/SMAPI/Framework/ModLoading/ModResolver.cs index cb62e16f..40d8b3bc 100644 --- a/src/SMAPI/Framework/ModLoading/ModResolver.cs +++ b/src/SMAPI/Framework/ModLoading/ModResolver.cs @@ -178,6 +178,7 @@ namespace StardewModdingAPI.Framework.ModLoading string[] lateArray = modIdsToLoadLate.ToArray(); return mods + .Where(mod => mod.FailReason is not null) .OrderBy(mod => { string id = mod.Manifest.UniqueID; diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 1d146d5f..37ca1556 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -433,7 +433,7 @@ namespace StardewModdingAPI.Framework // apply load order customizations if (this.Settings.ModsToLoadEarly.Any() || this.Settings.ModsToLoadLate.Any()) { - HashSet installedIds = new HashSet(mods.Select(p => p.Manifest.UniqueID), StringComparer.OrdinalIgnoreCase); + HashSet installedIds = new HashSet(mods.Where(p => p.FailReason is null).Select(p => p.Manifest.UniqueID), StringComparer.OrdinalIgnoreCase); string[] missingEarlyMods = this.Settings.ModsToLoadEarly.Where(id => !installedIds.Contains(id)).OrderBy(p => p, StringComparer.OrdinalIgnoreCase).ToArray(); string[] missingLateMods = this.Settings.ModsToLoadLate.Where(id => !installedIds.Contains(id)).OrderBy(p => p, StringComparer.OrdinalIgnoreCase).ToArray(); From c12e9d788e71aaee155a4a055c08ccb88f0e8c21 Mon Sep 17 00:00:00 2001 From: atravita-mods <94934860+atravita-mods@users.noreply.github.com> Date: Thu, 23 Mar 2023 22:24:07 -0400 Subject: [PATCH 10/15] as per comments, remove where in favor of nullchecking id instead --- src/SMAPI/Framework/ModLoading/ModResolver.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/SMAPI/Framework/ModLoading/ModResolver.cs b/src/SMAPI/Framework/ModLoading/ModResolver.cs index 40d8b3bc..37aceb1b 100644 --- a/src/SMAPI/Framework/ModLoading/ModResolver.cs +++ b/src/SMAPI/Framework/ModLoading/ModResolver.cs @@ -178,10 +178,12 @@ namespace StardewModdingAPI.Framework.ModLoading string[] lateArray = modIdsToLoadLate.ToArray(); return mods - .Where(mod => mod.FailReason is not null) .OrderBy(mod => { - string id = mod.Manifest.UniqueID; + string? id = mod.Manifest?.UniqueID; + + if (id is null) + return 0; if (modIdsToLoadEarly.TryGetValue(id, out string? actualId)) return -int.MaxValue + Array.IndexOf(earlyArray, actualId); From d2134f0f70963d0673883f8c544267341d3ccc6c Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 26 Mar 2023 13:28:53 -0400 Subject: [PATCH 11/15] update release notes & tweak recent changes --- docs/release-notes.md | 7 +++++-- src/SMAPI/Framework/ModLoading/ModResolver.cs | 14 +++++++------- src/SMAPI/Framework/SCore.cs | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index a61d024c..558e9215 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -9,12 +9,15 @@ ## Upcoming release * For players: - * Fixed `findstr` error in installer for some players. - * Updated to [FluentHttpClient](https://github.com/Pathoschild/FluentHttpClient#readme) 4.3.0 (see [changes](https://github.com/Pathoschild/FluentHttpClient/blob/develop/RELEASE-NOTES.md#430)). + * Fixed `findstr` installer error for some players. + * Fixed installer error for some Linux users due to a non-portable shebang (thanks to freyacoded!). + * Fixed error using load order overrides when there are broken mods installed (thanks to atravita!). * Removed `LargeAddressAware` flag on SMAPI (no longer needed since it's 64-bit now). + * Improved translations. Thganks to stylemate (updated Korean)! * For mod authors: * Added `IsActiveForScreen()` method to `PerScreen`. + * Updated to [FluentHttpClient](https://github.com/Pathoschild/FluentHttpClient#readme) 4.3.0 (see [changes](https://github.com/Pathoschild/FluentHttpClient/blob/develop/RELEASE-NOTES.md#430)). ## 3.18.2 Released 09 January 2023 for Stardew Valley 1.5.6 or later. diff --git a/src/SMAPI/Framework/ModLoading/ModResolver.cs b/src/SMAPI/Framework/ModLoading/ModResolver.cs index 37aceb1b..607bb70d 100644 --- a/src/SMAPI/Framework/ModLoading/ModResolver.cs +++ b/src/SMAPI/Framework/ModLoading/ModResolver.cs @@ -182,14 +182,14 @@ namespace StardewModdingAPI.Framework.ModLoading { string? id = mod.Manifest?.UniqueID; - if (id is null) - return 0; + if (id is not null) + { + if (modIdsToLoadEarly.TryGetValue(id, out string? actualId)) + return -int.MaxValue + Array.IndexOf(earlyArray, actualId); - if (modIdsToLoadEarly.TryGetValue(id, out string? actualId)) - return -int.MaxValue + Array.IndexOf(earlyArray, actualId); - - if (modIdsToLoadLate.TryGetValue(id, out actualId)) - return int.MaxValue - Array.IndexOf(lateArray, actualId); + if (modIdsToLoadLate.TryGetValue(id, out actualId)) + return int.MaxValue - Array.IndexOf(lateArray, actualId); + } return 0; }) diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 37ca1556..abba7f3b 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -433,7 +433,7 @@ namespace StardewModdingAPI.Framework // apply load order customizations if (this.Settings.ModsToLoadEarly.Any() || this.Settings.ModsToLoadLate.Any()) { - HashSet installedIds = new HashSet(mods.Where(p => p.FailReason is null).Select(p => p.Manifest.UniqueID), StringComparer.OrdinalIgnoreCase); + HashSet installedIds = new HashSet(mods.Select(p => p.Manifest?.UniqueID).Where(p => p is not null), StringComparer.OrdinalIgnoreCase); string[] missingEarlyMods = this.Settings.ModsToLoadEarly.Where(id => !installedIds.Contains(id)).OrderBy(p => p, StringComparer.OrdinalIgnoreCase).ToArray(); string[] missingLateMods = this.Settings.ModsToLoadLate.Where(id => !installedIds.Contains(id)).OrderBy(p => p, StringComparer.OrdinalIgnoreCase).ToArray(); From c0ac58f2778fd70e9937a77d3af8a06ef957d871 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 26 Mar 2023 13:30:58 -0400 Subject: [PATCH 12/15] fix IsWorldReady being editable by mods --- docs/release-notes.md | 1 + src/SMAPI/Context.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 558e9215..991f8faa 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -18,6 +18,7 @@ * For mod authors: * Added `IsActiveForScreen()` method to `PerScreen`. * Updated to [FluentHttpClient](https://github.com/Pathoschild/FluentHttpClient#readme) 4.3.0 (see [changes](https://github.com/Pathoschild/FluentHttpClient/blob/develop/RELEASE-NOTES.md#430)). + * Fixed `Context.IsWorldReady` being editable by mods. ## 3.18.2 Released 09 January 2023 for Stardew Valley 1.5.6 or later. diff --git a/src/SMAPI/Context.cs b/src/SMAPI/Context.cs index c822908e..978459e8 100644 --- a/src/SMAPI/Context.cs +++ b/src/SMAPI/Context.cs @@ -60,7 +60,7 @@ namespace StardewModdingAPI public static bool IsWorldReady { get => Context.IsWorldReadyForScreen.Value; - set => Context.IsWorldReadyForScreen.Value = value; + internal set => Context.IsWorldReadyForScreen.Value = value; } /// Whether is true and the player is free to act in the world (no menu is displayed, no cutscene is in progress, etc). From c2e9aad698774e7db9b85292da9077f8462d2f5a Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 26 Mar 2023 13:32:33 -0400 Subject: [PATCH 13/15] adjust ModContentManager.HandleUnknownFileTypes to let mods patch it --- docs/release-notes.md | 1 + .../Framework/ContentManagers/ModContentManager.cs | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 991f8faa..4daf97ce 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -18,6 +18,7 @@ * For mod authors: * Added `IsActiveForScreen()` method to `PerScreen`. * Updated to [FluentHttpClient](https://github.com/Pathoschild/FluentHttpClient#readme) 4.3.0 (see [changes](https://github.com/Pathoschild/FluentHttpClient/blob/develop/RELEASE-NOTES.md#430)). + * Adjusted `ModContentManager.HandleUnknownFileType` to let mods patch it. * Fixed `Context.IsWorldReady` being editable by mods. ## 3.18.2 diff --git a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs index badbd766..2c068784 100644 --- a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs +++ b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs @@ -130,7 +130,7 @@ namespace StardewModdingAPI.Framework.ContentManagers ".png" => this.LoadImageFile(assetName, file), ".tbin" or ".tmx" => this.LoadMapFile(assetName, file), ".xnb" => this.LoadXnbFile(assetName), - _ => this.HandleUnknownFileType(assetName, file) + _ => (T)this.HandleUnknownFileType(assetName, file, typeof(T)) }; } catch (Exception ex) @@ -323,13 +323,15 @@ namespace StardewModdingAPI.Framework.ContentManagers } /// Handle a request to load a file type that isn't supported by SMAPI. - /// The expected file type. /// The asset name relative to the loader root directory. /// The file to load. - private T HandleUnknownFileType(IAssetName assetName, FileInfo file) + /// The expected file type. + private object HandleUnknownFileType(IAssetName assetName, FileInfo file, Type assetType) { this.ThrowLoadError(assetName, ContentLoadErrorType.InvalidName, $"unknown file extension '{file.Extension}'; must be one of '.fnt', '.json', '.png', '.tbin', '.tmx', or '.xnb'."); - return default; + return assetType.IsValueType + ? Activator.CreateInstance(assetType) + : null; } /// Assert that the asset type is compatible with one of the allowed types. From 2e618672aa7bce36a968aca00c2da4eaf336c15f Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 30 Mar 2023 19:20:46 -0400 Subject: [PATCH 14/15] update schema for Content Patcher 1.29.0 --- docs/release-notes.md | 3 +++ src/SMAPI.Web/wwwroot/schemas/content-patcher.json | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 4daf97ce..075ec6b4 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -21,6 +21,9 @@ * Adjusted `ModContentManager.HandleUnknownFileType` to let mods patch it. * Fixed `Context.IsWorldReady` being editable by mods. +* For the web UI: + * Updated the JSON validator/schema for Content Patcher 1.29.0. + ## 3.18.2 Released 09 January 2023 for Stardew Valley 1.5.6 or later. diff --git a/src/SMAPI.Web/wwwroot/schemas/content-patcher.json b/src/SMAPI.Web/wwwroot/schemas/content-patcher.json index a00403c0..bd9e7427 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\\.28\\.[0-9]+$", + "pattern": "^1\\.29\\.[0-9]+$", "@errorMessages": { - "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." + "pattern": "Incorrect value '@value'. You should always use the latest format version (currently 1.29.0) to enable the latest features, avoid obsolete behavior, and reduce load times." } }, "ConfigSchema": { From 46947683cd7c444d2afc8583198e1f103e905007 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 9 Apr 2023 13:08:06 -0400 Subject: [PATCH 15/15] prepare for release --- build/common.targets | 2 +- docs/release-notes.md | 6 ++++-- src/SMAPI.Mods.ConsoleCommands/manifest.json | 4 ++-- src/SMAPI.Mods.ErrorHandler/manifest.json | 4 ++-- src/SMAPI.Mods.SaveBackup/manifest.json | 4 ++-- src/SMAPI/Constants.cs | 2 +- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/build/common.targets b/build/common.targets index 590e0415..1ead1508 100644 --- a/build/common.targets +++ b/build/common.targets @@ -7,7 +7,7 @@ repo. It imports the other MSBuild files as needed. - 3.18.2 + 3.18.3 SMAPI latest $(AssemblySearchPaths);{GAC} diff --git a/docs/release-notes.md b/docs/release-notes.md index 075ec6b4..e99218bd 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -7,10 +7,12 @@ _If needed, you can update to SMAPI 3.16.0 first and then install the latest version._ --> -## Upcoming release +## 3.18.3 +Released 09 April 2023 for Stardew Valley 1.5.6 or later. + * For players: * Fixed `findstr` installer error for some players. - * Fixed installer error for some Linux users due to a non-portable shebang (thanks to freyacoded!). + * Fixed installer error for some Linux players due to a non-portable shebang (thanks to freyacoded!). * Fixed error using load order overrides when there are broken mods installed (thanks to atravita!). * Removed `LargeAddressAware` flag on SMAPI (no longer needed since it's 64-bit now). * Improved translations. Thganks to stylemate (updated Korean)! diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json index 6ababef0..2447c5c3 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.18.2", + "Version": "3.18.3", "Description": "Adds SMAPI console commands that let you manipulate the game.", "UniqueID": "SMAPI.ConsoleCommands", "EntryDll": "ConsoleCommands.dll", - "MinimumApiVersion": "3.18.2" + "MinimumApiVersion": "3.18.3" } diff --git a/src/SMAPI.Mods.ErrorHandler/manifest.json b/src/SMAPI.Mods.ErrorHandler/manifest.json index 82630479..306c92fc 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.18.2", + "Version": "3.18.3", "Description": "Handles some common vanilla errors to log more useful info or avoid breaking the game.", "UniqueID": "SMAPI.ErrorHandler", "EntryDll": "ErrorHandler.dll", - "MinimumApiVersion": "3.18.2" + "MinimumApiVersion": "3.18.3" } diff --git a/src/SMAPI.Mods.SaveBackup/manifest.json b/src/SMAPI.Mods.SaveBackup/manifest.json index e29a3ed3..c5075c57 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.18.2", + "Version": "3.18.3", "Description": "Automatically backs up all your saves once per day into its folder.", "UniqueID": "SMAPI.SaveBackup", "EntryDll": "SaveBackup.dll", - "MinimumApiVersion": "3.18.2" + "MinimumApiVersion": "3.18.3" } diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 482ec816..77a19964 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.18.2"; + internal static string RawApiVersion = "3.18.3"; } /// Contains SMAPI's constants and assumptions.