Skip to content

Commit

Permalink
Merge branch 'develop' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Pathoschild committed Nov 8, 2024
2 parents 2f98438 + a915f6d commit 09dd92a
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build/common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repo. It imports the other MSBuild files as needed.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!--set general build properties -->
<Version>4.1.5</Version>
<Version>4.1.6</Version>
<Product>SMAPI</Product>
<LangVersion>latest</LangVersion>
<AssemblySearchPaths>$(AssemblySearchPaths);{GAC}</AssemblySearchPaths>
Expand Down
10 changes: 10 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
4 changes: 2 additions & 2 deletions src/SMAPI.Mods.ConsoleCommands/manifest.json
Original file line number Diff line number Diff line change
@@ -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"
}
4 changes: 2 additions & 2 deletions src/SMAPI.Mods.SaveBackup/manifest.json
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 1 addition & 1 deletion src/SMAPI/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ internal static class EarlyConstants
internal static int? LogScreenId { get; set; }

/// <summary>SMAPI's current raw semantic version.</summary>
internal static string RawApiVersion = "4.1.5";
internal static string RawApiVersion = "4.1.6";
}

/// <summary>Contains SMAPI's constants and assumptions.</summary>
Expand Down
8 changes: 7 additions & 1 deletion src/SMAPI/Framework/Models/SConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ internal class SConfig
private static readonly IDictionary<string, object> DefaultValues = new Dictionary<string, object>
{
[nameof(CheckForUpdates)] = true,
[nameof(CheckContentIntegrity)] = true,
[nameof(ListenForConsoleInput)] = true,
[nameof(ParanoidWarnings)] = Constants.IsDebugBuild,
[nameof(UseBetaChannel)] = Constants.ApiVersion.IsPrerelease(),
Expand Down Expand Up @@ -50,6 +51,9 @@ internal class SConfig
/// <summary>Whether to check for newer versions of SMAPI and mods on startup.</summary>
public bool CheckForUpdates { get; set; }

/// <summary>Whether SMAPI should check whether the content files are present and unmodified.</summary>
public bool CheckContentIntegrity { get; set; }

/// <summary>Whether SMAPI should listen for console input to support console commands.</summary>
public bool ListenForConsoleInput { get; set; }

Expand Down Expand Up @@ -106,6 +110,7 @@ internal class SConfig
/// <summary>Construct an instance.</summary>
/// <param name="developerMode"><inheritdoc cref="DeveloperMode" path="/summary" /></param>
/// <param name="checkForUpdates"><inheritdoc cref="CheckForUpdates" path="/summary" /></param>
/// <param name="checkContentIntegrity"><inheritdoc cref="CheckContentIntegrity" path="/summary" /></param>
/// <param name="listenForConsoleInput"><inheritdoc cref="ListenForConsoleInput" path="/summary" /></param>
/// <param name="paranoidWarnings"><inheritdoc cref="ParanoidWarnings" path="/summary" /></param>
/// <param name="useBetaChannel"><inheritdoc cref="UseBetaChannel" path="/summary" /></param>
Expand All @@ -122,10 +127,11 @@ internal class SConfig
/// <param name="suppressUpdateChecks"><inheritdoc cref="SuppressUpdateChecks" path="/summary" /></param>
/// <param name="modsToLoadEarly"><inheritdoc cref="ModsToLoadEarly" path="/summary" /></param>
/// <param name="modsToLoadLate"><inheritdoc cref="ModsToLoadLate" path="/summary" /></param>
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)];
Expand Down
6 changes: 6 additions & 0 deletions src/SMAPI/Framework/SCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1704,6 +1704,12 @@ private async Task CheckForUpdatesAsync(IModMetadata[] mods)
/// <summary>Verify the game's content files and log a warning if any are missing or modified.</summary>
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
Expand Down
10 changes: 9 additions & 1 deletion src/SMAPI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
9 changes: 9 additions & 0 deletions src/SMAPI/SMAPI.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 5 additions & 2 deletions src/SMAPI/Translation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 09dd92a

Please sign in to comment.