Ram Search - fix Truncate from file, and exclude ram watch

This commit is contained in:
adelikat 2012-09-02 03:05:48 +00:00
parent 02c447becb
commit f519fa0e2d
1 changed files with 25 additions and 4 deletions

View File

@ -2128,11 +2128,11 @@ namespace BizHawk.MultiClient
TruncateFromFile();
}
private void DoTruncate(List<Watch> temp)
private void DoTruncate()
{
SaveUndo();
MessageLabel.Text = MakeAddressString(undoList.Count) + " removed";
MessageLabel.Text = MakeAddressString(searchList.Where(x => x.deleted == true).Count()) + " removed";
TrimWeededList();
UpdateLastSearch();
DisplaySearchList();
@ -2146,16 +2146,37 @@ namespace BizHawk.MultiClient
{
List<Watch> temp = new List<Watch>();
LoadSearchFile(file.FullName, false, true, temp);
DoTruncate(temp);
TruncateList(temp);
DoTruncate();
}
}
private void ClearWeeded()
{
foreach (Watch watch in searchList)
{
watch.deleted = false;
}
}
private void TruncateList(List<Watch> toRemove)
{
ClearWeeded();
foreach (Watch watch in toRemove)
{
searchList.Where(x => x.address == watch.address).FirstOrDefault().deleted = true;
}
DoTruncate();
}
/// <summary>
/// Removes Ram Watch list from the search list
/// </summary>
private void ExcludeRamWatchList()
{
DoTruncate(Global.MainForm.RamWatch1.GetRamWatchList());
TruncateList(Global.MainForm.RamWatch1.GetRamWatchList());
}
private void TruncateFromFiletoolStripButton2_Click(object sender, EventArgs e)