From 0d5b4e9983dd30fc7c586c22d69d54cd44e7a627 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 2 Apr 2021 20:13:23 -0400 Subject: update resource clump logic for SDV 1.5 (#770) --- docs/release-notes.md | 4 ++++ .../Framework/Commands/World/ClearCommand.cs | 18 ++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index ad644532..3d505b8b 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -7,6 +7,10 @@ * Migrated to Harmony 2.0 (see [_migrate to Harmony 2.0_](https://stardewvalleywiki.com/Modding:Migrate_to_Harmony_2.0) for more info). --> +## Upcoming release +* For players: + * Fixed `world_clear` console command not removing resource clumps outside the farm and secret woods. + ## 3.9.5 Released 21 March 2021 for Stardew Valley 1.5.4 or later. diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs index 4b0e45a0..4cfaf242 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Linq; using StardewValley; using StardewValley.Locations; @@ -224,18 +223,17 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World { int removed = 0; - // get resource clumps - IList resourceClumps = - (location as Farm)?.resourceClumps - ?? (IList)(location as Woods)?.stumps - ?? new List(); + foreach (var clump in location.resourceClumps.Where(shouldRemove).ToArray()) + { + location.resourceClumps.Remove(clump); + removed++; + } - // remove matching clumps - foreach (var clump in resourceClumps.ToArray()) + if (location is Woods woods) { - if (shouldRemove(clump)) + foreach (ResourceClump clump in woods.stumps.Where(shouldRemove).ToArray()) { - resourceClumps.Remove(clump); + woods.stumps.Remove(clump); removed++; } } -- cgit From 3dc344054a701379528ca5de256210ce232c8cc3 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 2 Apr 2021 20:35:02 -0400 Subject: don't overwrite .bin.osx file unnecessarily to avoid resetting file permissions (#768) --- docs/release-notes.md | 1 + src/SMAPI.Installer/assets/unix-launcher.sh | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 3d505b8b..a9074ba9 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -9,6 +9,7 @@ ## Upcoming release * For players: + * On macOS, the `StardewModdingAPI.bin.osx` file is no longer overwritten if it's identical to avoid resetting file permissions (thanks to 007wayne!). * Fixed `world_clear` console command not removing resource clumps outside the farm and secret woods. ## 3.9.5 diff --git a/src/SMAPI.Installer/assets/unix-launcher.sh b/src/SMAPI.Installer/assets/unix-launcher.sh index 1d97d487..93bf58d8 100644 --- a/src/SMAPI.Installer/assets/unix-launcher.sh +++ b/src/SMAPI.Installer/assets/unix-launcher.sh @@ -37,8 +37,13 @@ if [ "$UNAME" == "Darwin" ]; then ln -s /Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib libgdiplus.dylib fi + # create bin file + # Note: don't overwrite if it's identical, to avoid resetting permission flags + if [ ! -x StardewModdingAPI.bin.osx ] || ! cmp StardewValley.bin.osx StardewModdingAPI.bin.osx >/dev/null 2>&1; then + cp -p StardewValley.bin.osx StardewModdingAPI.bin.osx + fi + # launch SMAPI - cp StardewValley.bin.osx StardewModdingAPI.bin.osx open -a Terminal ./StardewModdingAPI.bin.osx "$@" else # choose launcher -- cgit From 1a4cdd71a5d5bd69a76d67c346562fdc2ccef22b Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 2 Apr 2021 21:18:18 -0400 Subject: fix asset propagation for localized movie data --- docs/release-notes.md | 4 ++++ src/SMAPI/Metadata/CoreAssetPropagator.cs | 15 ++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index a9074ba9..74c68075 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -10,8 +10,12 @@ ## Upcoming release * For players: * On macOS, the `StardewModdingAPI.bin.osx` file is no longer overwritten if it's identical to avoid resetting file permissions (thanks to 007wayne!). + * Fixed error for non-English players after returning to title, reloading, and entering town with a completed movie theater. * Fixed `world_clear` console command not removing resource clumps outside the farm and secret woods. +* For modders: + * Added asset propagation for `Data\Concessions`. + ## 3.9.5 Released 21 March 2021 for Stardew Valley 1.5.4 or later. diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index 52da3946..83ed52ad 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -286,6 +286,10 @@ namespace StardewModdingAPI.Metadata Game1.clothingInformation = content.Load>(key); return true; + case "data\\concessions": // MovieTheater.GetConcessions + MovieTheater.ClearCachedLocalizedData(); + return true; + case "data\\concessiontastes": // MovieTheater.GetConcessionTasteForCharacter this.Reflection .GetField>(typeof(MovieTheater), "_concessionTastes") @@ -306,16 +310,9 @@ namespace StardewModdingAPI.Metadata case "data\\hairdata": // Farmer.GetHairStyleMetadataFile return this.ReloadHairData(); - case "data\\moviesreactions": // MovieTheater.GetMovieReactions - this.Reflection - .GetField>(typeof(MovieTheater), "_genericReactions") - .SetValue(content.Load>(key)); - return true; - case "data\\movies": // MovieTheater.GetMovieData - this.Reflection - .GetField>(typeof(MovieTheater), "_movieData") - .SetValue(content.Load>(key)); + case "data\\moviesreactions": // MovieTheater.GetMovieReactions + MovieTheater.ClearCachedLocalizedData(); return true; case "data\\npcdispositions": // NPC constructor -- cgit From 62c1f11109b3a16e4e1d526e8ddc891015c507b0 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 2 Apr 2021 21:30:55 -0400 Subject: remove unneeded compile switch (#767) This was originally added to reduce antivirus false positives, but they do it anyway at this point. --- docs/release-notes.md | 1 + src/SMAPI.Installer/InteractiveInstaller.cs | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 74c68075..748651bb 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -12,6 +12,7 @@ * On macOS, the `StardewModdingAPI.bin.osx` file is no longer overwritten if it's identical to avoid resetting file permissions (thanks to 007wayne!). * Fixed error for non-English players after returning to title, reloading, and entering town with a completed movie theater. * Fixed `world_clear` console command not removing resource clumps outside the farm and secret woods. + * Internal changes to prepare for unofficial 64-bit. * For modders: * Added asset propagation for `Data\Concessions`. diff --git a/src/SMAPI.Installer/InteractiveInstaller.cs b/src/SMAPI.Installer/InteractiveInstaller.cs index 3d673719..2dcd81e7 100644 --- a/src/SMAPI.Installer/InteractiveInstaller.cs +++ b/src/SMAPI.Installer/InteractiveInstaller.cs @@ -10,9 +10,7 @@ using StardewModdingAPI.Internal.ConsoleWriting; using StardewModdingAPI.Toolkit; using StardewModdingAPI.Toolkit.Framework.ModScanning; using StardewModdingAPI.Toolkit.Utilities; -#if !SMAPI_FOR_WINDOWS using System.Diagnostics; -#endif namespace StardewModdingApi.Installer { @@ -433,8 +431,6 @@ namespace StardewModdingApi.Installer // mark file executable // (MSBuild doesn't keep permission flags for files zipped in a build task.) - // (Note: exclude from Windows build because antivirus apps can flag the process start code as suspicious.) -#if !SMAPI_FOR_WINDOWS new Process { StartInfo = new ProcessStartInfo @@ -444,7 +440,6 @@ namespace StardewModdingApi.Installer CreateNoWindow = true } }.Start(); -#endif } // create mods directory (if needed) -- cgit From 3fa0433c9862d1922cd0540848d2bd8716934d1f Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 2 Apr 2021 21:30:55 -0400 Subject: add initial support for 64-bit Windows hack (#767) --- build/common.targets | 12 +++-- docs/technical/smapi.md | 3 +- .../SMAPI.Mods.ConsoleCommands.csproj | 2 +- .../SMAPI.Mods.ErrorHandler.csproj | 2 +- src/SMAPI/Constants.cs | 56 +++++++++++----------- src/SMAPI/Framework/Logging/LogManager.cs | 3 ++ src/SMAPI/Framework/SCore.cs | 2 +- src/SMAPI/SMAPI.csproj | 6 ++- 8 files changed, 49 insertions(+), 37 deletions(-) diff --git a/build/common.targets b/build/common.targets index d680fa74..8137a6f3 100644 --- a/build/common.targets +++ b/build/common.targets @@ -1,7 +1,4 @@ - - - 3.9.5 @@ -9,9 +6,15 @@ latest $(AssemblySearchPaths);{GAC} - $(DefineConstants);SMAPI_FOR_WINDOWS;SMAPI_FOR_XNA + + + $(DefineConstants);SMAPI_FOR_WINDOWS + $(DefineConstants);SMAPI_FOR_XNA + + + @@ -76,5 +79,4 @@ - diff --git a/docs/technical/smapi.md b/docs/technical/smapi.md index e77d9d82..993bddfb 100644 --- a/docs/technical/smapi.md +++ b/docs/technical/smapi.md @@ -57,7 +57,8 @@ SMAPI uses a small number of conditional compilation constants, which you can se flag | purpose ---- | ------- `SMAPI_FOR_WINDOWS` | Whether SMAPI is being compiled for Windows; if not set, the code assumes Linux/MacOS. Set automatically in `common.targets`. -`SMAPI_FOR_XNA` | Whether SMAPI is being compiled for XNA Framework; if not set, the code assumes MonoGame. Set automatically in `common.targets` with the same value as `SMAPI_FOR_WINDOWS`. +`SMAPI_FOR_WINDOWS_64BIT_HACK` | Whether SMAPI is being [compiled for Windows with a 64-bit Linux version of the game](https://github.com/Pathoschild/SMAPI/issues/767). This is highly specialized and shouldn't be used in most cases. False by default. +`SMAPI_FOR_XNA` | Whether SMAPI is being compiled for XNA Framework; if not set, the code assumes MonoGame. Set automatically in `common.targets` with the same value as `SMAPI_FOR_WINDOWS` (unless `SMAPI_FOR_WINDOWS_64BIT_HACK` is set). `HARMONY_2` | Whether to enable experimental Harmony 2.0 support and rewrite existing Harmony 1._x_ mods for compatibility. Note that you need to replace `build/0Harmony.dll` with a Harmony 2.0 build (or switch to a package reference) to use this flag. ## For SMAPI developers diff --git a/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj b/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj index a187c1ff..432fdc35 100644 --- a/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj +++ b/src/SMAPI.Mods.ConsoleCommands/SMAPI.Mods.ConsoleCommands.csproj @@ -19,7 +19,7 @@ - + diff --git a/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj b/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj index 788f6f16..56daa710 100644 --- a/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj +++ b/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj @@ -19,7 +19,7 @@ - + diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 8b0c952d..af9b7aa2 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -38,6 +38,14 @@ namespace StardewModdingAPI /// The target game platform. internal static GamePlatform Platform { get; } = (GamePlatform)Enum.Parse(typeof(GamePlatform), LowLevelEnvironmentUtility.DetectPlatform()); + /// Whether SMAPI is being compiled for Windows with a 64-bit Linux version of the game. This is highly specialized and shouldn't be used in most cases. + internal static bool IsWindows64BitHack { get; } = +#if SMAPI_FOR_WINDOWS_64BIT_HACK + true; +#else + false; +#endif + /// The game framework running the game. internal static GameFramework GameFramework { get; } = #if SMAPI_FOR_XNA @@ -47,7 +55,7 @@ namespace StardewModdingAPI #endif /// The game's assembly name. - internal static string GameAssemblyName => EarlyConstants.Platform == GamePlatform.Windows ? "Stardew Valley" : "StardewValley"; + internal static string GameAssemblyName => EarlyConstants.Platform == GamePlatform.Windows && !EarlyConstants.IsWindows64BitHack ? "Stardew Valley" : "StardewValley"; /// The value which should appear in the SMAPI log, if any. internal static int? LogScreenId { get; set; } @@ -231,33 +239,27 @@ namespace StardewModdingAPI targetAssemblies.Add(typeof(StardewModdingAPI.IManifest).Assembly); // get changes for platform - switch (targetPlatform) + if (Constants.Platform != Platform.Windows || EarlyConstants.IsWindows64BitHack) { - case Platform.Linux: - case Platform.Mac: - removeAssemblyReferences.AddRange(new[] - { - "Netcode", - "Stardew Valley" - }); - targetAssemblies.Add( - typeof(StardewValley.Game1).Assembly // note: includes Netcode types on Linux/Mac - ); - break; - - case Platform.Windows: - removeAssemblyReferences.Add( - "StardewValley" - ); - targetAssemblies.AddRange(new[] - { - typeof(Netcode.NetBool).Assembly, - typeof(StardewValley.Game1).Assembly - }); - break; - - default: - throw new InvalidOperationException($"Unknown target platform '{targetPlatform}'."); + removeAssemblyReferences.AddRange(new[] + { + "Netcode", + "Stardew Valley" + }); + targetAssemblies.Add( + typeof(StardewValley.Game1).Assembly // note: includes Netcode types on Linux/Mac + ); + } + else + { + removeAssemblyReferences.Add( + "StardewValley" + ); + targetAssemblies.AddRange(new[] + { + typeof(Netcode.NetBool).Assembly, + typeof(StardewValley.Game1).Assembly + }); } // get changes for game framework diff --git a/src/SMAPI/Framework/Logging/LogManager.cs b/src/SMAPI/Framework/Logging/LogManager.cs index 243ca3ae..38d561e5 100644 --- a/src/SMAPI/Framework/Logging/LogManager.cs +++ b/src/SMAPI/Framework/Logging/LogManager.cs @@ -287,6 +287,9 @@ namespace StardewModdingAPI.Framework.Logging string platformLabel = EnvironmentUtility.GetFriendlyPlatformName(Constants.Platform); if ((Constants.GameFramework == GameFramework.Xna) != (Constants.Platform == Platform.Windows)) platformLabel += $" with {Constants.GameFramework}"; +#if SMAPI_FOR_WINDOWS_64BIT_HACK + platformLabel += " 64-bit hack"; +#endif // init logging this.Monitor.Log($"SMAPI {Constants.ApiVersion} with Stardew Valley {Constants.GameVersion} on {platformLabel}", LogLevel.Info); diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index ebb21555..22c58099 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -419,7 +419,7 @@ namespace StardewModdingAPI.Framework Game1.mapDisplayDevice = new SDisplayDevice(Game1.content, Game1.game1.GraphicsDevice); // log GPU info -#if SMAPI_FOR_WINDOWS +#if SMAPI_FOR_WINDOWS && !SMAPI_FOR_WINDOWS_64BIT_HACK this.Monitor.Log($"Running on GPU: {Game1.game1.GraphicsDevice?.Adapter?.Description ?? ""}"); #endif } diff --git a/src/SMAPI/SMAPI.csproj b/src/SMAPI/SMAPI.csproj index ceef33df..413d9f33 100644 --- a/src/SMAPI/SMAPI.csproj +++ b/src/SMAPI/SMAPI.csproj @@ -14,6 +14,10 @@ + + x64 + + @@ -34,7 +38,7 @@ - + -- cgit From 60b563267ea7bc308d7eda55477f61fa063b069a Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 2 Apr 2021 21:30:55 -0400 Subject: fix asset key normalization for 64-bit hack (#767) --- src/SMAPI/Framework/Content/ContentCache.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SMAPI/Framework/Content/ContentCache.cs b/src/SMAPI/Framework/Content/ContentCache.cs index 7edc9ab9..5c7ad778 100644 --- a/src/SMAPI/Framework/Content/ContentCache.cs +++ b/src/SMAPI/Framework/Content/ContentCache.cs @@ -57,6 +57,8 @@ namespace StardewModdingAPI.Framework.Content IReflectedMethod method = reflection.GetMethod(typeof(TitleContainer), "GetCleanPath"); this.NormalizeAssetNameForPlatform = path => method.Invoke(path); } + else if (EarlyConstants.IsWindows64BitHack) + this.NormalizeAssetNameForPlatform = PathUtilities.NormalizePath; else this.NormalizeAssetNameForPlatform = key => key.Replace('\\', '/'); // based on MonoGame's ContentManager.Load logic } -- cgit From 2d8f916053a1b4b039a41a8bbe8018ebe2654022 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 3 Apr 2021 11:39:58 -0400 Subject: log failed root dependencies in their own group --- docs/release-notes.md | 1 + src/SMAPI/Framework/IModMetadata.cs | 5 + src/SMAPI/Framework/Logging/LogManager.cs | 163 +++++++++++++++++--------- src/SMAPI/Framework/ModLoading/ModMetadata.cs | 53 +++++++-- 4 files changed, 156 insertions(+), 66 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 748651bb..2ed46af1 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -9,6 +9,7 @@ ## Upcoming release * For players: + * When many mods fail to load, root dependencies are now listed in their own group so it's easier to see which ones you should try updating first. * On macOS, the `StardewModdingAPI.bin.osx` file is no longer overwritten if it's identical to avoid resetting file permissions (thanks to 007wayne!). * Fixed error for non-English players after returning to title, reloading, and entering town with a completed movie theater. * Fixed `world_clear` console command not removing resource clumps outside the farm and secret woods. diff --git a/src/SMAPI/Framework/IModMetadata.cs b/src/SMAPI/Framework/IModMetadata.cs index 5d2f352d..f5babafb 100644 --- a/src/SMAPI/Framework/IModMetadata.cs +++ b/src/SMAPI/Framework/IModMetadata.cs @@ -117,6 +117,11 @@ namespace StardewModdingAPI.Framework /// Only return valid update keys. IEnumerable GetUpdateKeys(bool validOnly = true); + /// Get whether the given mod ID must be installed to load this mod. + /// The mod ID to check. + /// Whether to include optional dependencies. + bool HasRequiredModId(string modId, bool includeOptional); + /// Get the mod IDs that must be installed to load this mod. /// Whether to include optional dependencies. IEnumerable GetRequiredModIds(bool includeOptional = false); diff --git a/src/SMAPI/Framework/Logging/LogManager.cs b/src/SMAPI/Framework/Logging/LogManager.cs index 38d561e5..4ba4fffc 100644 --- a/src/SMAPI/Framework/Logging/LogManager.cs +++ b/src/SMAPI/Framework/Logging/LogManager.cs @@ -429,67 +429,38 @@ namespace StardewModdingAPI.Framework.Logging // log skipped mods if (skippedMods.Any()) { - // get logging logic - HashSet loggedDuplicateIds = new HashSet(); - void LogSkippedMod(IModMetadata mod) - { - string message = $" - {mod.DisplayName}{(mod.Manifest?.Version != null ? " " + mod.Manifest.Version.ToString() : "")} because {mod.Error}"; + var loggedDuplicateIds = new HashSet(); - // handle duplicate mods - // (log first duplicate only, don't show redundant version) - if (mod.FailReason == ModFailReason.Duplicate && mod.HasManifest()) + this.Monitor.Log(" Skipped mods", LogLevel.Error); + this.Monitor.Log(" " + "".PadRight(50, '-'), LogLevel.Error); + this.Monitor.Log(" These mods could not be added to your game.", LogLevel.Error); + this.Monitor.Newline(); + foreach (var list in this.GroupFailedModsByPriority(skippedMods)) + { + if (list.Any()) { - if (!loggedDuplicateIds.Add(mod.Manifest.UniqueID)) - return; // already logged + foreach (IModMetadata mod in list.OrderBy(p => p.DisplayName)) + { + string message = $" - {mod.DisplayName}{(" " + mod.Manifest?.Version?.ToString()).TrimEnd()} because {mod.Error}"; - message = $" - {mod.DisplayName} because {mod.Error}"; - } + // duplicate mod: log first one only, don't show redundant version + if (mod.FailReason == ModFailReason.Duplicate && mod.HasManifest()) + { + if (loggedDuplicateIds.Add(mod.Manifest.UniqueID)) + continue; // already logged - // log message - this.Monitor.Log(message, LogLevel.Error); - if (mod.ErrorDetails != null) - this.Monitor.Log($" ({mod.ErrorDetails})"); - } + message = $" - {mod.DisplayName} because {mod.Error}"; + } - // group mods - List skippedDependencies = new List(); - List otherSkippedMods = new List(); - { - // track broken dependencies - HashSet skippedDependencyIds = new HashSet(StringComparer.OrdinalIgnoreCase); - HashSet skippedModIds = new HashSet(from mod in skippedMods where mod.HasID() select mod.Manifest.UniqueID, StringComparer.OrdinalIgnoreCase); - foreach (IModMetadata mod in skippedMods) - { - foreach (string requiredId in skippedModIds.Intersect(mod.GetRequiredModIds())) - skippedDependencyIds.Add(requiredId); - } + // log message + this.Monitor.Log(message, LogLevel.Error); + if (mod.ErrorDetails != null) + this.Monitor.Log($" ({mod.ErrorDetails})"); + } - // collect mod groups - foreach (IModMetadata mod in skippedMods) - { - if (mod.HasID() && skippedDependencyIds.Contains(mod.Manifest.UniqueID)) - skippedDependencies.Add(mod); - else - otherSkippedMods.Add(mod); + this.Monitor.Newline(); } } - - // log skipped mods - this.Monitor.Log(" Skipped mods", LogLevel.Error); - this.Monitor.Log(" " + "".PadRight(50, '-'), LogLevel.Error); - this.Monitor.Log(" These mods could not be added to your game.", LogLevel.Error); - this.Monitor.Newline(); - - if (skippedDependencies.Any()) - { - foreach (IModMetadata mod in skippedDependencies.OrderBy(p => p.DisplayName)) - LogSkippedMod(mod); - this.Monitor.Newline(); - } - - foreach (IModMetadata mod in otherSkippedMods.OrderBy(p => p.DisplayName)) - LogSkippedMod(mod); - this.Monitor.Newline(); } // log warnings @@ -561,6 +532,92 @@ namespace StardewModdingAPI.Framework.Logging } } + /// Group failed mods by the priority players should update them, where mods in earlier groups are more likely to fix multiple mods. + /// The failed mods to group. + private IEnumerable> GroupFailedModsByPriority(IList failedMods) + { + var failedOthers = failedMods.ToList(); + var skippedModIds = new HashSet(from mod in failedMods where mod.HasID() select mod.Manifest.UniqueID, StringComparer.OrdinalIgnoreCase); + + // group B: dependencies which failed + var failedOtherDependencies = new List(); + { + // get failed dependency IDs + var skippedDependencyIds = new HashSet(StringComparer.OrdinalIgnoreCase); + foreach (IModMetadata mod in failedMods) + { + foreach (string requiredId in skippedModIds.Intersect(mod.GetRequiredModIds())) + skippedDependencyIds.Add(requiredId); + } + + // group matching mods + this.FilterThrough( + fromList: failedOthers, + toList: failedOtherDependencies, + match: mod => mod.HasID() && skippedDependencyIds.Contains(mod.Manifest.UniqueID) + ); + } + + // group A: failed root dependencies which other dependencies need + var failedRootDependencies = new List(); + { + var skippedDependencyIds = new HashSet(failedOtherDependencies.Select(p => p.Manifest.UniqueID)); + this.FilterThrough( + fromList: failedOtherDependencies, + toList: failedRootDependencies, + match: mod => + { + // has no failed dependency + foreach (string requiredId in mod.GetRequiredModIds()) + { + if (skippedDependencyIds.Contains(requiredId)) + return false; + } + + // another dependency depends on this mod + bool isDependedOn = false; + foreach (IModMetadata other in failedOtherDependencies) + { + if (other.HasRequiredModId(mod.Manifest.UniqueID, includeOptional: false)) + { + isDependedOn = true; + break; + } + } + + return isDependedOn; + } + ); + } + + // return groups + return new[] + { + failedRootDependencies, + failedOtherDependencies, + failedOthers + }; + } + + /// Filter matching items from one list and add them to the other. + /// The list item type. + /// The list to filter. + /// The list to which to add filtered items. + /// Matches items to filter through. + private void FilterThrough(IList fromList, IList toList, Func match) + { + for (int i = 0; i < fromList.Count; i++) + { + TItem item = fromList[i]; + if (match(item)) + { + toList.Add(item); + fromList.RemoveAt(i); + i--; + } + } + } + /// Write a mod warning group to the console and log. /// The mods to search. /// Matches mods to include in the warning group. diff --git a/src/SMAPI/Framework/ModLoading/ModMetadata.cs b/src/SMAPI/Framework/ModLoading/ModMetadata.cs index b4de3d6c..0d89fd20 100644 --- a/src/SMAPI/Framework/ModLoading/ModMetadata.cs +++ b/src/SMAPI/Framework/ModLoading/ModMetadata.cs @@ -19,6 +19,9 @@ namespace StardewModdingAPI.Framework.ModLoading /// The non-error issues with the mod, including warnings suppressed by the data record. private ModWarning ActualWarnings = ModWarning.None; + /// The mod IDs which are listed as a requirement by this mod. The value for each pair indicates whether the dependency is required (i.e. not an optional dependency). + private Lazy> Dependencies; + /********* ** Accessors @@ -100,6 +103,8 @@ namespace StardewModdingAPI.Framework.ModLoading this.Manifest = manifest; this.DataRecord = dataRecord; this.IsIgnored = isIgnored; + + this.Dependencies = new Lazy>(this.ExtractDependencies); } /// @@ -199,23 +204,21 @@ namespace StardewModdingAPI.Framework.ModLoading } /// - public IEnumerable GetRequiredModIds(bool includeOptional = false) + public bool HasRequiredModId(string modId, bool includeOptional) { - HashSet required = new HashSet(StringComparer.OrdinalIgnoreCase); + return + this.Dependencies.Value.TryGetValue(modId, out bool isRequired) + && (includeOptional || isRequired); + } - // yield dependencies - if (this.Manifest?.Dependencies != null) + /// + public IEnumerable GetRequiredModIds(bool includeOptional = false) + { + foreach (var pair in this.Dependencies.Value) { - foreach (var entry in this.Manifest?.Dependencies) - { - if ((entry.IsRequired || includeOptional) && required.Add(entry.UniqueID)) - yield return entry.UniqueID; - } + if (includeOptional || pair.Value) + yield return pair.Key; } - - // yield content pack parent - if (this.Manifest?.ContentPackFor?.UniqueID != null && required.Add(this.Manifest.ContentPackFor.UniqueID)) - yield return this.Manifest.ContentPackFor.UniqueID; } /// @@ -237,5 +240,29 @@ namespace StardewModdingAPI.Framework.ModLoading string rootFolderName = Path.GetFileName(this.RootPath) ?? ""; return Path.Combine(rootFolderName, this.RelativeDirectoryPath); } + + + /********* + ** Private methods + *********/ + /// Extract mod IDs from the manifest that must be installed to load this mod. + /// Returns a dictionary of mod ID => is required (i.e. not an optional dependency). + public IDictionary ExtractDependencies() + { + var ids = new Dictionary(StringComparer.OrdinalIgnoreCase); + + // yield dependencies + if (this.Manifest?.Dependencies != null) + { + foreach (var entry in this.Manifest?.Dependencies) + ids[entry.UniqueID] = entry.IsRequired; + } + + // yield content pack parent + if (this.Manifest?.ContentPackFor?.UniqueID != null) + ids[this.Manifest.ContentPackFor.UniqueID] = true; + + return ids; + } } } -- cgit From 222183c651c5b5d9e402db1b8009e2e0a0681b06 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 4 Apr 2021 11:37:11 -0400 Subject: standardize spelling of 'macOS' --- build/common.targets | 2 +- build/find-game-folder.targets | 2 +- build/prepare-install-package.targets | 8 +-- docs/README.md | 6 +-- docs/release-notes-archived.md | 62 +++++++++++----------- docs/release-notes.md | 13 ++--- docs/technical/mod-package.md | 12 ++--- docs/technical/smapi.md | 12 ++--- src/SMAPI.Installer/Framework/InstallerContext.cs | 2 +- src/SMAPI.Installer/Framework/InstallerPaths.cs | 6 +-- src/SMAPI.Installer/InteractiveInstaller.cs | 18 +++---- src/SMAPI.Installer/assets/README.txt | 9 ++-- src/SMAPI.Installer/assets/unix-install.sh | 2 +- .../ConsoleWriting/ColorfulConsoleWriter.cs | 2 +- src/SMAPI.Mods.SaveBackup/ModEntry.cs | 4 +- src/SMAPI.Tests/Utilities/PathUtilitiesTests.cs | 2 +- .../Framework/Clients/WebApi/WebApiClient.cs | 2 +- .../Framework/GameScanning/GameScanner.cs | 2 +- .../Framework/LowLevelEnvironmentUtility.cs | 8 +-- src/SMAPI.Toolkit/Framework/ModData/ModWarning.cs | 2 +- .../Framework/ModScanning/ModScanner.cs | 4 +- src/SMAPI.Toolkit/Utilities/Platform.cs | 2 +- src/SMAPI.Web/Startup.cs | 2 +- src/SMAPI.Web/Views/Index/Index.cshtml | 2 +- src/SMAPI.Web/Views/LogParser/Index.cshtml | 2 +- src/SMAPI.Web/wwwroot/SMAPI.metadata.json | 2 +- src/SMAPI/Constants.cs | 2 +- src/SMAPI/Framework/Content/AssetDataForImage.cs | 4 +- src/SMAPI/Framework/ContentPack.cs | 2 +- src/SMAPI/Framework/Logging/LogFileManager.cs | 2 +- src/SMAPI/Framework/Logging/LogManager.cs | 2 +- .../ModLoading/InstructionHandleResult.cs | 2 +- .../ModLoading/RewriteFacades/SpriteBatchFacade.cs | 4 +- src/SMAPI/Framework/SCore.cs | 4 +- .../Framework/Serialization/ColorConverter.cs | 2 +- .../Framework/Serialization/PointConverter.cs | 2 +- .../Framework/Serialization/RectangleConverter.cs | 2 +- .../Framework/Serialization/Vector2Converter.cs | 2 +- src/SMAPI/GamePlatform.cs | 2 +- src/SMAPI/SMAPI.config.json | 4 +- 40 files changed, 114 insertions(+), 112 deletions(-) diff --git a/build/common.targets b/build/common.targets index 8137a6f3..4068c491 100644 --- a/build/common.targets +++ b/build/common.targets @@ -77,6 +77,6 @@ $(GamePath) - + diff --git a/build/find-game-folder.targets b/build/find-game-folder.targets index ec8a3787..7a9bfc50 100644 --- a/build/find-game-folder.targets +++ b/build/find-game-folder.targets @@ -13,7 +13,7 @@ $(HOME)/.local/share/Steam/steamapps/common/Stardew Valley $(HOME)/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Stardew Valley - + /Applications/Stardew Valley.app/Contents/MacOS $(HOME)/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS diff --git a/build/prepare-install-package.targets b/build/prepare-install-package.targets index 205040db..408230a9 100644 --- a/build/prepare-install-package.targets +++ b/build/prepare-install-package.targets @@ -33,7 +33,7 @@ - + @@ -74,13 +74,13 @@ - + - + - + diff --git a/docs/README.md b/docs/README.md index 4726c190..e7b8a9b3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -11,9 +11,9 @@ doesn't change any of your game files. It serves seven main purposes: couldn't._ 3. **Rewrite mods for compatibility.** - _SMAPI rewrites mods' compiled code before loading them so they work on Linux/Mac/Windows - without the mods needing to handle differences between the Linux/Mac and Windows versions of the - game. In some cases it also rewrites code broken by a game update so the mod doesn't break._ + _SMAPI rewrites mods' compiled code before loading them so they work on Linux/macOS/Windows + without the mods needing to handle differences between the Linux/macOS and Windows versions of + the game. In some cases it also rewrites code broken by a game update so the mod doesn't break._ 5. **Intercept errors and automatically fix saves.** _SMAPI intercepts errors, shows the error info in the SMAPI console, and in most cases diff --git a/docs/release-notes-archived.md b/docs/release-notes-archived.md index b5dd538b..9801c226 100644 --- a/docs/release-notes-archived.md +++ b/docs/release-notes-archived.md @@ -30,7 +30,7 @@ Released 13 September 2019 for Stardew Valley 1.3.36. Released 23 April 2019 for Stardew Valley 1.3.36. * For players: - * Fixed error when a custom map references certain vanilla tilesheets on Linux/Mac. + * Fixed error when a custom map references certain vanilla tilesheets on Linux/macOS. * Fixed compatibility with some Linux distros. ## 2.11.1 @@ -68,7 +68,7 @@ Released 09 January 2019 for Stardew Valley 1.3.32–33. * For players: * SMAPI now keeps the first save backup created for the day, instead of the last one. - * Fixed save backup for some Linux/Mac players. (When compression isn't available, SMAPI will now create uncompressed backups instead.) + * Fixed save backup for some Linux/macOS players. (When compression isn't available, SMAPI will now create uncompressed backups instead.) * Fixed some common dependencies not linking to the mod page in 'missing mod' errors. * Fixed 'unknown mod' deprecation warnings showing a stack trace when developers mode not enabled. * Fixed 'unknown mod' deprecation warnings when they occur in the Mod constructor. @@ -90,7 +90,7 @@ Released 09 January 2019 for Stardew Valley 1.3.32–33. * Fixed 'unknown mod' deprecation warnings showing the wrong stack trace. * Fixed `e.Cursor` in input events showing wrong grab tile when player using a controller moves without moving the viewpoint. * Fixed incorrect 'bypassed safety checks' warning for mods using the new `Specialized.LoadStageChanged` event in 2.10. - * Deprecated `EntryDll` values whose capitalization don't match the actual file. (This works on Windows, but causes errors for Linux/Mac players.) + * Deprecated `EntryDll` values whose capitalization don't match the actual file. (This works on Windows, but causes errors for Linux/macOS players.) ## 2.10.1 Released 30 December 2018 for Stardew Valley 1.3.32–33. @@ -183,7 +183,7 @@ Released 07 December 2018 for Stardew Valley 1.3.32. ## 2.8.2 Released 19 November 2018 for Stardew Valley 1.3.32. -* Fixed game crash in MacOS with SMAPI 2.8. +* Fixed game crash in macOS with SMAPI 2.8. ## 2.8.1 Released 19 November 2018 for Stardew Valley 1.3.32. @@ -205,7 +205,7 @@ Released 19 November 2018 for Stardew Valley 1.3.32. * SMAPI now recommends a compatible SMAPI version if you have an older game version. * Improved various error messages to be more clear and intuitive. * Improved compatibility with various Linux shells (thanks to lqdev!), and prefer xterm when available. - * Fixed transparency issues on Linux/Mac for some mod images. + * Fixed transparency issues on Linux/macOS for some mod images. * Fixed error when a mod manifest is corrupted. * Fixed error when a mod adds an unnamed location. * Fixed friendly error no longer shown when SMAPI isn't run from the game folder. @@ -223,7 +223,7 @@ Released 19 November 2018 for Stardew Valley 1.3.32. * The log parser now has a separate filter for game messages. * The log parser now shows content pack authors (thanks to danvolchek!). * Tweaked log parser UI (thanks to danvolchek!). - * Fixed log parser instructions for Mac. + * Fixed log parser instructions for macOS. * For mod authors: * Added [data API](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Data) to store mod data in the save file or app data. @@ -267,7 +267,7 @@ Released 14 August 2018 for Stardew Valley 1.3.28. * Improved how mod issues are listed in the console and log. * Revamped installer. It now... * uses a new format that should be more intuitive; - * lets players on Linux/Mac choose the console color scheme (SMAPI will auto-detect it on Windows); + * lets players on Linux/macOS choose the console color scheme (SMAPI will auto-detect it on Windows); * and validates requirements earlier. * Fixed custom festival maps always using spring tilesheets. * Fixed `player_add` command not recognising return scepter. @@ -314,8 +314,8 @@ Released 01 August 2018 for Stardew Valley 1.3.27. * Removed the `player_setlevel` and `player_setspeed` commands, which weren't implemented in a useful way. Use a mod like CJB Cheats Menu if you need those. * Fixed `SEHException` errors for some players. * Fixed performance issues for some players. - * Fixed default color scheme on Mac or in PowerShell (configurable via `StardewModdingAPI.config.json`). - * Fixed installer error on Linux/Mac in some cases. + * Fixed default color scheme on macOS or in PowerShell (configurable via `StardewModdingAPI.config.json`). + * Fixed installer error on Linux/macOS in some cases. * Fixed installer not finding some game paths or showing duplicate paths. * Fixed installer not removing some SMAPI files. * Fixed launch issue for Linux players with some terminals. (Thanks to HanFox and kurumushi!) @@ -345,7 +345,7 @@ Released 01 August 2018 for Stardew Valley 1.3.27. * each event now provides a list of added/removed values; * added buildings-changed event. * Added `Context.IsMultiplayer` and `Context.IsMainPlayer` flags. - * Added `Constants.TargetPlatform` which says whether the game is running on Linux, Mac, or Windows. + * Added `Constants.TargetPlatform` which says whether the game is running on Linux, macOS, or Windows. * Added `semanticVersion.IsPrerelease()` method. * Added support for launching multiple instances transparently. This removes the former `--log-path` command-line argument. * Added support for custom seasonal tilesheets when loading an unpacked `.tbin` map. @@ -376,7 +376,7 @@ Released 01 August 2018 for Stardew Valley 1.3.27. * Mod IDs should only contain letters, numbers, hyphens, dots, and underscores. That allows their use in many contexts like URLs. This restriction is now enforced. (In regex form: `^[a-zA-Z0-9_.-]+$`.) * For SMAPI developers: - * Added more consistent crossplatform handling, including MacOS detection. + * Added more consistent crossplatform handling, including macOS detection. * Added beta update channel. * Added optional mod metadata to the web API (including Nexus info, wiki metadata, etc). * Added early prototype of SMAPI 3.0 events via `helper.Events`. @@ -411,7 +411,7 @@ Released 26 March 2018 for Stardew Valley 1.2.30–1.2.33. * For players: * Fixed some textures not updated when a mod changes them. - * Fixed visual bug on Linux/Mac when mods overlay textures. + * Fixed visual bug on Linux/macOS when mods overlay textures. * Fixed error when mods remove an asset editor/loader. * Fixed minimum game version incorrectly increased in SMAPI 2.5.3. @@ -467,9 +467,9 @@ Released 24 February 2018 for Stardew Valley 1.2.30–1.2.33. * **Added support for [content packs](https://stardewvalleywiki.com/Modding:Content_packs)**. _Content packs are collections of files for a SMAPI mod to load. These can be installed directly under `Mods` like a normal SMAPI mod, get automatic update and compatibility checks, and provide convenient APIs to the mods that read them._ * Added mod detection for unhandled errors (so most errors now mention which mod caused them). - * Added install scripts for Linux/Mac (no more manual terminal commands!). + * Added install scripts for Linux/macOS (no more manual terminal commands!). * Added the missing mod's name and URL to dependency errors. - * Fixed uninstall script not reporting when done on Linux/Mac. + * Fixed uninstall script not reporting when done on Linux/macOS. * Updated compatibility list and enabled update checks for more mods. * For mod authors: @@ -524,7 +524,7 @@ Released 26 December 2017 for Stardew Valley 1.2.30–1.2.33. * For players: * Added a user-friendly [download page](https://smapi.io). - * Improved cryptic libgdiplus errors on Mac when Mono isn't installed. + * Improved cryptic libgdiplus errors on macOS when Mono isn't installed. * Fixed mod UIs hidden when menu backgrounds are enabled. * For mod authors: @@ -545,9 +545,9 @@ Released 26 December 2017 for Stardew Valley 1.2.30–1.2.33. Released 02 December 2017 for Stardew Valley 1.2.30–1.2.33. * For players: - * Fixed error when a mod loads custom assets on Linux/Mac. - * Fixed error when checking for updates on Linux/Mac due to API HTTPS redirect. - * Fixed error when Mac adds an `mcs` symlink to the installer package. + * Fixed error when a mod loads custom assets on Linux/macOS. + * Fixed error when checking for updates on Linux/macOS due to API HTTPS redirect. + * Fixed error when macOS adds an `mcs` symlink to the installer package. * Fixed `player_add` command not handling tool upgrade levels. * Improved error when a mod has an invalid `EntryDLL` filename format. * Updated compatibility list. @@ -651,7 +651,7 @@ For players: * The console is now simpler and easier to read, and adjusts its colors to fit your terminal background color. * Renamed installer folder to avoid confusion. * Updated compatibility list. -* Fixed update check errors on Linux/Mac. +* Fixed update check errors on Linux/macOS. * Fixed collection-changed errors during startup for some players. For mod developers: @@ -685,7 +685,7 @@ For SMAPI developers: Released 09 September 2017 for Stardew Valley 1.2.30–1.2.33. For players: -* Fixed errors when loading some custom maps on Linux/Mac or using XNB Loader. +* Fixed errors when loading some custom maps on Linux/macOS or using XNB Loader. * Fixed errors in rare cases when a mod calculates an in-game date. For mod authors: @@ -772,7 +772,7 @@ For players: * you have Stardew Valley 1.11 or earlier (which aren't compatible); * you run `install.exe` from within the downloaded zip file. * Fixed "unknown mod" deprecation warnings by improving how SMAPI detects the mod using the event. -* Fixed `libgdiplus.dylib` errors for some players on Mac. +* Fixed `libgdiplus.dylib` errors for some players on macOS. * Fixed rare crash when window loses focus for a few players. * Bumped minimum game version to 1.2.30. * Updated mod compatibility list. @@ -805,8 +805,8 @@ For players: * SMAPI now recovers automatically from errors in the game loop when possible. * SMAPI now remembers if your game crashed and offers help next time you launch it. * Fixed installer sometimes finding redundant game paths. -* Fixed save events not being raised after the first day on Linux/Mac. -* Fixed error on Linux/Mac when a mod loads a PNG immediately after the save is loaded. +* Fixed save events not being raised after the first day on Linux/macOS. +* Fixed error on Linux/macOS when a mod loads a PNG immediately after the save is loaded. * Updated mod compatibility list for Stardew Valley 1.2. For mod developers: @@ -826,15 +826,15 @@ Released 03 May 2017 for Stardew Valley 1.2.26–1.2.29. For players: * The installer now lets you choose the install path if you have multiple copies of the game, instead of using the first path found. * Fixed mod draw errors breaking the game. -* Fixed mods on Linux/Mac no longer working after the game saves. -* Fixed `libgdiplus.dylib` errors on Mac when mods read PNG files. +* Fixed mods on Linux/macOS no longer working after the game saves. +* Fixed `libgdiplus.dylib` errors on macOS when mods read PNG files. * Adopted pufferchick. For mod developers: * Unknown mod manifest fields are now stored in `IManifest::ExtraFields`. * The content API now defaults to `ContentSource.ModFolder`. * Fixed content API error when loading a PNG during early game init (e.g. in mod's `Entry`). -* Fixed content API error when loading an XNB from the mod folder on Mac. +* Fixed content API error when loading an XNB from the mod folder on macOS. ## 1.11 Released 30 April 2017 for Stardew Valley 1.2.26. @@ -888,7 +888,7 @@ For players: * Fixed the game-needs-an-update error not pausing before exit. * Fixed installer errors for some players when deleting files. * Fixed installer not ignoring potential game folders that don't contain a Stardew Valley exe. -* Fixed installer not recognising Linux/Mac paths starting with `~/` or containing an escaped space. +* Fixed installer not recognising Linux/macOS paths starting with `~/` or containing an escaped space. * Fixed TrainerMod letting you add invalid items which may crash the game. * Fixed TrainerMod's `world_downminelevel` command not working. * Fixed rare issue where mod dependencies would override SMAPI dependencies and cause unpredictable bugs. @@ -912,7 +912,7 @@ For mod developers: * Removed the experimental `IConfigFile`. For SMAPI developers: -* Added support for debugging SMAPI on Linux/Mac if supported by the editor. +* Added support for debugging SMAPI on Linux/macOS if supported by the editor. ## 1.8 Released 04 February 2017 for Stardew Valley 1.1–1.11. @@ -1004,7 +1004,7 @@ For players: * Improved installer wording to reduce confusion. * Fixed the installer not removing TrainerMod from appdata if it's already in the game mods directory. * Fixed the installer not moving mods out of appdata if the game isn't installed on the same Windows partition. - * Fixed the SMAPI console not being shown on Linux and Mac. + * Fixed the SMAPI console not being shown on Linux and macOS. For developers: * Added a reflection API (via `helper.Reflection`) that simplifies robust access to the game's private fields and methods. @@ -1016,7 +1016,7 @@ For developers: Released 04 December 2016 for Stardew Valley 1.1–1.11. For players: - * You can now run most mods on any platform (e.g. run Windows mods on Linux/Mac). + * You can now run most mods on any platform (e.g. run Windows mods on Linux/macOS). * Fixed the normal uninstaller not removing files added by the 'SMAPI for developers' installer. ## 1.2 @@ -1063,7 +1063,7 @@ For developers: Released 11 November 2016 for Stardew Valley 1.1–1.11. For players: - * Added support for Linux and Mac. + * Added support for Linux and macOS. * Added installer to automate adding & removing SMAPI. * Added background update check on launch. * Fixed missing `steam_appid.txt` file. diff --git a/docs/release-notes.md b/docs/release-notes.md index 2ed46af1..cb0be542 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -13,6 +13,7 @@ * On macOS, the `StardewModdingAPI.bin.osx` file is no longer overwritten if it's identical to avoid resetting file permissions (thanks to 007wayne!). * Fixed error for non-English players after returning to title, reloading, and entering town with a completed movie theater. * Fixed `world_clear` console command not removing resource clumps outside the farm and secret woods. + * Fixed inconsistent spelling/style for 'macOS'. * Internal changes to prepare for unofficial 64-bit. * For modders: @@ -247,7 +248,7 @@ Released 03 October 2020 for Stardew Valley 1.4.1 or later. Released 16 September 2020 for Stardew Valley 1.4.1 or later. * For players: - * Fixed errors on Linux/Mac due to content packs with incorrect filename case. + * Fixed errors on Linux/macOS due to content packs with incorrect filename case. * Fixed map rendering crash due to conflict between SMAPI and PyTK. * Fixed error in heuristically-rewritten mods in rare cases (thanks to collaboration with ZaneYork!). @@ -291,7 +292,7 @@ Released 07 September 2020 for Stardew Valley 1.4.1 or later. See [release highl * For mod authors: * Added `PathUtilities` to simplify working with file/asset names. * You can now read/write `SDate` values to JSON (e.g. for `config.json`, network mod messages, etc). - * Fixed asset propagation not updating title menu buttons immediately on Linux/Mac. + * Fixed asset propagation not updating title menu buttons immediately on Linux/macOS. * For the web UI: * Updated the JSON validator/schema for Content Patcher 1.16 and 1.17. @@ -336,7 +337,7 @@ Released 20 June 2020 for Stardew Valley 1.4.1 or later. See [release highlights * Added experimental option to reduce startup time when loading mod DLLs (thanks to ZaneYork!). Enable `RewriteInParallel` in the `smapi-internal/config.json` to try it. * Reduced processing time when a mod loads many unpacked images (thanks to Entoarox!). * Mod load warnings are now listed alphabetically. - * MacOS files starting with `._` are now ignored and can no longer cause skipped mods. + * macOS files starting with `._` are now ignored and can no longer cause skipped mods. * Simplified paranoid warning logs and reduced their log level. * Fixed black maps on Android for mods which use `.tmx` files. * Fixed `BadImageFormatException` error detection. @@ -392,7 +393,7 @@ Released 27 April 2020 for Stardew Valley 1.4.1 or later. See [release highlight * Added `SDate` fields/methods: `SeasonIndex`, `FromDaysSinceStart`, `FromWorldDate`, `ToWorldDate`, and `ToLocaleString` (thanks to kdau!). * Added `SDate` translations taken from the Lookup Anything mod.¹ * Fixed asset propagation for certain maps loaded through temporary content managers. This notably fixes unreliable patches to the farmhouse and town maps. - * Fixed asset propagation on Linux/Mac for monster sprites, NPC dialogue, and NPC schedules. + * Fixed asset propagation on Linux/macOS for monster sprites, NPC dialogue, and NPC schedules. * Fixed asset propagation for NPC dialogue sometimes causing a spouse to skip marriage dialogue or not allow kisses. ¹ Date format translations were taken from the Lookup Anything mod; thanks to translators FixThisPlz (improved Russian), LeecanIt (added Italian), pomepome (added Japanese), S2SKY (added Korean), Sasara (added German), SteaNN (added Russian), ThomasGabrielDelavault (added Spanish), VincentRoth (added French), Yllelder (improved Spanish), and yuwenlan (added Chinese). Some translations for Korean, Hungarian, and Turkish were derived from the game translations. @@ -408,7 +409,7 @@ Released 24 March 2020 for Stardew Valley 1.4.1 or later. Released 22 March 2020 for Stardew Valley 1.4.1 or later. See [release highlights](https://www.patreon.com/posts/35161371). * For players: - * Fixed semi-transparency issues on Linux/Mac in recent versions of Mono (e.g. pink shadows). + * Fixed semi-transparency issues on Linux/macOS in recent versions of Mono (e.g. pink shadows). * Fixed `player_add` command error if you have broken XNB mods. * Removed invalid-location check now handled by the game. * Updated translations. Thanks to Annosz (added Hungarian)! @@ -450,7 +451,7 @@ Released 22 February 2020 for Stardew Valley 1.4.1 or later. See [release highli * Updated translations. Thanks to xCarloC (added Italian)! * For the Save Backup mod: - * Fixed warning on MacOS when you have no saves yet. + * Fixed warning on macOS when you have no saves yet. * Reduced log messages. * For the web UI: diff --git a/docs/technical/mod-package.md b/docs/technical/mod-package.md index 8c9c59fb..6d04722c 100644 --- a/docs/technical/mod-package.md +++ b/docs/technical/mod-package.md @@ -1,7 +1,7 @@ ← [SMAPI](../README.md) The **mod build package** is an open-source NuGet package which automates the MSBuild configuration -for SMAPI mods and related tools. The package is fully compatible with Linux, Mac, and Windows. +for SMAPI mods and related tools. The package is fully compatible with Linux, macOS, and Windows. ## Contents * [Use](#use) @@ -33,7 +33,7 @@ change how these work): * **Add assembly references:** The package adds assembly references to SMAPI, Stardew Valley, xTile, and the game framework - (MonoGame on Linux/Mac, XNA Framework on Windows). It automatically adjusts depending on which OS + (MonoGame on Linux/macOS, XNA Framework on Windows). It automatically adjusts depending on which OS you're compiling it on. If you use [Harmony](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Harmony), it can optionally add a reference to that too. @@ -55,7 +55,7 @@ change how th