From f95292953f95ec71071fce7a6438a5403dc85816 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 30 Dec 2020 19:38:48 -0500 Subject: fix repeated mods in 'skipped mods' section of console --- src/SMAPI/Framework/Logging/LogManager.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/SMAPI/Framework/Logging') diff --git a/src/SMAPI/Framework/Logging/LogManager.cs b/src/SMAPI/Framework/Logging/LogManager.cs index ee013a85..4a8019af 100644 --- a/src/SMAPI/Framework/Logging/LogManager.cs +++ b/src/SMAPI/Framework/Logging/LogManager.cs @@ -425,9 +425,11 @@ namespace StardewModdingAPI.Framework.Logging this.Monitor.Log($" ({mod.ErrorDetails})"); } - // find skipped dependencies - IModMetadata[] skippedDependencies; + // 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) @@ -435,7 +437,15 @@ namespace StardewModdingAPI.Framework.Logging foreach (string requiredId in skippedModIds.Intersect(mod.GetRequiredModIds())) skippedDependencyIds.Add(requiredId); } - skippedDependencies = skippedMods.Where(p => p.HasID() && skippedDependencyIds.Contains(p.Manifest.UniqueID)).ToArray(); + + // collect mod groups + foreach (IModMetadata mod in skippedMods) + { + if (mod.HasID() && skippedDependencyIds.Contains(mod.Manifest.UniqueID)) + skippedDependencies.Add(mod); + else + otherSkippedMods.Add(mod); + } } // log skipped mods @@ -451,7 +461,7 @@ namespace StardewModdingAPI.Framework.Logging this.Monitor.Newline(); } - foreach (IModMetadata mod in skippedMods.OrderBy(p => p.DisplayName)) + foreach (IModMetadata mod in otherSkippedMods.OrderBy(p => p.DisplayName)) LogSkippedMod(mod); this.Monitor.Newline(); } -- cgit From 68bcf28e6cd92dd843c2e461ccca74c0b432f1e6 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 2 Jan 2021 18:22:30 -0500 Subject: update error text linking to renamed wiki section --- docs/release-notes.md | 1 + src/SMAPI/Framework/Logging/LogManager.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/SMAPI/Framework/Logging') diff --git a/docs/release-notes.md b/docs/release-notes.md index ecad1635..9fbfcbb3 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -13,6 +13,7 @@ * On Linux, the SMAPI installer now auto-detects flatpak Steam paths. * Fixed errors when multiple players join in split-screen mode. * Fixed 'skipped mods' section repeating mods in some cases. + * Fixed out-of-date error text. * For modders: * When a mod is blocked by SMAPI's internal compatibility list, the `TRACE` messages while loading it now indicates that and specifies the reason. diff --git a/src/SMAPI/Framework/Logging/LogManager.cs b/src/SMAPI/Framework/Logging/LogManager.cs index 4a8019af..e504218b 100644 --- a/src/SMAPI/Framework/Logging/LogManager.cs +++ b/src/SMAPI/Framework/Logging/LogManager.cs @@ -46,7 +46,7 @@ namespace StardewModdingAPI.Framework.Logging search: new Regex(@"^System\.InvalidOperationException: Steamworks is not initialized\.[\s\S]+$", RegexOptions.Compiled | RegexOptions.CultureInvariant), replacement: #if SMAPI_FOR_WINDOWS - "Oops! Steam achievements won't work because Steam isn't loaded. You can launch the game through Steam to fix that (see 'Part 2: Configure Steam' in the install guide for more info: https://smapi.io/install).", + "Oops! Steam achievements won't work because Steam isn't loaded. See 'Launch SMAPI through Steam or GOG Galaxy' in the install guide for more info: https://smapi.io/install.", #else "Oops! Steam achievements won't work because Steam isn't loaded. You can launch the game through Steam to fix that.", #endif -- cgit