From 3857c27f93c081eea2ef34edcf3aa393eb32cfa5 Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 19 Sep 2013 13:53:38 +0000 Subject: [PATCH] Ram Watch - don't refresh dialog if no addresses (keeps the dialog from slowing the emulator down when it has no watches) --- BizHawk.MultiClient/tools/Watch/RamWatch.cs | 43 ++++++++++++--------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/BizHawk.MultiClient/tools/Watch/RamWatch.cs b/BizHawk.MultiClient/tools/Watch/RamWatch.cs index 4e23790d25..5e4959f0f9 100644 --- a/BizHawk.MultiClient/tools/Watch/RamWatch.cs +++ b/BizHawk.MultiClient/tools/Watch/RamWatch.cs @@ -53,30 +53,35 @@ namespace BizHawk.MultiClient { return; } - Watches.UpdateValues(); - if (Global.Config.DisplayRamWatch) + if (Watches.Any()) { - for (int x = 0; x < Watches.Count; x++) + Watches.UpdateValues(); + + if (Global.Config.DisplayRamWatch) { - bool alert = Watches[x].IsSeparator ? false : Global.CheatList.IsActiveCheat(Watches[x].Domain, Watches[x].Address.Value); - Global.OSD.AddGUIText( - Watches[x].ToString(), - Global.Config.DispRamWatchx, - (Global.Config.DispRamWatchy + (x * 14)), - alert, - Color.Black, - Color.White, - 0 - ); + for (int x = 0; x < Watches.Count; x++) + { + bool alert = Watches[x].IsSeparator ? false : Global.CheatList.IsActiveCheat(Watches[x].Domain, Watches[x].Address.Value); + Global.OSD.AddGUIText( + Watches[x].ToString(), + Global.Config.DispRamWatchx, + (Global.Config.DispRamWatchy + (x * 14)), + alert, + Color.Black, + Color.White, + 0 + ); + } } + + + if (!IsHandleCreated || IsDisposed) return; + + WatchListView.BlazingFast = true; + WatchListView.Refresh(); + WatchListView.BlazingFast = false; } - - if (!IsHandleCreated || IsDisposed) return; - - WatchListView.BlazingFast = true; - WatchListView.Refresh(); - WatchListView.BlazingFast = false; } public void Restart()