Properly start scripts after loading Lua session

Previously, scripts would display as enabled but not actually run until toggled off and on.
This commit is contained in:
kalimag 2022-11-27 19:53:57 +01:00 committed by James Groom
parent 0effd435f6
commit 5d143ca879
1 changed files with 14 additions and 8 deletions

View File

@ -501,16 +501,24 @@ namespace BizHawk.Client.EmuHawk
{
var result = LuaImp.ScriptList.Load(path, Settings.DisableLuaScriptsOnLoad);
RunLuaScripts();
UpdateDialog();
LuaImp.ScriptList.Changes = false;
Config.RecentLuaSession.Add(path);
foreach (var script in LuaImp.ScriptList)
{
Config.RecentLua.Add(script.Path);
if (!script.IsSeparator)
{
if (script.Enabled)
{
EnableLuaFile(script);
}
Config.RecentLua.Add(script.Path);
}
}
LuaImp.ScriptList.Changes = false;
Config.RecentLuaSession.Add(path);
UpdateDialog();
AddFileWatches();
ClearOutputWindow();
return result;
}
@ -678,8 +686,6 @@ namespace BizHawk.Client.EmuHawk
Config.RecentLuaSession.HandleLoadError(MainForm, path);
}
}
AddFileWatches();
}
public override bool AskSaveChanges()