ram watch: allow duplicate identical ram watches

Allows duplicating identical Ram Watches. Previously, the Duplicate Watch dialog would silently discard a new watch if the address didn't change. As a side effect, multiple watches can now be duplicated simulatenously. This commit also removes the check for separate memory domains - it doesn't seem to cause any problems
This commit is contained in:
scrimpeh 2020-06-22 21:09:05 +02:00 committed by adelikat
parent d6994ea1af
commit 85d140c4b5
2 changed files with 1 additions and 13 deletions

View File

@ -174,17 +174,13 @@ namespace BizHawk.Client.Common
/// <summary>
/// Add an existing collection of <see cref="Watch"/> into the current one
/// <see cref="Watch"/> equality will be checked to avoid doubles
/// </summary>
/// <param name="watches"><see cref="IEnumerable{Watch}"/> of watch to merge</param>
public void AddRange(IEnumerable<Watch> watches)
{
Parallel.ForEach(watches, watch =>
{
if (!_watchList.Contains(watch))
{
_watchList.Add(watch);
}
_watchList.Add(watch);
});
Changes = true;
}

View File

@ -350,14 +350,6 @@ namespace BizHawk.Client.EmuHawk
if (SelectedWatches.Any())
{
foreach (var sw in SelectedWatches)
{
if (sw.Domain != SelectedWatches.First().Domain)
{
throw new InvalidOperationException("Can't edit multiple watches on varying memory domains");
}
}
var we = new WatchEditor
{
InitialLocation = this.ChildPointToScreen(WatchListView),