Lua console - respect the "reload scripts on load" flag in some places that were ignoring it

This commit is contained in:
adelikat 2019-11-17 11:25:23 -06:00
parent 9f2ea48d2b
commit 16f977a87c
1 changed files with 8 additions and 5 deletions

View File

@ -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);
}
}
}