Ram Search - Issue 342 - add an "Account for lag" option to the auto-search feature, on by default because I decided that you probably really want that most of the time and don't realize that you do

This commit is contained in:
adelikat 2015-01-02 21:53:39 +00:00
parent 7abad21467
commit ab518e9e7c
3 changed files with 36 additions and 8 deletions

View File

@ -156,6 +156,7 @@
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.DisplayTypeDropdown = new System.Windows.Forms.ComboBox(); this.DisplayTypeDropdown = new System.Windows.Forms.ComboBox();
this.AutoSearchAccountForLagMenuItem = new System.Windows.Forms.ToolStripMenuItem();
SearchMenuItem = new System.Windows.Forms.ToolStripMenuItem(); SearchMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ListViewContextMenu.SuspendLayout(); this.ListViewContextMenu.SuspendLayout();
this.RamSearchMenu.SuspendLayout(); this.RamSearchMenu.SuspendLayout();
@ -350,7 +351,7 @@
this.ClearPreviewContextMenuItem.Text = "&Clear Preview"; this.ClearPreviewContextMenuItem.Text = "&Clear Preview";
this.ClearPreviewContextMenuItem.Click += new System.EventHandler(this.ClearPreviewContextMenuItem_Click); this.ClearPreviewContextMenuItem.Click += new System.EventHandler(this.ClearPreviewContextMenuItem_Click);
// //
// menuStrip1 // RamSearchMenu
// //
this.RamSearchMenu.ClickThrough = true; this.RamSearchMenu.ClickThrough = true;
this.RamSearchMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.RamSearchMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -359,7 +360,7 @@
this.searchToolStripMenuItem, this.searchToolStripMenuItem,
this.optionsToolStripMenuItem}); this.optionsToolStripMenuItem});
this.RamSearchMenu.Location = new System.Drawing.Point(0, 0); this.RamSearchMenu.Location = new System.Drawing.Point(0, 0);
this.RamSearchMenu.Name = "menuStrip1"; this.RamSearchMenu.Name = "RamSearchMenu";
this.RamSearchMenu.Size = new System.Drawing.Size(445, 24); this.RamSearchMenu.Size = new System.Drawing.Size(445, 24);
this.RamSearchMenu.TabIndex = 4; this.RamSearchMenu.TabIndex = 4;
this.RamSearchMenu.Text = "menuStrip1"; this.RamSearchMenu.Text = "menuStrip1";
@ -745,6 +746,7 @@
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.PreviewModeMenuItem, this.PreviewModeMenuItem,
this.AutoSearchMenuItem, this.AutoSearchMenuItem,
this.AutoSearchAccountForLagMenuItem,
this.toolStripSeparator9, this.toolStripSeparator9,
this.ExcludeRamWatchMenuItem, this.ExcludeRamWatchMenuItem,
this.UseUndoHistoryMenuItem, this.UseUndoHistoryMenuItem,
@ -1361,6 +1363,13 @@
this.DisplayTypeDropdown.TabIndex = 95; this.DisplayTypeDropdown.TabIndex = 95;
this.DisplayTypeDropdown.SelectedIndexChanged += new System.EventHandler(this.DisplayTypeDropdown_SelectedIndexChanged); this.DisplayTypeDropdown.SelectedIndexChanged += new System.EventHandler(this.DisplayTypeDropdown_SelectedIndexChanged);
// //
// AutoSearchAccountForLagMenuItem
//
this.AutoSearchAccountForLagMenuItem.Name = "AutoSearchAccountForLagMenuItem";
this.AutoSearchAccountForLagMenuItem.Size = new System.Drawing.Size(240, 22);
this.AutoSearchAccountForLagMenuItem.Text = "&Auto-Search Account for Lag";
this.AutoSearchAccountForLagMenuItem.Click += new System.EventHandler(this.AutoSearchAccountForLagMenuItem_Click);
//
// RamSearch // RamSearch
// //
this.AllowDrop = true; this.AllowDrop = true;
@ -1532,5 +1541,6 @@
private System.Windows.Forms.ToolStripMenuItem FloatingWindowMenuItem; private System.Windows.Forms.ToolStripMenuItem FloatingWindowMenuItem;
private System.Windows.Forms.ToolStripButton ErrorIconButton; private System.Windows.Forms.ToolStripButton ErrorIconButton;
private System.Windows.Forms.ToolStripMenuItem Previous_LastChangeMenuItem; private System.Windows.Forms.ToolStripMenuItem Previous_LastChangeMenuItem;
private System.Windows.Forms.ToolStripMenuItem AutoSearchAccountForLagMenuItem;
} }
} }

View File

@ -70,6 +70,9 @@ namespace BizHawk.Client.EmuHawk
[RequiredService] [RequiredService]
public IEmulator Emu { get; set; } public IEmulator Emu { get; set; }
[RequiredService]
public IInputPollable InputPollableCore { get; set; }
[ConfigPersist] [ConfigPersist]
public RamSearchSettings Settings { get; set; } public RamSearchSettings Settings { get; set; }
@ -266,9 +269,16 @@ namespace BizHawk.Client.EmuHawk
_searches.Update(); _searches.Update();
if (_autoSearch) if (_autoSearch)
{
if (Settings.AutoSearchTakeLagFramesIntoAccount && InputPollableCore.IsLagFrame)
{
// Do nothing
}
else
{ {
DoSearch(); DoSearch();
} }
}
_forcePreviewClear = false; _forcePreviewClear = false;
WatchListView.BlazingFast = true; WatchListView.BlazingFast = true;
@ -931,11 +941,13 @@ namespace BizHawk.Client.EmuHawk
PreviewMode = true; PreviewMode = true;
RecentSearches = new RecentFiles(8); RecentSearches = new RecentFiles(8);
AutoSearchTakeLagFramesIntoAccount = true;
} }
public ColumnList Columns { get; set; } public ColumnList Columns { get; set; }
public bool PreviewMode { get; set; } public bool PreviewMode { get; set; }
public bool AlwaysExcludeRamWatch { get; set; } public bool AlwaysExcludeRamWatch { get; set; }
public bool AutoSearchTakeLagFramesIntoAccount { get; set; }
public RecentFiles RecentSearches { get; set; } public RecentFiles RecentSearches { get; set; }
} }
@ -1271,6 +1283,7 @@ namespace BizHawk.Client.EmuHawk
AlwaysOnTopMenuItem.Checked = Settings.TopMost; AlwaysOnTopMenuItem.Checked = Settings.TopMost;
FloatingWindowMenuItem.Checked = Settings.FloatingWindow; FloatingWindowMenuItem.Checked = Settings.FloatingWindow;
AutoSearchMenuItem.Checked = _autoSearch; AutoSearchMenuItem.Checked = _autoSearch;
AutoSearchAccountForLagMenuItem.Checked = Settings.AutoSearchTakeLagFramesIntoAccount;
} }
private void PreviewModeMenuItem_Click(object sender, EventArgs e) private void PreviewModeMenuItem_Click(object sender, EventArgs e)
@ -1287,6 +1300,11 @@ namespace BizHawk.Client.EmuHawk
!_autoSearch; !_autoSearch;
} }
private void AutoSearchAccountForLagMenuItem_Click(object sender, EventArgs e)
{
Settings.AutoSearchTakeLagFramesIntoAccount ^= true;
}
private void ExcludeRamWatchMenuItem_Click(object sender, EventArgs e) private void ExcludeRamWatchMenuItem_Click(object sender, EventArgs e)
{ {
Settings.AlwaysExcludeRamWatch ^= true; Settings.AlwaysExcludeRamWatch ^= true;

View File

@ -121,16 +121,16 @@
<value>False</value> <value>False</value>
</metadata> </metadata>
<metadata name="ListViewContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="ListViewContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>457, 17</value> <value>161, 17</value>
</metadata> </metadata>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="RamSearchMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>150, 17</value> <value>17, 17</value>
</metadata> </metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>602, 17</value> <value>331, 17</value>
</metadata> </metadata>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>699, 17</value> <value>428, 17</value>
</metadata> </metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="DoSearchToolButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="DoSearchToolButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">