From c526807c229d1ec8f43c7080314b50a69ae971a5 Mon Sep 17 00:00:00 2001 From: Tobey Blaber Date: Thu, 6 Aug 2020 13:35:18 +0100 Subject: [PATCH 1/2] Updated the logging of RequiredMods with Debug Logs enabled so as not to throw errors. Yes @PrimeSonic, I know it uses LINQ, but it also means its less code-reproduction, and its only on load, and only if Debug Logs are enabled... Take the performance cost :P --- QModManager/Patching/ManifestValidator.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/QModManager/Patching/ManifestValidator.cs b/QModManager/Patching/ManifestValidator.cs index dd583f77..d063f002 100644 --- a/QModManager/Patching/ManifestValidator.cs +++ b/QModManager/Patching/ManifestValidator.cs @@ -61,10 +61,10 @@ public void ValidateManifest(QMod mod) mod.SupportedGame = QModGame.Subnautica; break; default: - { - mod.Status = ModStatus.FailedIdentifyingGame; - return; - } + { + mod.Status = ModStatus.FailedIdentifyingGame; + return; + } } try @@ -144,19 +144,20 @@ public void CheckRequiredMods(QMod mod) } mod.RequiredMods = requiredMods.Values; + if (Logger.DebugLogsEnabled) { string GetModList(IEnumerable modIds) { - string message = string.Empty; + string modList = string.Empty; foreach (var id in modIds) - message += $"{id} "; + modList += $"{id} "; - return message; + return modList; } if (requiredMods.Count > 0) - Logger.Debug($"{mod.Id} has required mods: {GetModList(requiredMods.Values.Cast())}"); + Logger.Debug($"{mod.Id} has required mods: {GetModList(mod.RequiredMods.Select(mod => mod.Id))}"); if (mod.LoadBeforePreferences.Count > 0) Logger.Debug($"{mod.Id} should load before: {GetModList(mod.LoadBeforePreferences)}"); From 792bfa8c61eab9f21fc6600f48a395590929761e Mon Sep 17 00:00:00 2001 From: Tobey Blaber Date: Thu, 6 Aug 2020 13:38:00 +0100 Subject: [PATCH 2/2] Revert accidental formatting change --- QModManager/Patching/ManifestValidator.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/QModManager/Patching/ManifestValidator.cs b/QModManager/Patching/ManifestValidator.cs index d063f002..4cf550fc 100644 --- a/QModManager/Patching/ManifestValidator.cs +++ b/QModManager/Patching/ManifestValidator.cs @@ -61,10 +61,10 @@ public void ValidateManifest(QMod mod) mod.SupportedGame = QModGame.Subnautica; break; default: - { - mod.Status = ModStatus.FailedIdentifyingGame; - return; - } + { + mod.Status = ModStatus.FailedIdentifyingGame; + return; + } } try