From a4b6afa2147ee3e8944f15356a5ab985c9265a4f Mon Sep 17 00:00:00 2001 From: Frog Date: Fri, 24 Jul 2026 02:22:49 -0700 Subject: [PATCH] Improve Clear Cache Data - Improves clear cache data by ensuring the app automatically reloads/reprompts the scan window --- CreamInstaller/Forms/MainForm.cs | 12 +++++++++++- CreamInstaller/Forms/SettingsForm.cs | 2 ++ CreamInstaller/Utility/ProgramData.cs | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CreamInstaller/Forms/MainForm.cs b/CreamInstaller/Forms/MainForm.cs index 2988726..ead4c9b 100644 --- a/CreamInstaller/Forms/MainForm.cs +++ b/CreamInstaller/Forms/MainForm.cs @@ -1660,7 +1660,17 @@ internal sealed partial class MainForm : CustomForm private void programsGroupBox_Enter(object sender, EventArgs e) { } private void OnSettingsButtonClick(object sender, EventArgs e) - => SettingsForm.Show(this); + { + SettingsForm.Show(this); + if (ProgramData.CacheCleared) + { + ProgramData.CacheCleared = false; + selectionTreeView.Nodes.Clear(); + Selection.All.Clear(); + programsToScan = null; + OnLoad(forceProvideChoices: true); + } + } protected override void OnShown(EventArgs e) { diff --git a/CreamInstaller/Forms/SettingsForm.cs b/CreamInstaller/Forms/SettingsForm.cs index 0031c99..7fcf39d 100644 --- a/CreamInstaller/Forms/SettingsForm.cs +++ b/CreamInstaller/Forms/SettingsForm.cs @@ -89,7 +89,9 @@ internal sealed partial class SettingsForm : CustomForm } } + ProgramData.CacheCleared = true; ProgramData.SaveSettings(Program.AppSettings); + DialogResult = DialogResult.OK; } private async void OnReconfigureSteamCMDClick(object sender, EventArgs e) diff --git a/CreamInstaller/Utility/ProgramData.cs b/CreamInstaller/Utility/ProgramData.cs index 826ae1e..7cb0b47 100644 --- a/CreamInstaller/Utility/ProgramData.cs +++ b/CreamInstaller/Utility/ProgramData.cs @@ -81,6 +81,8 @@ internal static class ProgramData private static readonly string InstalledGamesPath = CachePath + @"\installed.json"; private static readonly string SettingsPath = CachePath + @"\settings.json"; + internal static bool CacheCleared { get; set; } + internal static readonly string LogsPath = DirectoryPath + @"\Logs"; internal static readonly string ScanLogPath = LogsPath + @"\game-scan.log"; internal static readonly string SteamLogPath = LogsPath + @"\cream-steam.log";