Lua - clear out lua drawing surface on restart

This commit is contained in:
adelikat 2015-01-29 03:36:19 +00:00
parent 307845b3b5
commit 6f2488aa57
2 changed files with 17 additions and 1 deletions

View File

@ -70,6 +70,11 @@ namespace BizHawk.Client.EmuHawk
_luaSurface = null;
}
public bool HasLuaSurface
{
get { return _luaSurface != null; }
}
#endregion
#region Helpers

View File

@ -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;
}
/// <summary>