From 9bac1f3944772b6c3b698af367fa6158a18fdd76 Mon Sep 17 00:00:00 2001 From: Frog Date: Mon, 20 Jul 2026 01:49:30 -0700 Subject: [PATCH] Rename SelectForm to MainForm and SelectDialogForm to ScanDialog. - MainForm is the primary application window that displays the list of installed games and DLC unlockers, and is where DLC unlockers are configured and installed. - ScanDialog performs a library scan and allows the user to select which games to begin configuring DLC unlockers for. --- CreamInstaller/Components/CustomTreeView.cs | 6 +++--- CreamInstaller/CreamInstaller.csproj | 8 ++++---- CreamInstaller/Forms/InstallForm.cs | 2 +- ...lectForm.Designer.cs => MainForm.Designer.cs} | 8 ++++---- .../Forms/{SelectForm.cs => MainForm.cs} | 16 ++++++++-------- .../Forms/{SelectForm.resx => MainForm.resx} | 0 ...ogForm.Designer.cs => ScanDialog.Designer.cs} | 8 ++++---- .../Forms/{SelectDialogForm.cs => ScanDialog.cs} | 4 ++-- .../{SelectDialogForm.resx => ScanDialog.resx} | 0 CreamInstaller/Forms/UpdateForm.cs | 2 +- CreamInstaller/Selection.cs | 2 +- 11 files changed, 28 insertions(+), 28 deletions(-) rename CreamInstaller/Forms/{SelectForm.Designer.cs => MainForm.Designer.cs} (99%) rename CreamInstaller/Forms/{SelectForm.cs => MainForm.cs} (99%) rename CreamInstaller/Forms/{SelectForm.resx => MainForm.resx} (100%) rename CreamInstaller/Forms/{SelectDialogForm.Designer.cs => ScanDialog.Designer.cs} (98%) rename CreamInstaller/Forms/{SelectDialogForm.cs => ScanDialog.cs} (97%) rename CreamInstaller/Forms/{SelectDialogForm.resx => ScanDialog.resx} (100%) diff --git a/CreamInstaller/Components/CustomTreeView.cs b/CreamInstaller/Components/CustomTreeView.cs index eea1d41..a004def 100644 --- a/CreamInstaller/Components/CustomTreeView.cs +++ b/CreamInstaller/Components/CustomTreeView.cs @@ -199,7 +199,7 @@ internal sealed class CustomTreeView : TreeView Rectangle bounds = node.Bounds; Rectangle selectionBounds = bounds; - if (form is not SelectForm and not SelectDialogForm) + if (form is not MainForm and not ScanDialog) return; string id = node.Name; @@ -255,7 +255,7 @@ internal sealed class CustomTreeView : TreeView TextRenderer.DrawText(graphics, text, font, point, color, TextFormatFlags.Default); } - if (form is SelectForm) + if (form is MainForm) { Selection selection = Selection.FromId(platform, id); if (selection is not null) @@ -448,7 +448,7 @@ internal sealed class CustomTreeView : TreeView base.OnMouseDown(e); Refresh(); Point clickPoint = PointToClient(e.Location); - SelectForm selectForm = (form ??= FindForm()) as SelectForm; + MainForm selectForm = (form ??= FindForm()) as MainForm; foreach (KeyValuePair pair in selectionBounds) if (pair.Key.TreeView is null) _ = selectionBounds.Remove(pair.Key); diff --git a/CreamInstaller/CreamInstaller.csproj b/CreamInstaller/CreamInstaller.csproj index 8cbae6e..a401555 100644 --- a/CreamInstaller/CreamInstaller.csproj +++ b/CreamInstaller/CreamInstaller.csproj @@ -169,10 +169,10 @@ Form - + Form - + Form @@ -194,10 +194,10 @@ Designer - + Designer - + Designer diff --git a/CreamInstaller/Forms/InstallForm.cs b/CreamInstaller/Forms/InstallForm.cs index e817cce..1fb20fe 100644 --- a/CreamInstaller/Forms/InstallForm.cs +++ b/CreamInstaller/Forms/InstallForm.cs @@ -395,7 +395,7 @@ internal sealed partial class InstallForm : CustomForm ProgramData.Log.Info($"[InstallForm] No unlocker detected after install | Game: {selection.Name} ({selection.Id})", LogDestination.Unlocker); } } - SelectForm.Current?.Invoke(() => SelectForm.Current?.InvalidateGameList()); + MainForm.Current?.Invoke(() => MainForm.Current?.InvalidateGameList()); Program.Cleanup(); int activeCount = activeSelections.Count; diff --git a/CreamInstaller/Forms/SelectForm.Designer.cs b/CreamInstaller/Forms/MainForm.Designer.cs similarity index 99% rename from CreamInstaller/Forms/SelectForm.Designer.cs rename to CreamInstaller/Forms/MainForm.Designer.cs index 3d7ec75..5c075bf 100644 --- a/CreamInstaller/Forms/SelectForm.Designer.cs +++ b/CreamInstaller/Forms/MainForm.Designer.cs @@ -5,7 +5,7 @@ using System.Windows.Forms; namespace CreamInstaller.Forms { - partial class SelectForm + partial class MainForm { private IContainer components = null; protected override void Dispose(bool disposing) @@ -293,7 +293,7 @@ namespace CreamInstaller.Forms topOptionsTable.Controls.Add(settingsButton, 2, 0); topOptionsTable.Controls.Add(allCheckBoxLayoutPanel, 3, 0); // - // SelectForm + // MainForm // AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); AutoScaleMode = AutoScaleMode.Dpi; @@ -317,9 +317,9 @@ namespace CreamInstaller.Forms Margin = new Padding(4, 3, 4, 3); MaximizeBox = false; MinimizeBox = false; - Name = "SelectForm"; + Name = "MainForm"; StartPosition = FormStartPosition.Manual; - Text = "SelectForm"; + Text = "MainForm"; Load += OnLoad; programsGroupBox.ResumeLayout(false); useSmokeAPILayoutPanel.ResumeLayout(false); diff --git a/CreamInstaller/Forms/SelectForm.cs b/CreamInstaller/Forms/MainForm.cs similarity index 99% rename from CreamInstaller/Forms/SelectForm.cs rename to CreamInstaller/Forms/MainForm.cs index 2a1d28f..264c0d3 100644 --- a/CreamInstaller/Forms/SelectForm.cs +++ b/CreamInstaller/Forms/MainForm.cs @@ -21,11 +21,11 @@ using static CreamInstaller.Resources.Resources; namespace CreamInstaller.Forms; -internal sealed partial class SelectForm : CustomForm +internal sealed partial class MainForm : CustomForm { private const string HelpButtonListPrefix = "\n • "; - private static SelectForm current; + private static MainForm current; private static readonly object currentLock = new(); private readonly ConcurrentDictionary remainingDLCs = new(); @@ -36,14 +36,14 @@ internal sealed partial class SelectForm : CustomForm private List<(Platform platform, string id, string name)> programsToScan; - private SelectForm() + private MainForm() { InitializeComponent(); selectionTreeView.TreeViewNodeSorter = Program.SortByName ? PlatformIdComparer.NodeText : PlatformIdComparer.NodeName; Text = Program.ApplicationName; } - internal static SelectForm Current + internal static MainForm Current { get { @@ -51,7 +51,7 @@ internal sealed partial class SelectForm : CustomForm { if (current is null || current.Disposing || current.IsDisposed) { - current = new SelectForm(); + current = new MainForm(); } return current; } @@ -733,7 +733,7 @@ internal sealed partial class SelectForm : CustomForm ProgramData.Log.Info($"[Total] Total time spent detecting games and libraries: {(selectionTimer.Elapsed.TotalSeconds >= 60 ? $"{selectionTimer.Elapsed.TotalSeconds / 60:F1} minutes" : $"{selectionTimer.Elapsed.TotalSeconds:F3}s")}", LogDestination.Scan); if (gameChoices.Count > 0) { - using SelectDialogForm form = new(this); + using ScanDialog form = new(this); DialogResult selectResult = form.QueryUser("Choose which programs and/or games to scan:", gameChoices, out List<(Platform platform, string id, string name)> choices); scan = selectResult == DialogResult.OK && choices is not null && choices.Count > 0; @@ -810,7 +810,7 @@ internal sealed partial class SelectForm : CustomForm } catch (Exception ex) { - ProgramData.Log.Error("SelectForm OnLoad failed", ex); + ProgramData.Log.Error("MainForm OnLoad failed", ex); // Show error and clean up ex.HandleException(this); HideProgressBar(); @@ -1246,7 +1246,7 @@ internal sealed partial class SelectForm : CustomForm if (newDlcList.Count > 0) { - SelectForm form = SelectForm.Current; + MainForm form = MainForm.Current; if (form is null || form.Disposing || form.IsDisposed) return; form.Invoke(delegate diff --git a/CreamInstaller/Forms/SelectForm.resx b/CreamInstaller/Forms/MainForm.resx similarity index 100% rename from CreamInstaller/Forms/SelectForm.resx rename to CreamInstaller/Forms/MainForm.resx diff --git a/CreamInstaller/Forms/SelectDialogForm.Designer.cs b/CreamInstaller/Forms/ScanDialog.Designer.cs similarity index 98% rename from CreamInstaller/Forms/SelectDialogForm.Designer.cs rename to CreamInstaller/Forms/ScanDialog.Designer.cs index 32f5421..9535802 100644 --- a/CreamInstaller/Forms/SelectDialogForm.Designer.cs +++ b/CreamInstaller/Forms/ScanDialog.Designer.cs @@ -5,7 +5,7 @@ using CreamInstaller.Components; namespace CreamInstaller.Forms { - partial class SelectDialogForm + partial class ScanDialog { private IContainer components = null; protected override void Dispose(bool disposing) @@ -169,7 +169,7 @@ namespace CreamInstaller.Forms saveButton.UseVisualStyleBackColor = true; saveButton.Click += OnSave; // - // SelectDialogForm + // ScanDialog // AcceptButton = acceptButton; AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); @@ -187,10 +187,10 @@ namespace CreamInstaller.Forms FormBorderStyle = FormBorderStyle.FixedSingle; MaximizeBox = false; MinimizeBox = false; - Name = "SelectDialogForm"; + Name = "ScanDialog"; ShowInTaskbar = false; StartPosition = FormStartPosition.Manual; - Text = "SelectDialogForm"; + Text = "ScanDialog"; groupBox.ResumeLayout(false); groupBox.PerformLayout(); allCheckBoxFlowPanel.ResumeLayout(false); diff --git a/CreamInstaller/Forms/SelectDialogForm.cs b/CreamInstaller/Forms/ScanDialog.cs similarity index 97% rename from CreamInstaller/Forms/SelectDialogForm.cs rename to CreamInstaller/Forms/ScanDialog.cs index bc4554f..36c7507 100644 --- a/CreamInstaller/Forms/SelectDialogForm.cs +++ b/CreamInstaller/Forms/ScanDialog.cs @@ -7,12 +7,12 @@ using CreamInstaller.Utility; namespace CreamInstaller.Forms; -internal sealed partial class SelectDialogForm : CustomForm +internal sealed partial class ScanDialog : CustomForm { private readonly List<(Platform platform, string id, string name)> selected = new(); private readonly List<(Platform platform, string id, string name, bool alreadySelected)> allChoices = new(); - internal SelectDialogForm(IWin32Window owner) : base(owner) + internal ScanDialog(IWin32Window owner) : base(owner) { InitializeComponent(); selectionTreeView.TreeViewNodeSorter = sortCheckBox.Checked ? PlatformIdComparer.NodeText : PlatformIdComparer.NodeName; diff --git a/CreamInstaller/Forms/SelectDialogForm.resx b/CreamInstaller/Forms/ScanDialog.resx similarity index 100% rename from CreamInstaller/Forms/SelectDialogForm.resx rename to CreamInstaller/Forms/ScanDialog.resx diff --git a/CreamInstaller/Forms/UpdateForm.cs b/CreamInstaller/Forms/UpdateForm.cs index 2fc8f84..5746106 100644 --- a/CreamInstaller/Forms/UpdateForm.cs +++ b/CreamInstaller/Forms/UpdateForm.cs @@ -32,7 +32,7 @@ internal sealed partial class UpdateForm : CustomForm private void StartProgram() { - SelectForm form = SelectForm.Current; + MainForm form = MainForm.Current; form.InheritLocation(this); form.FormClosing += (_, _) => Close(); form.Show(); diff --git a/CreamInstaller/Selection.cs b/CreamInstaller/Selection.cs index bbdfb18..c3b2f9f 100644 --- a/CreamInstaller/Selection.cs +++ b/CreamInstaller/Selection.cs @@ -71,7 +71,7 @@ internal sealed class Selection : IEquatable ExecutableDirectories = executableDirectories; _ = All.TryAdd(this, default); TreeNode = new() { Tag = Platform, Name = Id, Text = Name }; - SelectForm selectForm = SelectForm.Current; + MainForm selectForm = MainForm.Current; if (selectForm is null) return; Enabled = selectForm.allCheckBox.Checked;