From 4e7d03d9a3293a33047d72a2a979b243788f149c Mon Sep 17 00:00:00 2001 From: feos Date: Thu, 22 Oct 2015 19:33:04 +0300 Subject: [PATCH] tastudio: clean up garbage lua text and drawings. - text was written twice if we update tools and PauseOnFrame (seek) within one frame. - drawings didn't update during turbo even when RunScriptsDuringTurbo was on, but a whole bunch of accumulated drawings was appearing at once, when you do a normal advance after turbo mode. --- BizHawk.Client.EmuHawk/MainForm.cs | 5 +++-- BizHawk.Client.EmuHawk/tools/ToolManager.cs | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 14408cb457..b1f318ef21 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -612,8 +612,9 @@ namespace BizHawk.Client.EmuHawk if (value == null) // TODO: make an Event handler instead, but the logic here is that after turbo seeking, tools will want to do a real update when the emulator finally pauses { - GlobalWin.Tools.UpdateToolsBefore(); - GlobalWin.Tools.UpdateToolsAfter(); + bool skipScripts = !(Global.Config.TurboSeek && !Global.Config.RunLuaDuringTurbo); + GlobalWin.Tools.UpdateToolsBefore(skipScripts); + GlobalWin.Tools.UpdateToolsAfter(skipScripts); } } } diff --git a/BizHawk.Client.EmuHawk/tools/ToolManager.cs b/BizHawk.Client.EmuHawk/tools/ToolManager.cs index 53000ef1e9..7695d18771 100644 --- a/BizHawk.Client.EmuHawk/tools/ToolManager.cs +++ b/BizHawk.Client.EmuHawk/tools/ToolManager.cs @@ -566,6 +566,11 @@ namespace BizHawk.Client.EmuHawk tool.FastUpdate(); } } + + if (Global.Config.RunLuaDuringTurbo && Has()) + { + LuaConsole.EndLuaDrawing(); + } } public bool IsAvailable()