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.label2 = new System.Windows.Forms.Label();
this.DisplayTypeDropdown = new System.Windows.Forms.ComboBox();
this.AutoSearchAccountForLagMenuItem = new System.Windows.Forms.ToolStripMenuItem();
SearchMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ListViewContextMenu.SuspendLayout();
this.RamSearchMenu.SuspendLayout();
@ -350,7 +351,7 @@
this.ClearPreviewContextMenuItem.Text = "&Clear Preview";
this.ClearPreviewContextMenuItem.Click += new System.EventHandler(this.ClearPreviewContextMenuItem_Click);
//
// menuStrip1
// RamSearchMenu
//
this.RamSearchMenu.ClickThrough = true;
this.RamSearchMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -359,7 +360,7 @@
this.searchToolStripMenuItem,
this.optionsToolStripMenuItem});
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.TabIndex = 4;
this.RamSearchMenu.Text = "menuStrip1";
@ -745,6 +746,7 @@
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.PreviewModeMenuItem,
this.AutoSearchMenuItem,
this.AutoSearchAccountForLagMenuItem,
this.toolStripSeparator9,
this.ExcludeRamWatchMenuItem,
this.UseUndoHistoryMenuItem,
@ -1361,6 +1363,13 @@
this.DisplayTypeDropdown.TabIndex = 95;
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
//
this.AllowDrop = true;
@ -1532,5 +1541,6 @@
private System.Windows.Forms.ToolStripMenuItem FloatingWindowMenuItem;
private System.Windows.Forms.ToolStripButton ErrorIconButton;
private System.Windows.Forms.ToolStripMenuItem Previous_LastChangeMenuItem;
private System.Windows.Forms.ToolStripMenuItem AutoSearchAccountForLagMenuItem;
}
}

View File

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

View File

@ -121,16 +121,16 @@
<value>False</value>
</metadata>
<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 name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>150, 17</value>
<metadata name="RamSearchMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<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 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>
<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">