Ram Search - Implement preview mode toggle option, and hook up DoPreview() to UpdateValues() (if auto-search is not on)
This commit is contained in:
parent
d0b99ce07a
commit
69f3197277
|
@ -64,6 +64,7 @@
|
|||
public int RamSearchWidth = -1; //Negative numbers will be ignored
|
||||
public int RamSearchHeight = -1;
|
||||
public int RamSearchPreviousAs = 0;
|
||||
public bool RamSearchPreviewMode = true;
|
||||
|
||||
//Movie Settings
|
||||
public RecentFiles RecentMovies = new RecentFiles(8);
|
||||
|
|
|
@ -72,6 +72,7 @@
|
|||
this.sinceLastSearchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.sinceLastChangeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.sinceLastFrameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.previewModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
|
||||
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
|
||||
this.NewSearchtoolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||
|
@ -439,9 +440,10 @@
|
|||
// optionsToolStripMenuItem
|
||||
//
|
||||
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.definePreviousValueToolStripMenuItem,
|
||||
this.restoreOriginalWindowSizeToolStripMenuItem,
|
||||
this.saveWindowPositionToolStripMenuItem,
|
||||
this.definePreviousValueToolStripMenuItem});
|
||||
this.previewModeToolStripMenuItem});
|
||||
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
|
||||
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(56, 20);
|
||||
this.optionsToolStripMenuItem.Text = "&Options";
|
||||
|
@ -492,6 +494,13 @@
|
|||
this.sinceLastFrameToolStripMenuItem.Text = "Since last Frame";
|
||||
this.sinceLastFrameToolStripMenuItem.Click += new System.EventHandler(this.sinceLastFrameToolStripMenuItem_Click);
|
||||
//
|
||||
// previewModeToolStripMenuItem
|
||||
//
|
||||
this.previewModeToolStripMenuItem.Name = "previewModeToolStripMenuItem";
|
||||
this.previewModeToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
|
||||
this.previewModeToolStripMenuItem.Text = "Preview Mode";
|
||||
this.previewModeToolStripMenuItem.Click += new System.EventHandler(this.previewModeToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripContainer1
|
||||
//
|
||||
this.toolStripContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
|
@ -1063,5 +1072,6 @@
|
|||
private System.Windows.Forms.ToolStripMenuItem sinceLastSearchToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem sinceLastChangeToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem sinceLastFrameToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem previewModeToolStripMenuItem;
|
||||
}
|
||||
}
|
|
@ -18,9 +18,6 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
//TODO:
|
||||
//Window position gets saved but doesn't load properly
|
||||
//Implement Preview search each frame (perhaps if autosearch is not on?)
|
||||
//Refactor preview search to use prevList
|
||||
//Add Preview toggle to options menu
|
||||
//Implement definitions of Previous value
|
||||
//Multiple memory domains
|
||||
//Option to remove current Ram Watch list from search list
|
||||
|
@ -62,6 +59,8 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
if (AutoSearchCheckBox.Checked)
|
||||
DoSearch();
|
||||
else if (Global.Config.RamSearchPreviewMode)
|
||||
DoPreview();
|
||||
SearchListView.Refresh();
|
||||
}
|
||||
|
||||
|
@ -514,16 +513,20 @@ namespace BizHawk.MultiClient
|
|||
|
||||
private void DoPreview()
|
||||
{
|
||||
weededList.Clear(); //TODO: use previewList to avoid having to clear this!
|
||||
if (GenerateWeedOutList())
|
||||
if (Global.Config.RamSearchPreviewMode)
|
||||
{
|
||||
DisplaySearchList();
|
||||
OutputLabel.Text = MakeAddressString(weededList.Count) + "would be removed";
|
||||
weededList.Clear();
|
||||
if (GenerateWeedOutList())
|
||||
{
|
||||
DisplaySearchList();
|
||||
OutputLabel.Text = MakeAddressString(weededList.Count) + "would be removed";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DoSearch()
|
||||
{
|
||||
//TODO: if already previewed, don't generate the list again, perhaps a bool?
|
||||
if (GenerateWeedOutList())
|
||||
{
|
||||
SaveUndo();
|
||||
|
@ -1264,6 +1267,7 @@ namespace BizHawk.MultiClient
|
|||
private void optionsToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
saveWindowPositionToolStripMenuItem.Checked = Global.Config.RamSearchSaveWindowPosition;
|
||||
previewModeToolStripMenuItem.Checked = Global.Config.RamSearchPreviewMode;
|
||||
}
|
||||
|
||||
private void searchToolStripMenuItem1_Click(object sender, EventArgs e)
|
||||
|
@ -1376,6 +1380,11 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
if (!DifferentByRadio.Checked) DoPreview();
|
||||
}
|
||||
|
||||
private void previewModeToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.RamSearchPreviewMode ^= true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue