From aea17282ccd4c8bd039d8d248b7a1efa2d8e5869 Mon Sep 17 00:00:00 2001 From: adelikat Date: Fri, 2 Jan 2015 15:27:54 +0000 Subject: [PATCH] ToolManager - remove CloseIfDisposed, it was only being called when a tool is specifically told to restart by client code, seems like a vestigial hack workaround to cleanup improperly closed things if they are called upon. Add in the Ram Watch hack to UpdateValues. All of this fixes Ram Watch autoload when the on screen display option is checked --- BizHawk.Client.EmuHawk/tools/ToolManager.cs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/ToolManager.cs b/BizHawk.Client.EmuHawk/tools/ToolManager.cs index 90b4184553..1b1d0ba5fc 100644 --- a/BizHawk.Client.EmuHawk/tools/ToolManager.cs +++ b/BizHawk.Client.EmuHawk/tools/ToolManager.cs @@ -338,11 +338,14 @@ namespace BizHawk.Client.EmuHawk /// public void UpdateValues() where T : IToolForm { - CloseIfDisposed(); var tool = _tools.FirstOrDefault(x => x is T); if (tool != null) { - tool.UpdateValues(); + if (!tool.IsDisposed || + (tool is RamWatch && Global.Config.DisplayRamWatch)) // Ram Watch hack, on screen display should run even if Ram Watch is closed + { + tool.UpdateValues(); + } } } @@ -385,7 +388,6 @@ namespace BizHawk.Client.EmuHawk /// public void Restart() where T : IToolForm { - CloseIfDisposed(); var tool = _tools.FirstOrDefault(x => x is T); if (tool != null) { @@ -475,15 +477,6 @@ namespace BizHawk.Client.EmuHawk return tool; } - private void CloseIfDisposed() where T : IToolForm - { - var existingTool = _tools.FirstOrDefault(x => x is T); - if (existingTool != null && existingTool.IsDisposed) - { - Close(); - } - } - public void UpdateToolsBefore(bool fromLua = false) { if (Has())