New Ram Search - more GUI work, including context menu

This commit is contained in:
adelikat 2013-09-23 16:01:19 +00:00
parent 8db1c0b91e
commit 8d4fd1d7fa
5 changed files with 268 additions and 143 deletions

View File

@ -233,7 +233,7 @@ namespace BizHawk.MultiClient
public int RamSearchHeight = -1; public int RamSearchHeight = -1;
public int RamSearchPreviousAs = 0; public int RamSearchPreviousAs = 0;
public bool RamSearchPreviewMode = true; public bool RamSearchPreviewMode = true;
public bool AlwaysExcludeRamWatch = false; public bool RamSearchAlwaysExcludeRamWatch = false;
public int RamSearchAddressWidth = -1; public int RamSearchAddressWidth = -1;
public int RamSearchValueWidth = -1; public int RamSearchValueWidth = -1;
public int RamSearchPrevWidth = -1; public int RamSearchPrevWidth = -1;
@ -243,6 +243,7 @@ namespace BizHawk.MultiClient
public int RamSearchPrevIndex = 2; public int RamSearchPrevIndex = 2;
public int RamSearchChangesIndex = 3; public int RamSearchChangesIndex = 3;
public bool RamSearchFastMode = false; public bool RamSearchFastMode = false;
public bool RamSearchAlwaysOnTop = false;
// HexEditor Settings // HexEditor Settings
public bool AutoLoadHexEditor = false; public bool AutoLoadHexEditor = false;

View File

@ -36,6 +36,17 @@ namespace BizHawk.MultiClient
return items.ToArray(); return items.ToArray();
} }
public static void UnfreezeAll()
{
Global.MainForm.Cheats1.RemoveAllCheats();
Global.MainForm.NewRamWatch1.UpdateValues();
Global.MainForm.HexEditor1.UpdateValues();
Global.MainForm.Cheats_UpdateValues();
Global.MainForm.RamSearch1.UpdateValues();
Global.MainForm.NewRamSearch1.UpdateValues();
}
public static void FreezeAddress(List<Watch> watches) public static void FreezeAddress(List<Watch> watches)
{ {
foreach(var watch in watches) foreach(var watch in watches)

View File

@ -38,18 +38,18 @@
this.PreviousColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.PreviousColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.ChangesColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.ChangesColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.startNewSearchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.DoSearchContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.searchToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); this.NewSearchContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); this.ContextMenuSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.removeSelectedToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.RemoveContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addToRamWatchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.AddToRamWatchContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.freezeAddressToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.PokeContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pokeAddressToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.FreezeContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.unfreezeAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.UnfreezeAllContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator(); this.ContextMenuSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.viewInHexEditorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ViewInHexEditorContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator(); this.ContextMenuSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.clearPreviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ClearPreviewContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1 = new MenuStripEx(); this.menuStrip1 = new MenuStripEx();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.OpenMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.OpenMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -97,14 +97,14 @@
this.clearUndoHistoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.clearUndoHistoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.previewModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.previewModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.alwaysExcludeRamSearchListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ExcludeRamWatchMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.useUndoHistoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.useUndoHistoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
this.AutoloadDialogMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.AutoloadDialogMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveWindowPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SaveWinPositionMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.alwaysOnTopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.AlwaysOnTopMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.restoreOriginalWindowSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.RestoreDefaultsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MemDomainLabel = new System.Windows.Forms.Label(); this.MemDomainLabel = new System.Windows.Forms.Label();
this.MessageLabel = new System.Windows.Forms.Label(); this.MessageLabel = new System.Windows.Forms.Label();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
@ -114,7 +114,6 @@
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.NumberOfChangesBox = new BizHawk.UnsignedIntegerBox(); this.NumberOfChangesBox = new BizHawk.UnsignedIntegerBox();
this.SpecificAddressBox = new BizHawk.HexTextBox(); this.SpecificAddressBox = new BizHawk.HexTextBox();
this.SpecificValueBox = new BizHawk.MultiClient.WatchValueBox();
this.NumberOfChangesRadio = new System.Windows.Forms.RadioButton(); this.NumberOfChangesRadio = new System.Windows.Forms.RadioButton();
this.SpecificAddressRadio = new System.Windows.Forms.RadioButton(); this.SpecificAddressRadio = new System.Windows.Forms.RadioButton();
this.SpecificValueRadio = new System.Windows.Forms.RadioButton(); this.SpecificValueRadio = new System.Windows.Forms.RadioButton();
@ -140,6 +139,7 @@
this.LessThanOrEqualToRadio = new System.Windows.Forms.RadioButton(); this.LessThanOrEqualToRadio = new System.Windows.Forms.RadioButton();
this.GreaterThanRadio = new System.Windows.Forms.RadioButton(); this.GreaterThanRadio = new System.Windows.Forms.RadioButton();
this.LessThanRadio = new System.Windows.Forms.RadioButton(); this.LessThanRadio = new System.Windows.Forms.RadioButton();
this.SpecificValueBox = new BizHawk.MultiClient.WatchValueBox();
SearchMenuItem = new System.Windows.Forms.ToolStripMenuItem(); SearchMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
@ -216,100 +216,110 @@
// contextMenuStrip1 // contextMenuStrip1
// //
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.startNewSearchToolStripMenuItem, this.DoSearchContextMenuItem,
this.searchToolStripMenuItem2, this.NewSearchContextMenuItem,
this.toolStripSeparator9, this.ContextMenuSeparator1,
this.removeSelectedToolStripMenuItem1, this.RemoveContextMenuItem,
this.addToRamWatchToolStripMenuItem, this.AddToRamWatchContextMenuItem,
this.freezeAddressToolStripMenuItem1, this.PokeContextMenuItem,
this.pokeAddressToolStripMenuItem1, this.FreezeContextMenuItem,
this.unfreezeAllToolStripMenuItem, this.UnfreezeAllContextMenuItem,
this.toolStripSeparator12, this.ContextMenuSeparator2,
this.viewInHexEditorToolStripMenuItem, this.ViewInHexEditorContextMenuItem,
this.toolStripSeparator14, this.ContextMenuSeparator3,
this.clearPreviewToolStripMenuItem}); this.ClearPreviewContextMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1"; this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(216, 220); this.contextMenuStrip1.Size = new System.Drawing.Size(216, 242);
this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening);
// //
// startNewSearchToolStripMenuItem // DoSearchContextMenuItem
// //
this.startNewSearchToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.restart; this.DoSearchContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.search;
this.startNewSearchToolStripMenuItem.Name = "startNewSearchToolStripMenuItem"; this.DoSearchContextMenuItem.Name = "DoSearchContextMenuItem";
this.startNewSearchToolStripMenuItem.Size = new System.Drawing.Size(215, 22); this.DoSearchContextMenuItem.Size = new System.Drawing.Size(215, 22);
this.startNewSearchToolStripMenuItem.Text = "&Start New Search"; this.DoSearchContextMenuItem.Text = "&Search";
this.DoSearchContextMenuItem.Click += new System.EventHandler(this.SearchMenuItem_Click);
// //
// searchToolStripMenuItem2 // NewSearchContextMenuItem
// //
this.searchToolStripMenuItem2.Image = global::BizHawk.MultiClient.Properties.Resources.search; this.NewSearchContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.restart;
this.searchToolStripMenuItem2.Name = "searchToolStripMenuItem2"; this.NewSearchContextMenuItem.Name = "NewSearchContextMenuItem";
this.searchToolStripMenuItem2.Size = new System.Drawing.Size(215, 22); this.NewSearchContextMenuItem.Size = new System.Drawing.Size(215, 22);
this.searchToolStripMenuItem2.Text = "&Search"; this.NewSearchContextMenuItem.Text = "&Start New Search";
this.NewSearchContextMenuItem.Click += new System.EventHandler(this.NewSearchMenuMenuItem_Click);
// //
// toolStripSeparator9 // ContextMenuSeparator1
// //
this.toolStripSeparator9.Name = "toolStripSeparator9"; this.ContextMenuSeparator1.Name = "ContextMenuSeparator1";
this.toolStripSeparator9.Size = new System.Drawing.Size(212, 6); this.ContextMenuSeparator1.Size = new System.Drawing.Size(212, 6);
// //
// removeSelectedToolStripMenuItem1 // RemoveContextMenuItem
// //
this.removeSelectedToolStripMenuItem1.Image = global::BizHawk.MultiClient.Properties.Resources.Delete; this.RemoveContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Delete;
this.removeSelectedToolStripMenuItem1.Name = "removeSelectedToolStripMenuItem1"; this.RemoveContextMenuItem.Name = "RemoveContextMenuItem";
this.removeSelectedToolStripMenuItem1.ShortcutKeyDisplayString = "Del"; this.RemoveContextMenuItem.ShortcutKeyDisplayString = "Del";
this.removeSelectedToolStripMenuItem1.Size = new System.Drawing.Size(215, 22); this.RemoveContextMenuItem.Size = new System.Drawing.Size(215, 22);
this.removeSelectedToolStripMenuItem1.Text = "Remove Selected"; this.RemoveContextMenuItem.Text = "Remove Selected";
this.RemoveContextMenuItem.Click += new System.EventHandler(this.RemoveMenuItem_Click);
// //
// addToRamWatchToolStripMenuItem // AddToRamWatchContextMenuItem
// //
this.addToRamWatchToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.FindHS; this.AddToRamWatchContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.FindHS;
this.addToRamWatchToolStripMenuItem.Name = "addToRamWatchToolStripMenuItem"; this.AddToRamWatchContextMenuItem.Name = "AddToRamWatchContextMenuItem";
this.addToRamWatchToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+R"; this.AddToRamWatchContextMenuItem.ShortcutKeyDisplayString = "Ctrl+R";
this.addToRamWatchToolStripMenuItem.Size = new System.Drawing.Size(215, 22); this.AddToRamWatchContextMenuItem.Size = new System.Drawing.Size(215, 22);
this.addToRamWatchToolStripMenuItem.Text = "Add to Ram Watch"; this.AddToRamWatchContextMenuItem.Text = "Add to Ram Watch";
this.AddToRamWatchContextMenuItem.Click += new System.EventHandler(this.AddToRamWatchMenuItem_Click);
// //
// freezeAddressToolStripMenuItem1 // PokeContextMenuItem
// //
this.freezeAddressToolStripMenuItem1.Image = global::BizHawk.MultiClient.Properties.Resources.Freeze; this.PokeContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.poke;
this.freezeAddressToolStripMenuItem1.Name = "freezeAddressToolStripMenuItem1"; this.PokeContextMenuItem.Name = "PokeContextMenuItem";
this.freezeAddressToolStripMenuItem1.ShortcutKeyDisplayString = "Ctrl+F"; this.PokeContextMenuItem.ShortcutKeyDisplayString = "Ctrl+P";
this.freezeAddressToolStripMenuItem1.Size = new System.Drawing.Size(215, 22); this.PokeContextMenuItem.Size = new System.Drawing.Size(215, 22);
this.freezeAddressToolStripMenuItem1.Text = "Freeze Address"; this.PokeContextMenuItem.Text = "Poke Address";
this.PokeContextMenuItem.Click += new System.EventHandler(this.PokeAddressMenuItem_Click);
// //
// pokeAddressToolStripMenuItem1 // FreezeContextMenuItem
// //
this.pokeAddressToolStripMenuItem1.Image = global::BizHawk.MultiClient.Properties.Resources.poke; this.FreezeContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Freeze;
this.pokeAddressToolStripMenuItem1.Name = "pokeAddressToolStripMenuItem1"; this.FreezeContextMenuItem.Name = "FreezeContextMenuItem";
this.pokeAddressToolStripMenuItem1.ShortcutKeyDisplayString = "Ctrl+P"; this.FreezeContextMenuItem.ShortcutKeyDisplayString = "Ctrl+F";
this.pokeAddressToolStripMenuItem1.Size = new System.Drawing.Size(215, 22); this.FreezeContextMenuItem.Size = new System.Drawing.Size(215, 22);
this.pokeAddressToolStripMenuItem1.Text = "Poke Address"; this.FreezeContextMenuItem.Text = "Freeze Address";
this.FreezeContextMenuItem.Click += new System.EventHandler(this.FreezeAddressMenuItem_Click);
// //
// unfreezeAllToolStripMenuItem // UnfreezeAllContextMenuItem
// //
this.unfreezeAllToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Unfreeze; this.UnfreezeAllContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Unfreeze;
this.unfreezeAllToolStripMenuItem.Name = "unfreezeAllToolStripMenuItem"; this.UnfreezeAllContextMenuItem.Name = "UnfreezeAllContextMenuItem";
this.unfreezeAllToolStripMenuItem.Size = new System.Drawing.Size(215, 22); this.UnfreezeAllContextMenuItem.Size = new System.Drawing.Size(215, 22);
this.unfreezeAllToolStripMenuItem.Text = "Unfreeze &All"; this.UnfreezeAllContextMenuItem.Text = "Unfreeze &All";
this.UnfreezeAllContextMenuItem.Click += new System.EventHandler(this.UnfreezeAllContextMenuItem_Click);
// //
// toolStripSeparator12 // ContextMenuSeparator2
// //
this.toolStripSeparator12.Name = "toolStripSeparator12"; this.ContextMenuSeparator2.Name = "ContextMenuSeparator2";
this.toolStripSeparator12.Size = new System.Drawing.Size(212, 6); this.ContextMenuSeparator2.Size = new System.Drawing.Size(212, 6);
// //
// viewInHexEditorToolStripMenuItem // ViewInHexEditorContextMenuItem
// //
this.viewInHexEditorToolStripMenuItem.Name = "viewInHexEditorToolStripMenuItem"; this.ViewInHexEditorContextMenuItem.Name = "ViewInHexEditorContextMenuItem";
this.viewInHexEditorToolStripMenuItem.Size = new System.Drawing.Size(215, 22); this.ViewInHexEditorContextMenuItem.Size = new System.Drawing.Size(215, 22);
this.viewInHexEditorToolStripMenuItem.Text = "View in Hex Editor"; this.ViewInHexEditorContextMenuItem.Text = "View in Hex Editor";
this.ViewInHexEditorContextMenuItem.Click += new System.EventHandler(this.ViewInHexEditorContextMenuItem_Click);
// //
// toolStripSeparator14 // ContextMenuSeparator3
// //
this.toolStripSeparator14.Name = "toolStripSeparator14"; this.ContextMenuSeparator3.Name = "ContextMenuSeparator3";
this.toolStripSeparator14.Size = new System.Drawing.Size(212, 6); this.ContextMenuSeparator3.Size = new System.Drawing.Size(212, 6);
// //
// clearPreviewToolStripMenuItem // ClearPreviewContextMenuItem
// //
this.clearPreviewToolStripMenuItem.Name = "clearPreviewToolStripMenuItem"; this.ClearPreviewContextMenuItem.Name = "ClearPreviewContextMenuItem";
this.clearPreviewToolStripMenuItem.Size = new System.Drawing.Size(215, 22); this.ClearPreviewContextMenuItem.Size = new System.Drawing.Size(215, 22);
this.clearPreviewToolStripMenuItem.Text = "&Clear Preview"; this.ClearPreviewContextMenuItem.Text = "&Clear Preview";
this.ClearPreviewContextMenuItem.Click += new System.EventHandler(this.ClearPreviewContextMenuItem_Click);
// //
// menuStrip1 // menuStrip1
// //
@ -696,14 +706,14 @@
// //
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.previewModeToolStripMenuItem, this.previewModeToolStripMenuItem,
this.alwaysExcludeRamSearchListToolStripMenuItem, this.ExcludeRamWatchMenuItem,
this.useUndoHistoryToolStripMenuItem, this.useUndoHistoryToolStripMenuItem,
this.toolStripSeparator11, this.toolStripSeparator11,
this.AutoloadDialogMenuItem, this.AutoloadDialogMenuItem,
this.saveWindowPositionToolStripMenuItem, this.SaveWinPositionMenuItem,
this.alwaysOnTopToolStripMenuItem, this.AlwaysOnTopMenuItem,
this.toolStripSeparator3, this.toolStripSeparator3,
this.restoreOriginalWindowSizeToolStripMenuItem}); this.RestoreDefaultsMenuItem});
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20); this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
this.optionsToolStripMenuItem.Text = "&Options"; this.optionsToolStripMenuItem.Text = "&Options";
@ -716,12 +726,12 @@
this.previewModeToolStripMenuItem.Size = new System.Drawing.Size(240, 22); this.previewModeToolStripMenuItem.Size = new System.Drawing.Size(240, 22);
this.previewModeToolStripMenuItem.Text = "Preview Mode"; this.previewModeToolStripMenuItem.Text = "Preview Mode";
// //
// alwaysExcludeRamSearchListToolStripMenuItem // ExcludeRamWatchMenuItem
// //
this.alwaysExcludeRamSearchListToolStripMenuItem.Enabled = false; this.ExcludeRamWatchMenuItem.Name = "ExcludeRamWatchMenuItem";
this.alwaysExcludeRamSearchListToolStripMenuItem.Name = "alwaysExcludeRamSearchListToolStripMenuItem"; this.ExcludeRamWatchMenuItem.Size = new System.Drawing.Size(240, 22);
this.alwaysExcludeRamSearchListToolStripMenuItem.Size = new System.Drawing.Size(240, 22); this.ExcludeRamWatchMenuItem.Text = "Always Exclude Ram Search List";
this.alwaysExcludeRamSearchListToolStripMenuItem.Text = "Always Exclude Ram Search List"; this.ExcludeRamWatchMenuItem.Click += new System.EventHandler(this.ExcludeRamWatchMenuItem_Click);
// //
// useUndoHistoryToolStripMenuItem // useUndoHistoryToolStripMenuItem
// //
@ -742,31 +752,31 @@
this.AutoloadDialogMenuItem.Text = "Autoload"; this.AutoloadDialogMenuItem.Text = "Autoload";
this.AutoloadDialogMenuItem.Click += new System.EventHandler(this.AutoloadDialogMenuItem_Click); this.AutoloadDialogMenuItem.Click += new System.EventHandler(this.AutoloadDialogMenuItem_Click);
// //
// saveWindowPositionToolStripMenuItem // SaveWinPositionMenuItem
// //
this.saveWindowPositionToolStripMenuItem.Name = "saveWindowPositionToolStripMenuItem"; this.SaveWinPositionMenuItem.Name = "SaveWinPositionMenuItem";
this.saveWindowPositionToolStripMenuItem.Size = new System.Drawing.Size(240, 22); this.SaveWinPositionMenuItem.Size = new System.Drawing.Size(240, 22);
this.saveWindowPositionToolStripMenuItem.Text = "Save Window Position"; this.SaveWinPositionMenuItem.Text = "Save Window Position";
this.saveWindowPositionToolStripMenuItem.Click += new System.EventHandler(this.saveWindowPositionToolStripMenuItem_Click); this.SaveWinPositionMenuItem.Click += new System.EventHandler(this.saveWindowPositionToolStripMenuItem_Click);
// //
// alwaysOnTopToolStripMenuItem // AlwaysOnTopMenuItem
// //
this.alwaysOnTopToolStripMenuItem.Enabled = false; this.AlwaysOnTopMenuItem.Name = "AlwaysOnTopMenuItem";
this.alwaysOnTopToolStripMenuItem.Name = "alwaysOnTopToolStripMenuItem"; this.AlwaysOnTopMenuItem.Size = new System.Drawing.Size(240, 22);
this.alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(240, 22); this.AlwaysOnTopMenuItem.Text = "Always On Top";
this.alwaysOnTopToolStripMenuItem.Text = "Always On Top"; this.AlwaysOnTopMenuItem.Click += new System.EventHandler(this.AlwaysOnTopMenuItem_Click);
// //
// toolStripSeparator3 // toolStripSeparator3
// //
this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(237, 6); this.toolStripSeparator3.Size = new System.Drawing.Size(237, 6);
// //
// restoreOriginalWindowSizeToolStripMenuItem // RestoreDefaultsMenuItem
// //
this.restoreOriginalWindowSizeToolStripMenuItem.Enabled = false; this.RestoreDefaultsMenuItem.Name = "RestoreDefaultsMenuItem";
this.restoreOriginalWindowSizeToolStripMenuItem.Name = "restoreOriginalWindowSizeToolStripMenuItem"; this.RestoreDefaultsMenuItem.Size = new System.Drawing.Size(240, 22);
this.restoreOriginalWindowSizeToolStripMenuItem.Size = new System.Drawing.Size(240, 22); this.RestoreDefaultsMenuItem.Text = "Restore Default Settings";
this.restoreOriginalWindowSizeToolStripMenuItem.Text = "Restore Default Settings"; this.RestoreDefaultsMenuItem.Click += new System.EventHandler(this.RestoreDefaultsMenuItem_Click);
// //
// MemDomainLabel // MemDomainLabel
// //
@ -860,19 +870,6 @@
this.SpecificAddressBox.TabIndex = 26; this.SpecificAddressBox.TabIndex = 26;
this.SpecificAddressBox.TextChanged += new System.EventHandler(this.CompareToValue_TextChanged); this.SpecificAddressBox.TextChanged += new System.EventHandler(this.CompareToValue_TextChanged);
// //
// SpecificValueBox
//
this.SpecificValueBox.ByteSize = BizHawk.MultiClient.Watch.WatchSize.Byte;
this.SpecificValueBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.SpecificValueBox.Enabled = false;
this.SpecificValueBox.Location = new System.Drawing.Point(135, 38);
this.SpecificValueBox.MaxLength = 2;
this.SpecificValueBox.Name = "SpecificValueBox";
this.SpecificValueBox.Size = new System.Drawing.Size(65, 20);
this.SpecificValueBox.TabIndex = 24;
this.SpecificValueBox.Type = BizHawk.MultiClient.Watch.DisplayType.Hex;
this.SpecificValueBox.TextChanged += new System.EventHandler(this.CompareToValue_TextChanged);
//
// NumberOfChangesRadio // NumberOfChangesRadio
// //
this.NumberOfChangesRadio.AutoSize = true; this.NumberOfChangesRadio.AutoSize = true;
@ -1148,6 +1145,19 @@
this.LessThanRadio.UseVisualStyleBackColor = true; this.LessThanRadio.UseVisualStyleBackColor = true;
this.LessThanRadio.Click += new System.EventHandler(this.LessThanRadio_Click); this.LessThanRadio.Click += new System.EventHandler(this.LessThanRadio_Click);
// //
// SpecificValueBox
//
this.SpecificValueBox.ByteSize = BizHawk.MultiClient.Watch.WatchSize.Byte;
this.SpecificValueBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.SpecificValueBox.Enabled = false;
this.SpecificValueBox.Location = new System.Drawing.Point(135, 38);
this.SpecificValueBox.MaxLength = 2;
this.SpecificValueBox.Name = "SpecificValueBox";
this.SpecificValueBox.Size = new System.Drawing.Size(65, 20);
this.SpecificValueBox.TabIndex = 24;
this.SpecificValueBox.Type = BizHawk.MultiClient.Watch.DisplayType.Hex;
this.SpecificValueBox.TextChanged += new System.EventHandler(this.CompareToValue_TextChanged);
//
// NewRamSearch // NewRamSearch
// //
this.AllowDrop = true; this.AllowDrop = true;
@ -1196,8 +1206,8 @@
private System.Windows.Forms.ToolStripMenuItem SaveMenuItem; private System.Windows.Forms.ToolStripMenuItem SaveMenuItem;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem restoreOriginalWindowSizeToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem RestoreDefaultsMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveWindowPositionToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem SaveWinPositionMenuItem;
private System.Windows.Forms.Label MemDomainLabel; private System.Windows.Forms.Label MemDomainLabel;
private System.Windows.Forms.Label MessageLabel; private System.Windows.Forms.Label MessageLabel;
private System.Windows.Forms.ToolStripMenuItem RecentSubMenu; private System.Windows.Forms.ToolStripMenuItem RecentSubMenu;
@ -1212,31 +1222,31 @@
private System.Windows.Forms.ToolStripMenuItem AddToRamWatchMenuItem; private System.Windows.Forms.ToolStripMenuItem AddToRamWatchMenuItem;
private System.Windows.Forms.ToolStripMenuItem PokeAddressMenuItem; private System.Windows.Forms.ToolStripMenuItem PokeAddressMenuItem;
private System.Windows.Forms.ToolStripMenuItem TruncateFromFileMenuItem; private System.Windows.Forms.ToolStripMenuItem TruncateFromFileMenuItem;
private System.Windows.Forms.ToolStripMenuItem alwaysExcludeRamSearchListToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem ExcludeRamWatchMenuItem;
private System.Windows.Forms.ToolStripMenuItem CopyValueToPrevMenuItem; private System.Windows.Forms.ToolStripMenuItem CopyValueToPrevMenuItem;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem startNewSearchToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem NewSearchContextMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator9; private System.Windows.Forms.ToolStripSeparator ContextMenuSeparator1;
private System.Windows.Forms.ToolStripMenuItem searchToolStripMenuItem2; private System.Windows.Forms.ToolStripMenuItem DoSearchContextMenuItem;
private System.Windows.Forms.ToolStripMenuItem FreezeAddressMenuItem; private System.Windows.Forms.ToolStripMenuItem FreezeAddressMenuItem;
private System.Windows.Forms.ToolStripMenuItem removeSelectedToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem RemoveContextMenuItem;
private System.Windows.Forms.ToolStripMenuItem addToRamWatchToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem AddToRamWatchContextMenuItem;
private System.Windows.Forms.ToolStripMenuItem pokeAddressToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem PokeContextMenuItem;
private System.Windows.Forms.ToolStripMenuItem freezeAddressToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem FreezeContextMenuItem;
private MenuStripEx menuStrip1; private MenuStripEx menuStrip1;
private System.Windows.Forms.ToolTip toolTip1; private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem viewInHexEditorToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem ViewInHexEditorContextMenuItem;
private System.Windows.Forms.ToolStripMenuItem AutoloadDialogMenuItem; private System.Windows.Forms.ToolStripMenuItem AutoloadDialogMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator11; private System.Windows.Forms.ToolStripSeparator toolStripSeparator11;
private System.Windows.Forms.ToolStripMenuItem unfreezeAllToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem UnfreezeAllContextMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator12; private System.Windows.Forms.ToolStripSeparator ContextMenuSeparator3;
private System.Windows.Forms.ToolStripMenuItem alwaysOnTopToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem AlwaysOnTopMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13; private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
private System.Windows.Forms.ToolStripMenuItem clearUndoHistoryToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem clearUndoHistoryToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem useUndoHistoryToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem useUndoHistoryToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator14; private System.Windows.Forms.ToolStripSeparator ContextMenuSeparator2;
private System.Windows.Forms.ToolStripMenuItem clearPreviewToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem ClearPreviewContextMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripMenuItem newSearchToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem newSearchToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator7; private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;

View File

@ -40,6 +40,7 @@ namespace BizHawk.MultiClient
private int defaultHeight; private int defaultHeight;
private string _sortedColumn = ""; private string _sortedColumn = "";
private bool _sortReverse = false; private bool _sortReverse = false;
private bool forcePreviewClear = false;
#region Initialize, Load, and Save #region Initialize, Load, and Save
@ -126,6 +127,8 @@ namespace BizHawk.MultiClient
Size = new Size(Global.Config.RamSearchWidth, Global.Config.RamSearchHeight); Size = new Size(Global.Config.RamSearchWidth, Global.Config.RamSearchHeight);
} }
TopMost = Global.Config.RamSearchAlwaysOnTop;
LoadColumnInfo(); LoadColumnInfo();
} }
@ -166,6 +169,11 @@ namespace BizHawk.MultiClient
{ {
Searches = new RamSearchEngine(Settings); Searches = new RamSearchEngine(Settings);
Searches.Start(); Searches.Start();
if (Global.Config.RamSearchAlwaysExcludeRamWatch)
{
RemoveRamWatchesFromList();
}
SetTotal(); SetTotal();
WatchListView.ItemCount = Searches.Count; WatchListView.ItemCount = Searches.Count;
} }
@ -439,6 +447,11 @@ namespace BizHawk.MultiClient
ToolHelpers.FreezeAddress(SelectedWatches); ToolHelpers.FreezeAddress(SelectedWatches);
} }
private void RemoveRamWatchesFromList()
{
Searches.RemoveRange(Global.MainForm.NewRamWatch1.AddressList);
}
#endregion #endregion
#region Winform Events #region Winform Events
@ -709,6 +722,17 @@ namespace BizHawk.MultiClient
private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e) private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e)
{ {
AutoloadDialogMenuItem.Checked = Global.Config.RecentSearches.AutoLoad; AutoloadDialogMenuItem.Checked = Global.Config.RecentSearches.AutoLoad;
SaveWinPositionMenuItem.Checked = Global.Config.RamSearchSaveWindowPosition;
ExcludeRamWatchMenuItem.Checked = Global.Config.RamSearchAlwaysExcludeRamWatch;
}
private void ExcludeRamWatchMenuItem_Click(object sender, EventArgs e)
{
Global.Config.RamSearchAlwaysExcludeRamWatch ^= true;
if (Global.Config.RamSearchAlwaysExcludeRamWatch)
{
RemoveRamWatchesFromList();
}
} }
private void AutoloadDialogMenuItem_Click(object sender, EventArgs e) private void AutoloadDialogMenuItem_Click(object sender, EventArgs e)
@ -721,6 +745,85 @@ namespace BizHawk.MultiClient
Global.Config.RamSearchSaveWindowPosition ^= true; Global.Config.RamSearchSaveWindowPosition ^= true;
} }
private void AlwaysOnTopMenuItem_Click(object sender, EventArgs e)
{
Global.Config.RamSearchAlwaysOnTop ^= true;
TopMost = Global.Config.RamSearchAlwaysOnTop;
}
private void RestoreDefaultsMenuItem_Click(object sender, EventArgs e)
{
//TODO: finish
Global.Config.RamSearchAlwaysOnTop = TopMost = false;
Size = new Size(defaultWidth, defaultHeight);
}
#endregion
#region ContextMenu
private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
{
DoSearchContextMenuItem.Enabled = Searches.Count > 0;
RemoveContextMenuItem.Visible =
AddToRamWatchContextMenuItem.Visible =
PokeContextMenuItem.Visible =
FreezeContextMenuItem.Visible =
ContextMenuSeparator2.Visible =
ViewInHexEditorContextMenuItem.Visible =
SelectedIndices.Count > 0;
UnfreezeAllContextMenuItem.Visible = Global.CheatList.Any();
ContextMenuSeparator3.Visible = (SelectedIndices.Count > 0) || (Global.CheatList.Any());
bool allCheats = true;
foreach (int index in SelectedIndices)
{
if (!Global.CheatList.IsActiveCheat(Settings.Domain, Searches[index].Address.Value))
{
allCheats = false;
}
}
if (allCheats)
{
FreezeContextMenuItem.Text = "&Unfreeze address";
FreezeContextMenuItem.Image = Properties.Resources.Unfreeze;
}
else
{
FreezeContextMenuItem.Text = "&Freeze address";
FreezeContextMenuItem.Image = Properties.Resources.Freeze;
}
}
private void UnfreezeAllContextMenuItem_Click(object sender, EventArgs e)
{
ToolHelpers.UnfreezeAll();
}
private void ViewInHexEditorContextMenuItem_Click(object sender, EventArgs e)
{
if (SelectedIndices.Count > 0)
{
Global.MainForm.LoadHexEditor();
Global.MainForm.HexEditor1.SetDomain(Settings.Domain);
Global.MainForm.HexEditor1.GoToAddress(Searches[SelectedIndices[0]].Address.Value);
//TODO: secondary highlighted on remaining indexes
}
}
private void ClearPreviewContextMenuItem_Click(object sender, EventArgs e)
{
forcePreviewClear = true;
WatchListView.Refresh();
}
#endregion #endregion
#region Compare To Box #region Compare To Box

View File

@ -450,7 +450,7 @@ namespace BizHawk.MultiClient
} }
} }
if (Global.Config.AlwaysExcludeRamWatch) if (Global.Config.RamSearchAlwaysExcludeRamWatch)
ExcludeRamWatchList(); ExcludeRamWatchList();
SetSpecificValueBoxMaxLength(); SetSpecificValueBoxMaxLength();
MessageLabel.Text = "New search started"; MessageLabel.Text = "New search started";
@ -1897,7 +1897,7 @@ namespace BizHawk.MultiClient
fastModeToolStripMenuItem.Checked = Global.Config.RamSearchFastMode; fastModeToolStripMenuItem.Checked = Global.Config.RamSearchFastMode;
saveWindowPositionToolStripMenuItem.Checked = Global.Config.RamSearchSaveWindowPosition; saveWindowPositionToolStripMenuItem.Checked = Global.Config.RamSearchSaveWindowPosition;
previewModeToolStripMenuItem.Checked = Global.Config.RamSearchPreviewMode; previewModeToolStripMenuItem.Checked = Global.Config.RamSearchPreviewMode;
alwaysExcludeRamSearchListToolStripMenuItem.Checked = Global.Config.AlwaysExcludeRamWatch; alwaysExcludeRamSearchListToolStripMenuItem.Checked = Global.Config.RamSearchAlwaysExcludeRamWatch;
autoloadDialogToolStripMenuItem.Checked = Global.Config.RecentSearches.AutoLoad; autoloadDialogToolStripMenuItem.Checked = Global.Config.RecentSearches.AutoLoad;
} }
@ -2176,7 +2176,7 @@ namespace BizHawk.MultiClient
private void alwaysExcludeRamSearchListToolStripMenuItem_Click(object sender, EventArgs e) private void alwaysExcludeRamSearchListToolStripMenuItem_Click(object sender, EventArgs e)
{ {
Global.Config.AlwaysExcludeRamWatch ^= true; Global.Config.RamSearchAlwaysExcludeRamWatch ^= true;
} }
private void CopyValueToPrev() private void CopyValueToPrev()