Lua console - hack to fix reloading a script if it is not enabled

This commit is contained in:
adelikat 2019-11-17 12:51:08 -06:00
parent 4c57718f7d
commit b65f7ae8d9
1 changed files with 6 additions and 3 deletions

View File

@ -267,10 +267,13 @@ namespace BizHawk.Client.EmuHawk
private void OnChanged(object source, FileSystemEventArgs e)
{
Invoke(new MethodInvoker(delegate
// Even after _watches is cleared, these callbacks hang around! So this check is necessary
var script = LuaImp.ScriptList.FirstOrDefault(s => s.Path == e.FullPath && s.Enabled);
if (script != null)
{
RefreshScriptMenuItem_Click(null, null);
}));
Invoke(new MethodInvoker(delegate { RefreshScriptMenuItem_Click(null, null); }));
}
}
public void LoadLuaFile(string path)