Prevent CDL's "Disassemble..." when not implemented crashing EmuHawk

(by disabling the button)
see #1274
This commit is contained in:
YoshiRulz 2025-01-16 05:33:40 +10:00
parent 93f33815ed
commit 0d05c1d263
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 3 additions and 1 deletions

View File

@ -108,6 +108,8 @@ namespace BizHawk.Client.EmuHawk
public override void Restart()
{
DisassembleMenuItem.Tag = CodeDataLogger.GetType().GetMethod(nameof(ICodeDataLogger.DisassembleCDL))!
.IsImplemented();
//don't try to recover the current CDL!
//even though it seems like it might be nice, it might get mixed up between games. even if we use CheckCDL. Switching games with the same memory map will be bad.
_cdl = null;
@ -283,8 +285,8 @@ namespace BizHawk.Client.EmuHawk
SaveAsMenuItem.Enabled =
AppendMenuItem.Enabled =
ClearMenuItem.Enabled =
DisassembleMenuItem.Enabled =
_cdl != null;
DisassembleMenuItem.Enabled = _cdl is not null && /*core implements feature*/(bool) DisassembleMenuItem.Tag;
miAutoSave.Checked = CDLAutoSave;
miAutoStart.Checked = CDLAutoStart;