From 8ee555c07aaaaa31fe4ceee9e98efa4408192db1 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 22 Jan 2023 10:18:37 -0500 Subject: suppress findstr installer error for some players --- src/SMAPI.Installer/assets/install on Windows.bat | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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. -- cgit From b9fe45b091484381d2f60220fb09fe7341b20b73 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 28 Jan 2023 16:40:52 -0500 Subject: rework GitHub issue templates to further discourage creating support issues --- src/SMAPI.sln | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') 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}" -- cgit From eb2a9b69bc1cc7503e9548972d104c114675c252 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 4 Feb 2023 11:51:03 -0500 Subject: remove LargeAddressAware flag This isn't needed anymore since SMAPI is 64-bit now. --- src/SMAPI/SMAPI.csproj | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') 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 @@ - -- cgit From 7f7561469fd74d461b8dc4a1e934eed98d2c808b Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 18 Feb 2023 15:08:00 -0500 Subject: update to FluentHttpClient 4.3.0 --- src/SMAPI.Toolkit/SMAPI.Toolkit.csproj | 2 +- src/SMAPI.Web/SMAPI.Web.csproj | 2 +- src/SMAPI/SMAPI.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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 @@ - + -- cgit From 7b5566d0751bec14c5bf93b727fa66e7c58fbf00 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 18 Feb 2023 15:09:18 -0500 Subject: add PerScreen.IsActiveForScreen() --- src/SMAPI/Utilities/PerScreen.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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 -- cgit From 5e578725bf21662ca5e61fad92a46cd09be6af89 Mon Sep 17 00:00:00 2001 From: ORMEEHYUNGKEUN CHA Date: Fri, 13 Jan 2023 14:34:36 +0900 Subject: Update ko.json fixed blatantly wrong translation --- src/SMAPI/i18n/ko.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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}}일" } -- cgit From fe43ec51d095160456f9dee94e161e64ee645d6d Mon Sep 17 00:00:00 2001 From: Freya Arbjerg Date: Tue, 7 Mar 2023 23:20:13 +0100 Subject: Use more portable shebangs --- src/SMAPI.Installer/assets/install on Linux.sh | 2 +- src/SMAPI.Installer/assets/install on macOS.command | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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"`" -- cgit 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: avoid resolving empty folders. --- src/SMAPI/Framework/ModLoading/ModResolver.cs | 1 + src/SMAPI/Framework/SCore.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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(); -- cgit 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: 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(-) (limited to 'src') 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); -- cgit From d2134f0f70963d0673883f8c544267341d3ccc6c Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 26 Mar 2023 13:28:53 -0400 Subject: update release notes & tweak recent changes --- src/SMAPI/Framework/ModLoading/ModResolver.cs | 14 +++++++------- src/SMAPI/Framework/SCore.cs | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') 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 (modIdsToLoadEarly.TryGetValue(id, out string? actualId)) - return -int.MaxValue + Array.IndexOf(earlyArray, actualId); + if (id is not null) + { + 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(); -- cgit From c0ac58f2778fd70e9937a77d3af8a06ef957d871 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 26 Mar 2023 13:30:58 -0400 Subject: fix IsWorldReady being editable by mods --- src/SMAPI/Context.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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). -- cgit From c2e9aad698774e7db9b85292da9077f8462d2f5a Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 26 Mar 2023 13:32:33 -0400 Subject: adjust ModContentManager.HandleUnknownFileTypes to let mods patch it --- src/SMAPI/Framework/ContentManagers/ModContentManager.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') 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. -- cgit From 2e618672aa7bce36a968aca00c2da4eaf336c15f Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 30 Mar 2023 19:20:46 -0400 Subject: update schema for Content Patcher 1.29.0 --- src/SMAPI.Web/wwwroot/schemas/content-patcher.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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": { -- cgit From 46947683cd7c444d2afc8583198e1f103e905007 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 9 Apr 2023 13:08:06 -0400 Subject: prepare for release --- 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 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') 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. -- cgit