Resolve TODOs re: prompting to reboot core when not applicable

This commit is contained in:
YoshiRulz 2022-06-03 02:29:11 +10:00
parent c70e87af2e
commit 8869570bcf
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 6 additions and 3 deletions

View File

@ -59,8 +59,11 @@ namespace BizHawk.Client.EmuHawk
void ClickHandler(object clickSender, EventArgs clickArgs)
{
var coreName = ((ToolStripMenuItem) clickSender).Text;
foreach (var system in appliesTo) Config.PreferredCores[system] = coreName;
if (appliesTo.Contains(Emulator.SystemId)) FlagNeedsReboot(); //TODO don't alert if the loaded core was the one selected
foreach (var system in appliesTo)
{
if (Emulator.SystemId == system && Emulator.Attributes().CoreName != coreName) FlagNeedsReboot();
Config.PreferredCores[system] = coreName;
}
}
submenu.DropDownItems.AddRange(coreNames.Select(coreName => {
var entry = new ToolStripMenuItem { Text = coreName };
@ -79,7 +82,7 @@ namespace BizHawk.Client.EmuHawk
GBInSGBMenuItem.Click += (_, _) =>
{
Config.GbAsSgb ^= true;
if (!Emulator.IsNull()) FlagNeedsReboot(); //TODO only alert if a GB or SGB core is loaded
if (Emulator.SystemId is VSystemID.Raw.GB or VSystemID.Raw.GBC or VSystemID.Raw.SGB) FlagNeedsReboot();
};
CoresSubMenu.DropDownItems.Add(GBInSGBMenuItem);
var setLibretroCoreToolStripMenuItem = new ToolStripMenuItem { Text = "Set Libretro Core..." };