From bbb3b4cd7d26e9ff2406debe10ef9f33f8647b1f Mon Sep 17 00:00:00 2001 From: Morilli <35152647+Morilli@users.noreply.github.com> Date: Mon, 8 Jul 2024 06:26:57 +0200 Subject: [PATCH] Update comment on CorePickerUIData also restore systemid default core restore logic that exists for some reason --- src/BizHawk.Client.Common/config/Config.cs | 2 +- src/BizHawk.Client.EmuHawk/MainForm.cs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/BizHawk.Client.Common/config/Config.cs b/src/BizHawk.Client.Common/config/Config.cs index e16f70b13d..125c4ff6dc 100644 --- a/src/BizHawk.Client.Common/config/Config.cs +++ b/src/BizHawk.Client.Common/config/Config.cs @@ -18,7 +18,7 @@ namespace BizHawk.Client.Common public static string ControlDefaultPath => Path.Combine(PathUtils.ExeDirectoryPath, "defctrl.json"); /// - /// AppliesTo[0] is used as the group label, and + /// All SystemIDs in AppliesTo are used as group label, and /// Config.PreferredCores[AppliesTo[0]] (lookup on global instance) determines which option is shown as checked.
/// The order within submenus and the order of the submenus themselves are determined by the declaration order here. ///
diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index f6d61320a2..c16c53171e 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -107,8 +107,9 @@ namespace BizHawk.Client.EmuHawk { // invalid --> default (doing this here rather than when reading config file to allow for hacked-in values, though I'm not sure if that could do anything at the moment --yoshi) var defaultCore = coreNames[0]; - Console.WriteLine($"setting preferred core for {appliesTo[0]} etc. to {defaultCore} (was {preferred ?? "null"})"); - Config.PreferredCores[appliesTo[0]] = preferred = defaultCore; + Console.WriteLine($"setting preferred core for {submenu.Text} to {defaultCore} (was {preferred ?? "null"})"); + preferred = defaultCore; + foreach (var sysID in appliesTo) Config.PreferredCores[sysID] = preferred; } foreach (ToolStripMenuItem entry in ((ToolStripMenuItem) openedSender).DropDownItems) entry.Checked = entry.Text == preferred; };