Skip to content

Commit f021159

Browse files
committed
Split FirmwaresMenuItem_Click
1 parent 39fda0f commit f021159

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

src/BizHawk.Client.EmuHawk/MainForm.Events.cs

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -880,25 +880,22 @@ private void HotkeysMenuItem_Click(object sender, EventArgs e)
880880
InputManager.SyncControls(Emulator, MovieSession, Config);
881881
}
882882

883+
private void OpenFWConfigRomLoadFailed(RomLoader.RomErrorArgs args)
884+
{
885+
using FirmwaresConfig configForm = new(
886+
this,
887+
FirmwareManager,
888+
Config.FirmwareUserSpecifications,
889+
Config.PathEntries,
890+
retryLoadRom: true,
891+
reloadRomPath: args.RomPath);
892+
args.Retry = this.ShowDialogWithTempMute(configForm) is DialogResult.Retry;
893+
}
894+
883895
private void FirmwaresMenuItem_Click(object sender, EventArgs e)
884896
{
885-
if (e is RomLoader.RomErrorArgs args)
886-
{
887-
using var configForm = new FirmwaresConfig(
888-
this,
889-
FirmwareManager,
890-
Config.FirmwareUserSpecifications,
891-
Config.PathEntries,
892-
retryLoadRom: true,
893-
reloadRomPath: args.RomPath);
894-
var result = this.ShowDialogWithTempMute(configForm);
895-
args.Retry = result == DialogResult.Retry;
896-
}
897-
else
898-
{
899-
using var configForm = new FirmwaresConfig(this, FirmwareManager, Config.FirmwareUserSpecifications, Config.PathEntries);
900-
this.ShowDialogWithTempMute(configForm);
901-
}
897+
using var configForm = new FirmwaresConfig(this, FirmwareManager, Config.FirmwareUserSpecifications, Config.PathEntries);
898+
this.ShowDialogWithTempMute(configForm);
902899
}
903900

904901
private void MessagesMenuItem_Click(object sender, EventArgs e)

src/BizHawk.Client.EmuHawk/MainForm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3694,7 +3694,7 @@ private void ShowLoadError(object sender, RomLoader.RomErrorArgs e)
36943694
text: "The core needs certain firmware to load this rom.\n\nOpen the firmware manager now?",
36953695
useOKCancel: true))
36963696
{
3697-
FirmwaresMenuItem_Click(null, e);
3697+
OpenFWConfigRomLoadFailed(e);
36983698
if (e.Retry)
36993699
{
37003700
// Retry loading the ROM here. This leads to recursion, as the original call to LoadRom has not exited yet,

0 commit comments

Comments
 (0)