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:
kalimag 2022-11-27 19:53:58 +01:00 committed by James Groom
parent 5d143ca879
commit 564a1e4a67
1 changed files with 0 additions and 30 deletions

View File

@ -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 =