diff --git a/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Gui.cs b/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Gui.cs index ec414856c7..44d0ee6227 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Gui.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Gui.cs @@ -70,6 +70,11 @@ namespace BizHawk.Client.EmuHawk _luaSurface = null; } + public bool HasLuaSurface + { + get { return _luaSurface != null; } + } + #endregion #region Helpers diff --git a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs index 61da71b365..de8a91b052 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs @@ -103,6 +103,11 @@ namespace BizHawk.Client.EmuHawk public void Restart() { + if (LuaImp != null && LuaImp.GuiLibrary != null && LuaImp.GuiLibrary.HasLuaSurface) + { + LuaImp.GuiLibrary.DrawFinish(); + } + LuaImp = new EmuLuaLibrary(this); InputBox.AutoCompleteCustomSource.AddRange(LuaImp.Docs.Select(a => a.Library + "." + a.Name).ToArray()); UpdateDialog(); @@ -340,7 +345,13 @@ namespace BizHawk.Client.EmuHawk public bool LoadLuaSession(string path) { - return _luaList.LoadLuaSession(path); + var result = _luaList.LoadLuaSession(path); + + RunLuaScripts(); + UpdateDialog(); + _luaList.Changes = false; + + return result; } ///