From 16f977a87cc72afc1ccb6141a4981f2d520afc30 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 17 Nov 2019 11:25:23 -0600 Subject: [PATCH] Lua console - respect the "reload scripts on load" flag in some places that were ignoring it --- BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs index c9819e3837..e3d4a9d651 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs @@ -235,13 +235,16 @@ namespace BizHawk.Client.EmuHawk private void AddFileWatches() { - _watches.Clear(); - foreach (var item in LuaImp.ScriptList.Where(s => !s.IsSeparator)) + if (Global.Config.LuaReloadOnScriptFileChange) { - var processedPath = PathManager.TryMakeRelative(item.Path); - string pathToLoad = ProcessPath(processedPath); + _watches.Clear(); + foreach (var item in LuaImp.ScriptList.Where(s => !s.IsSeparator)) + { + var processedPath = PathManager.TryMakeRelative(item.Path); + string pathToLoad = ProcessPath(processedPath); - CreateFileWatcher(pathToLoad); + CreateFileWatcher(pathToLoad); + } } }