From 9f2ea48d2b4b1b178e9b60a64e9970c48a647546 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 17 Nov 2019 09:53:19 -0600 Subject: [PATCH] Ram Watch - clear and update on screen drawing better --- .../tools/Watch/RamWatch.Designer.cs | 10 +++++----- BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs | 16 ++++++++++------ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.Designer.cs b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.Designer.cs index a353a41066..527e37fa66 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.Designer.cs @@ -897,7 +897,7 @@ this.WatchListView.UseCustomBackground = true; this.WatchListView.ColumnClick += new BizHawk.Client.EmuHawk.InputRoll.ColumnClickEventHandler(this.WatchListView_ColumnClick); this.WatchListView.SelectedIndexChanged += new System.EventHandler(this.WatchListView_SelectedIndexChanged); - this.WatchListView.DragDrop += new System.Windows.Forms.DragEventHandler(this.NewRamWatch_DragDrop); + this.WatchListView.DragDrop += new System.Windows.Forms.DragEventHandler(this.RamWatch_DragDrop); this.WatchListView.DragEnter += new System.Windows.Forms.DragEventHandler(this.DragEnterWrapper); this.WatchListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.WatchListView_KeyDown); this.WatchListView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.WatchListView_MouseDoubleClick); @@ -916,11 +916,11 @@ this.Name = "RamWatch"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = " RAM Watch"; - this.Activated += new System.EventHandler(this.NewRamWatch_Activated); - this.Load += new System.EventHandler(this.NewRamWatch_Load); - this.DragDrop += new System.Windows.Forms.DragEventHandler(this.NewRamWatch_DragDrop); + this.Activated += new System.EventHandler(this.RamWatch_Activated); + this.Load += new System.EventHandler(this.RamWatch_Load); + this.DragDrop += new System.Windows.Forms.DragEventHandler(this.RamWatch_DragDrop); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.DragEnterWrapper); - this.Enter += new System.EventHandler(this.NewRamWatch_Enter); + this.Enter += new System.EventHandler(this.RamWatch_Enter); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.WatchListView_KeyDown); this.ListViewContextMenu.ResumeLayout(false); this.statusStrip1.ResumeLayout(false); diff --git a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs index 71b1439ea7..ec87698b4c 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs @@ -168,6 +168,7 @@ namespace BizHawk.Client.EmuHawk Global.Config.RecentWatches.Add(path); WatchListView.RowCount = _watches.Count; UpdateWatchCount(); + UpdateValues(); UpdateStatusBar(); _watches.Changes = false; } @@ -191,7 +192,7 @@ namespace BizHawk.Client.EmuHawk UpdateWatchCount(); Global.Config.RecentWatches.Add(_watches.CurrentFileName); UpdateStatusBar(); - + UpdateValues(); PokeAddressToolBarItem.Enabled = FreezeAddressToolBarItem.Enabled = SelectedIndices.Any() && @@ -214,6 +215,7 @@ namespace BizHawk.Client.EmuHawk { _watches.RefreshDomains(MemoryDomains); _watches.Reload(); + UpdateValues(); UpdateStatusBar(); } else @@ -239,6 +241,7 @@ namespace BizHawk.Client.EmuHawk return; } + GlobalWin.OSD.ClearGUIText(); if (_watches.Any()) { _watches.UpdateValues(); @@ -520,6 +523,7 @@ namespace BizHawk.Client.EmuHawk { _watches.Clear(); WatchListView.RowCount = _watches.Count; + UpdateValues(); UpdateWatchCount(); UpdateStatusBar(); _sortReverse = false; @@ -1076,7 +1080,7 @@ namespace BizHawk.Client.EmuHawk #region Dialog, Context Menu, and ListView Events - private void NewRamWatch_Load(object sender, EventArgs e) + private void RamWatch_Load(object sender, EventArgs e) { // Hack for previous config settings if (Settings.Columns.Any(c => string.IsNullOrWhiteSpace(c.Text))) @@ -1089,7 +1093,6 @@ namespace BizHawk.Client.EmuHawk LoadConfigSettings(); RamWatchMenu.Items.Add(WatchListView.ToColumnsMenu(ColumnToggleCallback)); UpdateStatusBar(); - PokeAddressToolBarItem.Enabled = FreezeAddressToolBarItem.Enabled = SelectedIndices.Any() && @@ -1101,12 +1104,12 @@ namespace BizHawk.Client.EmuHawk Settings.Columns = WatchListView.AllColumns; } - private void NewRamWatch_Activated(object sender, EventArgs e) + private void RamWatch_Activated(object sender, EventArgs e) { WatchListView.Refresh(); } - private void NewRamWatch_DragDrop(object sender, DragEventArgs e) + private void RamWatch_DragDrop(object sender, DragEventArgs e) { var filePaths = (string[])e.Data.GetData(DataFormats.FileDrop); if (Path.GetExtension(filePaths[0]) == ".wch") @@ -1114,10 +1117,11 @@ namespace BizHawk.Client.EmuHawk _watches.Load(filePaths[0], append: false); Global.Config.RecentWatches.Add(_watches.CurrentFileName); WatchListView.RowCount = _watches.Count; + UpdateValues(); } } - private void NewRamWatch_Enter(object sender, EventArgs e) + private void RamWatch_Enter(object sender, EventArgs e) { WatchListView.Focus(); }