Ram Search - fix broken searching, also some code cleanup
This commit is contained in:
parent
ff218af117
commit
d6f3c05ecd
|
@ -526,8 +526,6 @@ namespace BizHawk.MultiClient
|
||||||
private void SaveUndo()
|
private void SaveUndo()
|
||||||
{
|
{
|
||||||
undoList.Clear();
|
undoList.Clear();
|
||||||
//for (int x = 0; x < searchList.Count; x++) //TODO: delete
|
|
||||||
// undoList.Add(new Watch(searchList[x]));
|
|
||||||
undoList.AddRange(searchList.Where(x => x.deleted == false));
|
undoList.AddRange(searchList.Where(x => x.deleted == false));
|
||||||
UndotoolStripButton.Enabled = true;
|
UndotoolStripButton.Enabled = true;
|
||||||
}
|
}
|
||||||
|
@ -542,8 +540,6 @@ namespace BizHawk.MultiClient
|
||||||
ClearUndo();
|
ClearUndo();
|
||||||
RedotoolStripButton2.Enabled = true;
|
RedotoolStripButton2.Enabled = true;
|
||||||
DisplaySearchList();
|
DisplaySearchList();
|
||||||
//OutputLabel.Text = "Undo: s" + searchList.Count.ToString() + " u" +
|
|
||||||
// undoList.Count.ToString() + " r" + redoList.Count.ToString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -583,7 +579,6 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
if (IsAWeededList && column == 0)
|
if (IsAWeededList && column == 0)
|
||||||
{
|
{
|
||||||
//if (!weededList.Contains(searchList[index])) //TODO: delete me
|
|
||||||
if (searchList[index].deleted)
|
if (searchList[index].deleted)
|
||||||
{
|
{
|
||||||
if (color == Color.Pink) return;
|
if (color == Color.Pink) return;
|
||||||
|
@ -709,18 +704,25 @@ namespace BizHawk.MultiClient
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void TrimWeededList()
|
||||||
|
{
|
||||||
|
searchList = searchList.Where(x => x.deleted == false).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
private void DoSearch()
|
private void DoSearch()
|
||||||
{
|
{
|
||||||
if (GenerateWeedOutList())
|
if (GenerateWeedOutList())
|
||||||
{
|
{
|
||||||
SaveUndo();
|
SaveUndo();
|
||||||
MessageLabel.Text = MakeAddressString(searchList.Where(x => x.deleted == true).Count()) + " removed";
|
MessageLabel.Text = MakeAddressString(searchList.Where(x => x.deleted == true).Count()) + " removed";
|
||||||
//ReplaceSearchListWithWeedOutList(); //TODO: delete me
|
TrimWeededList();
|
||||||
UpdateLastSearch();
|
UpdateLastSearch();
|
||||||
DisplaySearchList();
|
DisplaySearchList();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
MessageLabel.Text = "Search failed.";
|
MessageLabel.Text = "Search failed.";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void toolStripButton1_Click(object sender, EventArgs e)
|
private void toolStripButton1_Click(object sender, EventArgs e)
|
||||||
|
@ -768,7 +770,6 @@ namespace BizHawk.MultiClient
|
||||||
//Generate search list
|
//Generate search list
|
||||||
//Use search list to generate a list of flagged address (for displaying pink)
|
//Use search list to generate a list of flagged address (for displaying pink)
|
||||||
IsAWeededList = true;
|
IsAWeededList = true;
|
||||||
//weededList.Clear(); TODO: delete this
|
|
||||||
switch (GetCompareTo())
|
switch (GetCompareTo())
|
||||||
{
|
{
|
||||||
case SCompareTo.PREV:
|
case SCompareTo.PREV:
|
||||||
|
@ -1514,8 +1515,6 @@ namespace BizHawk.MultiClient
|
||||||
searchList[x].signed = s;
|
searchList[x].signed = s;
|
||||||
for (int x = 0; x < undoList.Count; x++)
|
for (int x = 0; x < undoList.Count; x++)
|
||||||
undoList[x].signed = s;
|
undoList[x].signed = s;
|
||||||
//for (int x = 0; x < weededList.Count; x++) //TODO: delete me
|
|
||||||
// weededList[x].signed = s;
|
|
||||||
for (int x = 0; x < redoList.Count; x++)
|
for (int x = 0; x < redoList.Count; x++)
|
||||||
redoList[x].signed = s;
|
redoList[x].signed = s;
|
||||||
SetSpecificValueBoxMaxLength();
|
SetSpecificValueBoxMaxLength();
|
||||||
|
@ -1528,7 +1527,6 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
ConvertDataSize(s, bigendian, ref searchList);
|
ConvertDataSize(s, bigendian, ref searchList);
|
||||||
ConvertDataSize(s, bigendian, ref undoList);
|
ConvertDataSize(s, bigendian, ref undoList);
|
||||||
//ConvertDataSize(s, bigendian, ref weededList); //TODO: delete me
|
|
||||||
ConvertDataSize(s, bigendian, ref redoList);
|
ConvertDataSize(s, bigendian, ref redoList);
|
||||||
SetSpecificValueBoxMaxLength();
|
SetSpecificValueBoxMaxLength();
|
||||||
sortReverse = false;
|
sortReverse = false;
|
||||||
|
@ -2139,32 +2137,9 @@ namespace BizHawk.MultiClient
|
||||||
private void DoTruncate(List<Watch> temp)
|
private void DoTruncate(List<Watch> temp)
|
||||||
{
|
{
|
||||||
|
|
||||||
//weededList.Clear(); //TODO: delete
|
SaveUndo();
|
||||||
//bool found = false;
|
|
||||||
//for (int x = 0; x < searchList.Count; x++)
|
|
||||||
//{
|
|
||||||
// found = false;
|
|
||||||
// for (int y = 0; y < temp.Count; y++)
|
|
||||||
// {
|
|
||||||
// if (searchList[x].address == temp[y].address)
|
|
||||||
// {
|
|
||||||
// found = true;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
|
||||||
// if (!found)
|
|
||||||
// {
|
|
||||||
// //weededList.Add(searchList[x]);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
SaveUndo(); //TODO: we need to undo!
|
|
||||||
MessageLabel.Text = MakeAddressString(undoList.Count) + " removed";
|
MessageLabel.Text = MakeAddressString(undoList.Count) + " removed";
|
||||||
searchList = searchList.Where(x => x.deleted == false).ToList();
|
TrimWeededList();
|
||||||
|
|
||||||
//MessageLabel.Text = MakeAddressString(searchList.Count - weededList.Count) + " removed"; //TODO: delete
|
|
||||||
//ReplaceSearchListWithWeedOutList(); //TODO: delete this
|
|
||||||
UpdateLastSearch();
|
UpdateLastSearch();
|
||||||
DisplaySearchList();
|
DisplaySearchList();
|
||||||
}
|
}
|
||||||
|
@ -2225,7 +2200,9 @@ namespace BizHawk.MultiClient
|
||||||
private void UpdateLastSearch()
|
private void UpdateLastSearch()
|
||||||
{
|
{
|
||||||
for (int x = 0; x < searchList.Count; x++)
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
|
{
|
||||||
searchList[x].lastsearch = searchList[x].value;
|
searchList[x].lastsearch = searchList[x].value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetCurrToPrevtoolStripButton2_Click(object sender, EventArgs e)
|
private void SetCurrToPrevtoolStripButton2_Click(object sender, EventArgs e)
|
||||||
|
|
Loading…
Reference in New Issue