diff --git a/build/common.targets b/build/common.targets index 892084caf..fc4a9d5ff 100644 --- a/build/common.targets +++ b/build/common.targets @@ -7,7 +7,7 @@ repo. It imports the other MSBuild files as needed. - 4.1.5 + 4.1.6 SMAPI latest $(AssemblySearchPaths);{GAC} diff --git a/docs/release-notes.md b/docs/release-notes.md index b117d2274..0134342c4 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,6 +1,16 @@ ← [README](README.md) # Release notes +## 4.1.6 +Released 07 November 2024 for Stardew Valley 1.6.10 or later. + +* For players: + * Revamped message shown after a game update to avoid confusion. + * Added option to disable content integrity checks in `smapi-internal/config.json`. When disabled, SMAPI will log a warning for visibility when someone helps you troubleshoot game issues. + +* For mod authors: + * Fixed `translation.ApplyGenderSwitchBlocks(false)` not applied correctly. + ## 4.1.5 Released 07 November 2024 for Stardew Valley 1.6.10 or later. diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json index 25872837b..8788ae4e1 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": "4.1.5", + "Version": "4.1.6", "Description": "Adds SMAPI console commands that let you manipulate the game.", "UniqueID": "SMAPI.ConsoleCommands", "EntryDll": "ConsoleCommands.dll", - "MinimumApiVersion": "4.1.5" + "MinimumApiVersion": "4.1.6" } diff --git a/src/SMAPI.Mods.SaveBackup/manifest.json b/src/SMAPI.Mods.SaveBackup/manifest.json index d11d2ecf2..d09e8b3d5 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": "4.1.5", + "Version": "4.1.6", "Description": "Automatically backs up all your saves once per day into its folder.", "UniqueID": "SMAPI.SaveBackup", "EntryDll": "SaveBackup.dll", - "MinimumApiVersion": "4.1.5" + "MinimumApiVersion": "4.1.6" } diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 5e8d42599..6b39a7423 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -49,7 +49,7 @@ internal static class EarlyConstants internal static int? LogScreenId { get; set; } /// SMAPI's current raw semantic version. - internal static string RawApiVersion = "4.1.5"; + internal static string RawApiVersion = "4.1.6"; } /// Contains SMAPI's constants and assumptions. diff --git a/src/SMAPI/Framework/Models/SConfig.cs b/src/SMAPI/Framework/Models/SConfig.cs index bb9e15ccb..b5bfc414b 100644 --- a/src/SMAPI/Framework/Models/SConfig.cs +++ b/src/SMAPI/Framework/Models/SConfig.cs @@ -16,6 +16,7 @@ internal class SConfig private static readonly IDictionary DefaultValues = new Dictionary { [nameof(CheckForUpdates)] = true, + [nameof(CheckContentIntegrity)] = true, [nameof(ListenForConsoleInput)] = true, [nameof(ParanoidWarnings)] = Constants.IsDebugBuild, [nameof(UseBetaChannel)] = Constants.ApiVersion.IsPrerelease(), @@ -50,6 +51,9 @@ internal class SConfig /// Whether to check for newer versions of SMAPI and mods on startup. public bool CheckForUpdates { get; set; } + /// Whether SMAPI should check whether the content files are present and unmodified. + public bool CheckContentIntegrity { get; set; } + /// Whether SMAPI should listen for console input to support console commands. public bool ListenForConsoleInput { get; set; } @@ -106,6 +110,7 @@ internal class SConfig /// Construct an instance. /// /// + /// /// /// /// @@ -122,10 +127,11 @@ internal class SConfig /// /// /// - public SConfig(bool developerMode, bool? checkForUpdates, bool? listenForConsoleInput, bool? paranoidWarnings, bool? useBetaChannel, string gitHubProjectName, string webApiBaseUrl, string[]? verboseLogging, bool? rewriteMods, bool? fixHarmony, bool? useCaseInsensitivePaths, bool? logNetworkTraffic, bool? logTechnicalDetailsForBrokenMods, ColorSchemeConfig consoleColors, bool? suppressHarmonyDebugMode, string[]? suppressUpdateChecks, string[]? modsToLoadEarly, string[]? modsToLoadLate) + public SConfig(bool developerMode, bool? checkForUpdates, bool? checkContentIntegrity, bool? listenForConsoleInput, bool? paranoidWarnings, bool? useBetaChannel, string gitHubProjectName, string webApiBaseUrl, string[]? verboseLogging, bool? rewriteMods, bool? fixHarmony, bool? useCaseInsensitivePaths, bool? logNetworkTraffic, bool? logTechnicalDetailsForBrokenMods, ColorSchemeConfig consoleColors, bool? suppressHarmonyDebugMode, string[]? suppressUpdateChecks, string[]? modsToLoadEarly, string[]? modsToLoadLate) { this.DeveloperMode = developerMode; this.CheckForUpdates = checkForUpdates ?? (bool)SConfig.DefaultValues[nameof(this.CheckForUpdates)]; + this.CheckContentIntegrity = checkContentIntegrity ?? (bool)SConfig.DefaultValues[nameof(this.CheckContentIntegrity)]; this.ListenForConsoleInput = listenForConsoleInput ?? (bool)SConfig.DefaultValues[nameof(this.ListenForConsoleInput)]; this.ParanoidWarnings = paranoidWarnings ?? (bool)SConfig.DefaultValues[nameof(this.ParanoidWarnings)]; this.UseBetaChannel = useBetaChannel ?? (bool)SConfig.DefaultValues[nameof(this.UseBetaChannel)]; diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 8aee4ca7c..71a3b9e90 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -1704,6 +1704,12 @@ private async Task CheckForUpdatesAsync(IModMetadata[] mods) /// Verify the game's content files and log a warning if any are missing or modified. public void LogContentIntegrityIssues() { + if (!this.Settings.CheckContentIntegrity) + { + this.Monitor.Log("You disabled content integrity checks, so you won't be notified if a game content file is missing or corrupted.", LogLevel.Warn); + return; + } + string contentPath = Constants.ContentPath; // get file diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs index 6104af9e3..0d9096530 100644 --- a/src/SMAPI/Program.cs +++ b/src/SMAPI/Program.cs @@ -175,7 +175,15 @@ private static void AssertDepsJson() if (!File.Exists(targetPath) || FileUtilities.GetFileHash(sourcePath) != FileUtilities.GetFileHash(targetPath)) { File.Copy(sourcePath, targetPath, overwrite: true); - Program.PrintErrorAndExit($"The '{Path.GetFileName(targetPath)}' file didn't match the game's version. SMAPI fixed it automatically, but you must restart SMAPI for the change to take effect."); + + Console.WriteLine("A new game version was installed, so SMAPI needs to update its settings."); + + Console.ForegroundColor = ConsoleColor.DarkGreen; + Console.WriteLine("Please exit this window and re-launch SMAPI to play."); + Console.ResetColor(); + + Thread.Sleep(2500); + Environment.Exit(0); } } diff --git a/src/SMAPI/SMAPI.config.json b/src/SMAPI/SMAPI.config.json index 55f9869b6..e74fade26 100644 --- a/src/SMAPI/SMAPI.config.json +++ b/src/SMAPI/SMAPI.config.json @@ -35,6 +35,15 @@ in future SMAPI versions. */ "CheckForUpdates": true, + /** + * Whether SMAPI should check whether the content files are present and unmodified. This should + * nearly always be enabled. + * + * If disabled, SMAPI will log a warning that it's disabled for visibility when someone helps + * you troubleshoot game issues. + */ + "CheckContentIntegrity": true, + /** * Whether to enable features intended for mod developers. Currently this only makes TRACE-level * messages appear in the console. diff --git a/src/SMAPI/Translation.cs b/src/SMAPI/Translation.cs index 478b91c9a..1ba3e0be0 100644 --- a/src/SMAPI/Translation.cs +++ b/src/SMAPI/Translation.cs @@ -213,8 +213,11 @@ public static implicit operator string(Translation translation) } // apply gender switches - Gender gender = this.ForceGender?.Invoke() ?? Game1.player?.Gender ?? default; - text = Dialogue.applyGenderSwitchBlocks(gender, text); + if (this.ShouldApplyGenderSwitchBlocks) + { + Gender gender = this.ForceGender?.Invoke() ?? Game1.player?.Gender ?? default; + text = Dialogue.applyGenderSwitchBlocks(gender, text); + } } return text;