diff --git a/BizHawk.MultiClient/tools/RamSearch.cs b/BizHawk.MultiClient/tools/RamSearch.cs index b61a5bae2c..728c734341 100644 --- a/BizHawk.MultiClient/tools/RamSearch.cs +++ b/BizHawk.MultiClient/tools/RamSearch.cs @@ -12,7 +12,6 @@ using System.Globalization; namespace BizHawk.MultiClient { //TODO: - //In DoUndo, prevList is set to searchList, instead how about a UndoPrev, so that undo restores both the current and previous values //Go To Address (Ctrl+G) feature /// @@ -23,9 +22,11 @@ namespace BizHawk.MultiClient string systemID = "NULL"; List searchList = new List(); List undoList = new List(); + List undoPrevList = new List(); List weededList = new List(); //When addresses are weeded out, the new list goes here, before going into searchList List prevList = new List(); List redoList = new List(); + List redoPrevList = new List(); private bool IsAWeededList = false; //For deciding whether the weeded list is relevant (0 size could mean all were removed in a legit preview List domainMenuItems = new List(); MemoryDomain Domain = new MemoryDomain("NULL", 1, Endian.Little, addr => 0, (a, v) => { }); @@ -526,8 +527,11 @@ namespace BizHawk.MultiClient private void SaveUndo() { undoList.Clear(); + undoPrevList.Clear(); for (int x = 0; x < searchList.Count; x++) undoList.Add(new Watch(searchList[x])); + for (int x = 0; x < prevList.Count; x++) + undoPrevList.Add(new Watch(prevList[x])); UndotoolStripButton.Enabled = true; } @@ -537,8 +541,9 @@ namespace BizHawk.MultiClient { MessageLabel.Text = MakeAddressString(undoList.Count - searchList.Count) + " restored"; redoList = new List(searchList); + redoPrevList = new List(prevList); searchList = new List(undoList); - prevList = new List(undoList); + prevList = new List(undoPrevList); ClearUndo(); RedotoolStripButton2.Enabled = true; DisplaySearchList(); @@ -550,12 +555,14 @@ namespace BizHawk.MultiClient private void ClearUndo() { undoList.Clear(); + undoPrevList.Clear(); UndotoolStripButton.Enabled = false; } private void ClearRedo() { redoList.Clear(); + redoPrevList.Clear(); RedotoolStripButton2.Enabled = false; } @@ -565,8 +572,9 @@ namespace BizHawk.MultiClient { MessageLabel.Text = MakeAddressString(searchList.Count - redoList.Count) + " removed"; undoList = new List(searchList); + undoPrevList = new List(prevList); searchList = new List(redoList); - prevList = new List(redoList); + prevList = new List(redoPrevList); ClearRedo(); UndotoolStripButton.Enabled = true; DisplaySearchList(); @@ -1084,12 +1092,16 @@ namespace BizHawk.MultiClient searchList[x].signed = s; for (int x = 0; x < undoList.Count; x++) undoList[x].signed = s; + for (int x = 0; x < undoPrevList.Count; x++) + undoPrevList[x].signed = s; for (int x = 0; x < weededList.Count; x++) weededList[x].signed = s; for (int x = 0; x < prevList.Count; x++) prevList[x].signed = s; for (int x = 0; x < redoList.Count; x++) redoList[x].signed = s; + for (int x = 0; x < redoPrevList.Count; x++) + redoPrevList[x].signed = s; } private void signedToolStripMenuItem_Click(object sender, EventArgs e)