From 9f137753b93e2e66864214715b4a23af8b4f9c98 Mon Sep 17 00:00:00 2001 From: Morilli <35152647+Morilli@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:23:25 +0200 Subject: [PATCH] hide no-op context menus for separators in ram watch - closes #4051 --- src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs b/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs index cb46c6270b..b3cb6a3fdd 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs @@ -188,7 +188,7 @@ namespace BizHawk.Client.EmuHawk private IEnumerable SelectedSeparators => SelectedItems.Where(x => x.IsSeparator); private bool MayPokeAllSelected - => WatchListView.AnyRowsSelected && SelectedWatches.All(static w => w.Domain.Writable); + => SelectedWatches.Any() && SelectedWatches.All(static w => w.Domain.Writable); public IEnumerable Watches => _watches.Where(x => !x.IsSeparator); @@ -1114,7 +1114,7 @@ namespace BizHawk.Client.EmuHawk } private bool MaySplitAllSelected - => WatchListView.AnyRowsSelected && SelectedWatches.All(static w => w.IsSplittable); + => SelectedWatches.Any() && SelectedWatches.All(static w => w.IsSplittable); private void ListViewContextMenu_Opening(object sender, CancelEventArgs e) { @@ -1141,6 +1141,8 @@ namespace BizHawk.Client.EmuHawk = Debuggable?.MemoryCallbacksAvailable() is true && SelectedWatches.Any() && SelectedWatches.All(w => w.Domain.Name == sysBusName); + DuplicateContextMenuItem.Enabled = SelectedWatches.Any(); + SplitContextMenuItem.Enabled = MaySplitAllSelected; PokeContextMenuItem.Enabled =