Remove obsolete `LuaConsole.RunLuaScripts`
Method is mostly a duplicate of `EnableLuaFile`, only called when loading a session or an already loaded script. In either case it didn't actually start the scripts due to an inverted condition, and would stop running scripts without doing the required cleanup.
This commit is contained in:
parent
5d143ca879
commit
564a1e4a67
|
@ -341,36 +341,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
UpdateRegisteredFunctionsDialog();
|
||||
}
|
||||
|
||||
private void RunLuaScripts()
|
||||
{
|
||||
foreach (var file in LuaImp.ScriptList.Where(s => !s.IsSeparator))
|
||||
{
|
||||
if (!file.Enabled && file.Thread is null)
|
||||
{
|
||||
try
|
||||
{
|
||||
LuaSandbox.Sandbox(null, () =>
|
||||
{
|
||||
string pathToLoad = ProcessPath(file.Path);
|
||||
LuaImp.SpawnAndSetFileThread(file.Path, file);
|
||||
LuaSandbox.CreateSandbox(file.Thread, Path.GetDirectoryName(pathToLoad));
|
||||
}, () =>
|
||||
{
|
||||
file.State = LuaFile.RunState.Disabled;
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DialogController.ShowMessageBox(e.ToString());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
file.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SessionChangedCallback()
|
||||
{
|
||||
OutputMessages.Text =
|
||||
|
|
Loading…
Reference in New Issue