From 896ad4857ed8bdc6d39e43ad3915043224ee575b Mon Sep 17 00:00:00 2001 From: Frog Date: Sat, 18 Jul 2026 04:18:41 -0700 Subject: [PATCH] Adjust Unlocker Scanning Logs - Adjusts the unlocker scanning logs to go to the correct destination - Adjusts the headers for some of the logs so logs are slightly more clear --- CreamInstaller/Forms/SelectForm.cs | 53 ++++++++++++++---------------- CreamInstaller/Selection.cs | 32 +++++++++--------- 2 files changed, 40 insertions(+), 45 deletions(-) diff --git a/CreamInstaller/Forms/SelectForm.cs b/CreamInstaller/Forms/SelectForm.cs index 0c2c7e4..811ac8e 100644 --- a/CreamInstaller/Forms/SelectForm.cs +++ b/CreamInstaller/Forms/SelectForm.cs @@ -1460,7 +1460,7 @@ internal sealed partial class SelectForm : CustomForm ProgramData.WriteExtraProtectionChoices(extraProtectionChoices); - // Detect installed unlockers and proxy DLLs from disk for all selections + // Detect installed unlockers, proxy DLLs, and read config files — grouped per-game foreach (Selection selection in Selection.All.Keys) { selection.InstalledUnlocker = selection.DetectInstalledUnlocker(); @@ -1472,42 +1472,37 @@ internal sealed partial class SelectForm : CustomForm selection.UseProxy = true; selection.Proxy = detectedProxy; } - } - } - - // Read config files for detected unlockers and adjust DLC enabled state accordingly - foreach (Selection selection in Selection.All.Keys) - { - if (selection.InstalledUnlocker == InstalledUnlocker.SmokeAPI) - { - foreach (string directory in selection.DllDirectories) + if (selection.InstalledUnlocker == InstalledUnlocker.SmokeAPI) { - var (enabledIds, disabledIds) = SmokeAPI.ReadConfigDlcIds(directory); - if (enabledIds is not null) // config was found and read + foreach (string directory in selection.DllDirectories) { - foreach (SelectionDLC dlc in selection.DLC) + var (enabledIds, disabledIds) = SmokeAPI.ReadConfigDlcIds(directory); + if (enabledIds is not null) // config was found and read { - if (enabledIds.Contains(dlc.Id)) - dlc.Enabled = true; - else if (disabledIds.Contains(dlc.Id)) - dlc.Enabled = false; - else - dlc.Enabled = false; // not in config at all + foreach (SelectionDLC dlc in selection.DLC) + { + if (enabledIds.Contains(dlc.Id)) + dlc.Enabled = true; + else if (disabledIds.Contains(dlc.Id)) + dlc.Enabled = false; + else + dlc.Enabled = false; // not in config at all + } + break; } - break; } } - } - else if (selection.InstalledUnlocker == InstalledUnlocker.CreamAPI) - { - foreach (string directory in selection.DllDirectories) + else if (selection.InstalledUnlocker == InstalledUnlocker.CreamAPI) { - HashSet enabledIds = CreamAPI.ReadConfigDlcIds(directory); - if (enabledIds is not null) + foreach (string directory in selection.DllDirectories) { - foreach (SelectionDLC dlc in selection.DLC) - dlc.Enabled = enabledIds.Contains(dlc.Id); - break; + HashSet enabledIds = CreamAPI.ReadConfigDlcIds(directory); + if (enabledIds is not null) + { + foreach (SelectionDLC dlc in selection.DLC) + dlc.Enabled = enabledIds.Contains(dlc.Id); + break; + } } } } diff --git a/CreamInstaller/Selection.cs b/CreamInstaller/Selection.cs index fd99a1e..5091f41 100644 --- a/CreamInstaller/Selection.cs +++ b/CreamInstaller/Selection.cs @@ -155,14 +155,14 @@ internal sealed class Selection : IEquatable out string smokeConfig, out _, out _, out _); if (smokeConfig.FileExists() || smokeOldConfig.FileExists()) { - ProgramData.Log.Info($"[Unlocker] SmokeAPI detected | Game: {Name} ({Id})", LogDestination.Scan); + ProgramData.Log.Info($"[Unlocker] SmokeAPI detected | Game: {Name} ({Id})", LogDestination.Unlocker); return InstalledUnlocker.SmokeAPI; } directory.GetCreamApiComponents(out _, out _, out _, out _, out string creamConfig); if (creamConfig.FileExists()) { - ProgramData.Log.Info($"[Unlocker] CreamAPI detected | Game: {Name} ({Id})", LogDestination.Scan); + ProgramData.Log.Info($"[Unlocker] CreamAPI detected | Game: {Name} ({Id})", LogDestination.Unlocker); ReadCreamApiConfig(creamConfig); return InstalledUnlocker.CreamAPI; } @@ -175,10 +175,10 @@ internal sealed class Selection : IEquatable if ((smokeApi32.FileExists() && smokeApi32.IsResourceFile(ResourceIdentifier.Steamworks32)) || (smokeApi64.FileExists() && smokeApi64.IsResourceFile(ResourceIdentifier.Steamworks64))) { - ProgramData.Log.Info($"[Unlocker] SmokeAPI detected (via _o files) | Game: {Name} ({Id})", LogDestination.Scan); + ProgramData.Log.Info($"[Unlocker] SmokeAPI detected (via _o files) | Game: {Name} ({Id})", LogDestination.Unlocker); return InstalledUnlocker.SmokeAPI; } - ProgramData.Log.Info($"[Unlocker] CreamAPI detected (via _o files) | Game: {Name} ({Id})", LogDestination.Scan); + ProgramData.Log.Info($"[Unlocker] CreamAPI detected (via _o files) | Game: {Name} ({Id})", LogDestination.Unlocker); return InstalledUnlocker.CreamAPI; } } @@ -189,7 +189,7 @@ internal sealed class Selection : IEquatable out _, out string config, out _, out _); if (config.FileExists() || api32_o.FileExists() || api64_o.FileExists()) { - ProgramData.Log.Info($"[Unlocker] ScreamAPI detected | Game: {Name} ({Id})", LogDestination.Scan); + ProgramData.Log.Info($"[Unlocker] ScreamAPI detected | Game: {Name} ({Id})", LogDestination.Unlocker); return InstalledUnlocker.ScreamAPI; } } @@ -200,14 +200,14 @@ internal sealed class Selection : IEquatable out string config, out _); if (config.FileExists() || api32_o.FileExists() || api64_o.FileExists()) { - ProgramData.Log.Info($"[Unlocker] UplayR1 detected | Game: {Name} ({Id})", LogDestination.Scan); + ProgramData.Log.Info($"[Unlocker] UplayR1 detected | Game: {Name} ({Id})", LogDestination.Unlocker); return InstalledUnlocker.UplayR1; } directory.GetUplayR2Components(out _, out _, out _, out api32_o, out _, out api64_o, out config, out _); if (config.FileExists() || api32_o.FileExists() || api64_o.FileExists()) { - ProgramData.Log.Info($"[Unlocker] UplayR2 detected | Game: {Name} ({Id})", LogDestination.Scan); + ProgramData.Log.Info($"[Unlocker] UplayR2 detected | Game: {Name} ({Id})", LogDestination.Unlocker); return InstalledUnlocker.UplayR2; } } @@ -220,7 +220,7 @@ internal sealed class Selection : IEquatable proxy.FileExists() && proxy.IsResourceFile(ResourceIdentifier.Koaloader)) || config.FileExists()) { - ProgramData.Log.Info($"[Unlocker] Koaloader detected | Game: {Name} ({Id})", LogDestination.Scan); + ProgramData.Log.Info($"[Unlocker] Koaloader detected | Game: {Name} ({Id})", LogDestination.Unlocker); return InstalledUnlocker.Koaloader; } @@ -229,33 +229,33 @@ internal sealed class Selection : IEquatable directory.GetSmokeApiComponents(out _, out _, out _, out _, out _, out string smokeConfig, out _, out _, out _); if (smokeConfig.FileExists()) { - ProgramData.Log.Info($"[Unlocker] SmokeAPI detected (proxy) | Game: {Name} ({Id})", LogDestination.Scan); + ProgramData.Log.Info($"[Unlocker] SmokeAPI detected (proxy) | Game: {Name} ({Id})", LogDestination.Unlocker); return InstalledUnlocker.SmokeAPI; } directory.GetCreamApiComponents(out _, out _, out _, out _, out string creamConfig); if (creamConfig.FileExists()) { - ProgramData.Log.Info($"[Unlocker] CreamAPI detected (proxy) | Game: {Name} ({Id})", LogDestination.Scan); + ProgramData.Log.Info($"[Unlocker] CreamAPI detected (proxy) | Game: {Name} ({Id})", LogDestination.Unlocker); return InstalledUnlocker.CreamAPI; } if (directory.GetSmokeApiProxies().Any(proxy => proxy.FileExists() && (proxy.IsResourceFile(ResourceIdentifier.Steamworks32) || proxy.IsResourceFile(ResourceIdentifier.Steamworks64)))) { - ProgramData.Log.Info($"[Unlocker] SmokeAPI proxy DLL detected | Game: {Name} ({Id})", LogDestination.Scan); + ProgramData.Log.Info($"[Unlocker] SmokeAPI proxy DLL detected | Game: {Name} ({Id})", LogDestination.Unlocker); return InstalledUnlocker.SmokeAPI; } if (directory.GetCreamApiProxies().Any(proxy => proxy.FileExists() && (proxy.IsResourceFile(ResourceIdentifier.Steamworks32) || proxy.IsResourceFile(ResourceIdentifier.Steamworks64)))) { - ProgramData.Log.Info($"[Unlocker] CreamAPI proxy DLL detected | Game: {Name} ({Id})", LogDestination.Scan); + ProgramData.Log.Info($"[Unlocker] CreamAPI proxy DLL detected | Game: {Name} ({Id})", LogDestination.Unlocker); return InstalledUnlocker.CreamAPI; } } } - ProgramData.Log.Info($"[Unlocker] No installed unlocker found | Game: {Name} ({Id})", LogDestination.Scan); + ProgramData.Log.Info($"[Unlocker] No installed unlocker found | Game: {Name} ({Id})", LogDestination.Unlocker); return InstalledUnlocker.None; } @@ -278,11 +278,11 @@ internal sealed class Selection : IEquatable { if (!configPath.FileExists()) { - ProgramData.Log.Info($"[Unlocker] Config not found: {configPath} | Game: {Name} ({Id})", LogDestination.Scan); + ProgramData.Log.Info($"[CreamAPI] Config not found: {configPath} | Game: {Name} ({Id})", LogDestination.Unlocker); return; } - ProgramData.Log.Info($"[Unlocker] Reading config: {configPath} | Game: {Name} ({Id})", LogDestination.Scan); + ProgramData.Log.Info($"[CreamAPI] Reading config: {configPath} | Game: {Name} ({Id})", LogDestination.Unlocker); string[] lines = File.ReadAllLines(configPath); foreach (string line in lines) { @@ -294,7 +294,7 @@ internal sealed class Selection : IEquatable { string value = parts[1].Trim(); UseExtraProtection = value.Equals("true", StringComparison.OrdinalIgnoreCase); - ProgramData.Log.Info($"[Unlocker] ExtraProtection = {UseExtraProtection} | Game: {Name} ({Id})", LogDestination.Scan); + ProgramData.Log.Info($"[CreamAPI] ExtraProtection = {UseExtraProtection} | Game: {Name} ({Id})", LogDestination.Unlocker); } break; }