diff --git a/BizHawk.MultiClient/tools/Cheats.cs b/BizHawk.MultiClient/tools/Cheats.cs index d527bb094a..53c72acf0c 100644 --- a/BizHawk.MultiClient/tools/Cheats.cs +++ b/BizHawk.MultiClient/tools/Cheats.cs @@ -73,17 +73,20 @@ namespace BizHawk.MultiClient private void CheatListView_QueryItemBkColor(int index, int column, ref Color color) { - if (Global.CheatList.Cheat(index).address < 0) + if (index < Global.CheatList.Count) { - color = Color.DarkGray; - } - else if (Global.CheatList.Cheat(index).IsEnabled()) - { - color = Color.LightCyan; - } - else - { - color = this.BackColor; + if (Global.CheatList.Cheat(index).address < 0) + { + color = Color.DarkGray; + } + else if (Global.CheatList.Cheat(index).IsEnabled()) + { + color = Color.LightCyan; + } + else + { + color = this.BackColor; + } } } @@ -198,6 +201,10 @@ namespace BizHawk.MultiClient if (!this.IsHandleCreated || this.IsDisposed) return; DisplayCheatsList(); CheatListView.Refresh(); + + Global.MainForm.RamWatch1.UpdateValues(); + Global.MainForm.RamSearch1.UpdateValues(); + Global.MainForm.HexEditor1.UpdateValues(); } public void RemoveCheat(Cheat c) @@ -210,6 +217,9 @@ namespace BizHawk.MultiClient if (!this.IsHandleCreated || this.IsDisposed) return; DisplayCheatsList(); CheatListView.Refresh(); + Global.MainForm.RamWatch1.UpdateValues(); + Global.MainForm.RamSearch1.UpdateValues(); + Global.MainForm.HexEditor1.UpdateValues(); } public void LoadCheatFromRecent(string file) @@ -779,6 +789,10 @@ namespace BizHawk.MultiClient } } CheatListView.Refresh(); + + Global.MainForm.RamWatch1.UpdateValues(); + Global.MainForm.RamSearch1.UpdateValues(); + Global.MainForm.HexEditor1.UpdateValues(); } UpdateNumberOfCheats(); } diff --git a/BizHawk.MultiClient/tools/HexEditor.cs b/BizHawk.MultiClient/tools/HexEditor.cs index e25e370eb7..0245313031 100644 --- a/BizHawk.MultiClient/tools/HexEditor.cs +++ b/BizHawk.MultiClient/tools/HexEditor.cs @@ -792,9 +792,13 @@ namespace BizHawk.MultiClient public int GetHighlightedAddress() { if (addressHighlighted >= 0) + { return addressHighlighted; + } else + { return -1; //Negative = no address highlighted + } } private bool IsFrozen(int address) @@ -824,6 +828,10 @@ namespace BizHawk.MultiClient FreezeAddress(addr); } } + + Global.MainForm.RamSearch1.UpdateValues(); + Global.MainForm.RamWatch1.UpdateValues(); + Global.MainForm.Cheats1.UpdateValues(); } private void UnFreezeAddress(int address) @@ -1640,6 +1648,10 @@ namespace BizHawk.MultiClient { Global.MainForm.Cheats1.RemoveAllCheats(); MemoryViewerBox.Refresh(); + + Global.MainForm.RamSearch1.UpdateValues(); + Global.MainForm.RamWatch1.UpdateValues(); + Global.MainForm.Cheats1.UpdateValues(); } private void unfreezeAllToolStripMenuItem_Click(object sender, EventArgs e) diff --git a/BizHawk.MultiClient/tools/RamSearch.cs b/BizHawk.MultiClient/tools/RamSearch.cs index 1eedfa95c8..0d23314f17 100644 --- a/BizHawk.MultiClient/tools/RamSearch.cs +++ b/BizHawk.MultiClient/tools/RamSearch.cs @@ -2295,6 +2295,9 @@ namespace BizHawk.MultiClient } UpdateValues(); + Global.MainForm.HexEditor1.UpdateValues(); + Global.MainForm.RamWatch1.UpdateValues(); + Global.MainForm.Cheats1.UpdateValues(); } } @@ -2372,6 +2375,9 @@ namespace BizHawk.MultiClient } UpdateValues(); + Global.MainForm.HexEditor1.UpdateValues(); + Global.MainForm.RamWatch1.UpdateValues(); + Global.MainForm.Cheats1.UpdateValues(); } } @@ -2661,6 +2667,10 @@ namespace BizHawk.MultiClient { Global.MainForm.Cheats1.RemoveAllCheats(); UpdateValues(); + + Global.MainForm.RamWatch1.UpdateValues(); + Global.MainForm.HexEditor1.UpdateValues(); + Global.MainForm.Cheats1.UpdateValues(); } } } diff --git a/BizHawk.MultiClient/tools/RamWatch.Designer.cs b/BizHawk.MultiClient/tools/RamWatch.Designer.cs index 00eb25650a..059dd86759 100644 --- a/BizHawk.MultiClient/tools/RamWatch.Designer.cs +++ b/BizHawk.MultiClient/tools/RamWatch.Designer.cs @@ -78,6 +78,7 @@ this.duplicateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.pokeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.freezeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.unfreezeAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.viewInHexEditorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); this.insertSeperatorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -115,7 +116,6 @@ this.Diff = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.DomainColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.Notes = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.unfreezeAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout(); this.toolStrip1.SuspendLayout(); @@ -503,7 +503,7 @@ this.showDifferenceToolStripMenuItem, this.showDomainToolStripMenuItem}); this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(204, 324); + this.contextMenuStrip1.Size = new System.Drawing.Size(204, 346); this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening); // // editToolStripMenuItem @@ -551,17 +551,25 @@ this.freezeToolStripMenuItem.Text = "&Freeze"; this.freezeToolStripMenuItem.Click += new System.EventHandler(this.freezeToolStripMenuItem_Click); // + // unfreezeAllToolStripMenuItem + // + this.unfreezeAllToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Unfreeze; + this.unfreezeAllToolStripMenuItem.Name = "unfreezeAllToolStripMenuItem"; + this.unfreezeAllToolStripMenuItem.Size = new System.Drawing.Size(203, 22); + this.unfreezeAllToolStripMenuItem.Text = "Unfreeze &All"; + this.unfreezeAllToolStripMenuItem.Click += new System.EventHandler(this.unfreezeAllToolStripMenuItem_Click); + // // viewInHexEditorToolStripMenuItem // this.viewInHexEditorToolStripMenuItem.Name = "viewInHexEditorToolStripMenuItem"; - this.viewInHexEditorToolStripMenuItem.Size = new System.Drawing.Size(188, 22); + this.viewInHexEditorToolStripMenuItem.Size = new System.Drawing.Size(203, 22); this.viewInHexEditorToolStripMenuItem.Text = "View in Hex Editor"; this.viewInHexEditorToolStripMenuItem.Click += new System.EventHandler(this.viewInHexEditorToolStripMenuItem_Click); // // toolStripSeparator6 // this.toolStripSeparator6.Name = "toolStripSeparator6"; - this.toolStripSeparator6.Size = new System.Drawing.Size(185, 6); + this.toolStripSeparator6.Size = new System.Drawing.Size(200, 6); // // insertSeperatorToolStripMenuItem // @@ -593,33 +601,33 @@ // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(185, 6); + this.toolStripSeparator2.Size = new System.Drawing.Size(200, 6); // // showChangeCountsToolStripMenuItem1 // this.showChangeCountsToolStripMenuItem1.Name = "showChangeCountsToolStripMenuItem1"; - this.showChangeCountsToolStripMenuItem1.Size = new System.Drawing.Size(188, 22); + this.showChangeCountsToolStripMenuItem1.Size = new System.Drawing.Size(203, 22); this.showChangeCountsToolStripMenuItem1.Text = "Show Change Counts"; this.showChangeCountsToolStripMenuItem1.Click += new System.EventHandler(this.showChangeCountsToolStripMenuItem_Click); // // showPreviousValueToolStripMenuItem1 // this.showPreviousValueToolStripMenuItem1.Name = "showPreviousValueToolStripMenuItem1"; - this.showPreviousValueToolStripMenuItem1.Size = new System.Drawing.Size(188, 22); + this.showPreviousValueToolStripMenuItem1.Size = new System.Drawing.Size(203, 22); this.showPreviousValueToolStripMenuItem1.Text = "Show Previous Value"; this.showPreviousValueToolStripMenuItem1.Click += new System.EventHandler(this.showPreviousValueToolStripMenuItem_Click); // // showDifferenceToolStripMenuItem // this.showDifferenceToolStripMenuItem.Name = "showDifferenceToolStripMenuItem"; - this.showDifferenceToolStripMenuItem.Size = new System.Drawing.Size(188, 22); + this.showDifferenceToolStripMenuItem.Size = new System.Drawing.Size(203, 22); this.showDifferenceToolStripMenuItem.Text = "Show Difference"; this.showDifferenceToolStripMenuItem.Click += new System.EventHandler(this.showDifferenceToolStripMenuItem_Click); // // showDomainToolStripMenuItem // this.showDomainToolStripMenuItem.Name = "showDomainToolStripMenuItem"; - this.showDomainToolStripMenuItem.Size = new System.Drawing.Size(188, 22); + this.showDomainToolStripMenuItem.Size = new System.Drawing.Size(203, 22); this.showDomainToolStripMenuItem.Text = "Show Domain"; this.showDomainToolStripMenuItem.Click += new System.EventHandler(this.showDomainToolStripMenuItem_Click); // @@ -893,13 +901,6 @@ this.Notes.Text = "Notes"; this.Notes.Width = 128; // - // unfreezeAllToolStripMenuItem - // - this.unfreezeAllToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Unfreeze; - this.unfreezeAllToolStripMenuItem.Name = "unfreezeAllToolStripMenuItem"; - this.unfreezeAllToolStripMenuItem.Size = new System.Drawing.Size(188, 22); - this.unfreezeAllToolStripMenuItem.Text = "Unfreeze &All"; - // // RamWatch // this.AllowDrop = true; diff --git a/BizHawk.MultiClient/tools/RamWatch.cs b/BizHawk.MultiClient/tools/RamWatch.cs index 5ad6838a69..19f6893a6d 100644 --- a/BizHawk.MultiClient/tools/RamWatch.cs +++ b/BizHawk.MultiClient/tools/RamWatch.cs @@ -1242,9 +1242,13 @@ namespace BizHawk.MultiClient private void freezeToolStripMenuItem_Click(object sender, EventArgs e) { if (sender.ToString().Contains("Unfreeze")) + { UnfreezeAddress(); + } else + { FreezeAddress(); + } } private int WORDGetLowerByte(int value) @@ -1330,6 +1334,10 @@ namespace BizHawk.MultiClient } } } + UpdateValues(); + Global.MainForm.RamSearch1.UpdateValues(); + Global.MainForm.HexEditor1.UpdateValues(); + Global.MainForm.Cheats1.UpdateValues(); } private void UnfreezeAddress() @@ -1357,6 +1365,10 @@ namespace BizHawk.MultiClient } } } + UpdateValues(); + Global.MainForm.RamSearch1.UpdateValues(); + Global.MainForm.HexEditor1.UpdateValues(); + Global.MainForm.Cheats1.UpdateValues(); } private void freezeAddressToolStripMenuItem_Click(object sender, EventArgs e) @@ -1689,5 +1701,15 @@ namespace BizHawk.MultiClient { SetDomain(); } + + private void unfreezeAllToolStripMenuItem_Click(object sender, EventArgs e) + { + Global.MainForm.Cheats1.RemoveAllCheats(); + UpdateValues(); + + Global.MainForm.RamSearch1.UpdateValues(); + Global.MainForm.HexEditor1.UpdateValues(); + Global.MainForm.Cheats1.UpdateValues(); + } } } \ No newline at end of file