move lua console to tools, tried not to break portable branch code but I did remove nearly every ifdef windows reference, and instead put one only on console load, from then on it does the proper ToolManager checks before calling luaconsole so in theory it should never crash if lua isn't support. Of course, really we should be figuring out how to support lua!
This commit is contained in:
parent
bd4548ae4f
commit
49d9953c40
|
@ -2147,18 +2147,26 @@ namespace BizHawk.MultiClient
|
|||
if (extension != null && extension.ToUpper() == ".LUA")
|
||||
{
|
||||
OpenLuaConsole();
|
||||
LuaConsole1.LoadLuaFile(path);
|
||||
if (GlobalWinF.Tools.Has<LuaConsole>())
|
||||
{
|
||||
GlobalWinF.Tools.LuaConsole.LoadLuaFile(path);
|
||||
}
|
||||
isLua = true;
|
||||
}
|
||||
}
|
||||
if (isLua)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var ext = Path.GetExtension(filePaths[0]) ?? "";
|
||||
var ext = Path.GetExtension(filePaths[0]) ?? String.Empty;
|
||||
if (ext.ToUpper() == ".LUASES")
|
||||
{
|
||||
OpenLuaConsole();
|
||||
LuaConsole1.LoadLuaSession(filePaths[0]);
|
||||
if (GlobalWinF.Tools.Has<LuaConsole>())
|
||||
{
|
||||
GlobalWinF.Tools.LuaConsole.LoadLuaSession(filePaths[0]);
|
||||
}
|
||||
}
|
||||
else if (IsValidMovieExtension(ext))
|
||||
{
|
||||
|
|
|
@ -116,11 +116,6 @@ namespace BizHawk.MultiClient
|
|||
return Path.Combine(path, PathManager.FilesystemSafeName(Global.Game) + ".cht");
|
||||
}
|
||||
|
||||
#if WINDOWS
|
||||
private LuaConsole _luaconsole = null;
|
||||
public LuaConsole LuaConsole1 { get { if (_luaconsole == null) _luaconsole = new LuaConsole(); return _luaconsole; } set { _luaconsole = value; } }
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// number of frames to autodump
|
||||
/// </summary>
|
||||
|
@ -187,9 +182,6 @@ namespace BizHawk.MultiClient
|
|||
CloseGame();
|
||||
Global.MovieSession.Movie.Stop();
|
||||
GlobalWinF.Tools.Close();
|
||||
#if WINDOWS
|
||||
CloseForm(LuaConsole1);
|
||||
#endif
|
||||
SaveConfig();
|
||||
};
|
||||
|
||||
|
@ -635,12 +627,11 @@ namespace BizHawk.MultiClient
|
|||
GlobalWinF.AutofireStickyXORAdapter.MassToggleStickyState(Global.ActiveController.PressedButtons);
|
||||
}
|
||||
|
||||
//if (!EmulatorPaused)
|
||||
//Global.ClickyVirtualPadController.FrameTick();
|
||||
if (GlobalWinF.Tools.Has<LuaConsole>())
|
||||
{
|
||||
GlobalWinF.Tools.LuaConsole.ResumeScripts(false);
|
||||
}
|
||||
|
||||
#if WINDOWS
|
||||
LuaConsole1.ResumeScripts(false);
|
||||
#endif
|
||||
|
||||
StepRunLoop_Core();
|
||||
//if(!IsNullEmulator())
|
||||
|
@ -1555,9 +1546,7 @@ namespace BizHawk.MultiClient
|
|||
//im not really a fan of how this is done..
|
||||
if (Global.Config.RecentRoms.Empty || Global.Config.RecentRoms[0] != file.CanonicalFullPath)
|
||||
{
|
||||
#if WINDOWS
|
||||
LuaConsole1.Restart();
|
||||
#endif
|
||||
GlobalWinF.Tools.Restart<LuaConsole>();
|
||||
}
|
||||
|
||||
Global.Config.RecentRoms.Add(file.CanonicalFullPath);
|
||||
|
@ -2282,18 +2271,16 @@ namespace BizHawk.MultiClient
|
|||
GlobalWinF.Sound.UpdateSilence();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update all tools that are frame dependent like Ram Search before processing
|
||||
/// </summary>
|
||||
public void UpdateToolsBefore(bool fromLua = false)
|
||||
{
|
||||
#if WINDOWS
|
||||
if (_luaconsole != null)
|
||||
if (GlobalWinF.Tools.Has<LuaConsole>())
|
||||
{
|
||||
if (!fromLua) LuaConsole1.StartLuaDrawing();
|
||||
LuaConsole1.LuaImp.CallFrameBeforeEvent();
|
||||
if (!fromLua)
|
||||
{
|
||||
GlobalWinF.Tools.LuaConsole.StartLuaDrawing();
|
||||
}
|
||||
GlobalWinF.Tools.LuaConsole.LuaImp.CallFrameBeforeEvent();
|
||||
}
|
||||
#endif
|
||||
GlobalWinF.Tools.UpdateBefore();
|
||||
}
|
||||
|
||||
|
@ -2307,26 +2294,23 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public void UpdateToolsAfter(bool fromLua = false)
|
||||
{
|
||||
#if WINDOWS
|
||||
if (_luaconsole != null && !fromLua)
|
||||
if (!fromLua && GlobalWinF.Tools.Has<LuaConsole>())
|
||||
{
|
||||
LuaConsole1.ResumeScripts(true);
|
||||
GlobalWinF.Tools.LuaConsole.ResumeScripts(true);
|
||||
}
|
||||
|
||||
#endif
|
||||
GlobalWinF.Tools.UpdateAfter();
|
||||
HandleToggleLight();
|
||||
#if WINDOWS
|
||||
if (_luaconsole != null)
|
||||
|
||||
if (GlobalWinF.Tools.Has<LuaConsole>())
|
||||
{
|
||||
LuaConsole1.LuaImp.CallFrameAfterEvent();
|
||||
GlobalWinF.Tools.LuaConsole.LuaImp.CallFrameAfterEvent();
|
||||
if (!fromLua)
|
||||
{
|
||||
GlobalWinF.DisplayManager.PreFrameUpdateLuaSource();
|
||||
LuaConsole1.EndLuaDrawing();
|
||||
GlobalWinF.Tools.LuaConsole.EndLuaDrawing();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
private unsafe Image MakeScreenshotImage()
|
||||
|
@ -2419,7 +2403,11 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
|
||||
SaveStateFile(path, name, false);
|
||||
LuaConsole1.LuaImp.CallSaveStateEvent(name);
|
||||
|
||||
if (GlobalWinF.Tools.Has<LuaConsole>())
|
||||
{
|
||||
GlobalWinF.Tools.LuaConsole.LuaImp.CallSaveStateEvent(name);
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveStateFile(string filename, string name, bool fromLua)
|
||||
|
@ -2467,7 +2455,11 @@ namespace BizHawk.MultiClient
|
|||
UpdateToolsAfter(fromLua);
|
||||
UpdateToolsLoadstate();
|
||||
GlobalWinF.OSD.AddMessage("Loaded state: " + name);
|
||||
LuaConsole1.LuaImp.CallLoadStateEvent(name);
|
||||
|
||||
if (GlobalWinF.Tools.Has<LuaConsole>())
|
||||
{
|
||||
GlobalWinF.Tools.LuaConsole.LuaImp.CallLoadStateEvent(name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2884,17 +2876,12 @@ namespace BizHawk.MultiClient
|
|||
RewireSound();
|
||||
ResetRewindBuffer();
|
||||
Cheats_Restart();
|
||||
#if WINDOWS
|
||||
LuaConsole1.Restart();
|
||||
#endif
|
||||
Text = "BizHawk" + (INTERIM ? " (interim) " : "");
|
||||
HandlePlatformMenus();
|
||||
StateSlots.Clear();
|
||||
UpdateDumpIcon();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------
|
||||
|
||||
private void SaveConfig()
|
||||
{
|
||||
if (Global.Config.SaveWindowPosition)
|
||||
|
@ -2912,11 +2899,6 @@ namespace BizHawk.MultiClient
|
|||
ConfigService.Save(PathManager.DefaultIniPath, Global.Config);
|
||||
}
|
||||
|
||||
private void CloseForm(Form form)
|
||||
{
|
||||
if (form != null && form.IsHandleCreated) form.Close();
|
||||
}
|
||||
|
||||
private void PreviousSlot()
|
||||
{
|
||||
if (Global.Config.SaveSlot == 0)
|
||||
|
@ -3446,13 +3428,7 @@ namespace BizHawk.MultiClient
|
|||
public void OpenLuaConsole()
|
||||
{
|
||||
#if WINDOWS
|
||||
if (!LuaConsole1.IsHandleCreated || LuaConsole1.IsDisposed)
|
||||
{
|
||||
LuaConsole1 = new LuaConsole();
|
||||
LuaConsole1.Show();
|
||||
}
|
||||
else
|
||||
LuaConsole1.Focus();
|
||||
GlobalWinF.Tools.Load<LuaConsole>();
|
||||
#else
|
||||
MessageBox.Show("Sorry, Lua is not supported on this platform.", "Lua not supported", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
#endif
|
||||
|
|
|
@ -26,13 +26,13 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public static void console_clear()
|
||||
{
|
||||
GlobalWinF.MainForm.LuaConsole1.ClearOutputWindow();
|
||||
GlobalWinF.Tools.LuaConsole.ClearOutputWindow();
|
||||
}
|
||||
|
||||
public static string console_getluafunctionslist()
|
||||
{
|
||||
StringBuilder list = new StringBuilder();
|
||||
foreach (var function in GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.FunctionList)
|
||||
foreach (var function in GlobalWinF.Tools.LuaConsole.LuaImp.Docs.FunctionList)
|
||||
{
|
||||
list.AppendLine(function.Name);
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
if (lua_input == null)
|
||||
{
|
||||
GlobalWinF.MainForm.LuaConsole1.WriteToOutputWindow("NULL");
|
||||
GlobalWinF.Tools.LuaConsole.WriteToOutputWindow("NULL");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -81,11 +81,11 @@ namespace BizHawk.MultiClient
|
|||
.AppendLine();
|
||||
}
|
||||
|
||||
GlobalWinF.MainForm.LuaConsole1.WriteToOutputWindow(sb.ToString());
|
||||
GlobalWinF.Tools.LuaConsole.WriteToOutputWindow(sb.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalWinF.MainForm.LuaConsole1.WriteToOutputWindow(lua_input.ToString());
|
||||
GlobalWinF.Tools.LuaConsole.WriteToOutputWindow(lua_input.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,17 +10,17 @@ using BizHawk.Client.Common;
|
|||
|
||||
namespace BizHawk.MultiClient
|
||||
{
|
||||
public partial class LuaConsole : Form
|
||||
public partial class LuaConsole : Form, IToolForm
|
||||
{
|
||||
//TODO: remember column widths
|
||||
//TODO: restore column width on restore default settings
|
||||
|
||||
int defaultWidth; //For saving the default size of the dialog, so the user can restore if desired
|
||||
int defaultHeight;
|
||||
string currentSessionFile = "";
|
||||
string currentSessionFile = String.Empty;
|
||||
List<LuaFile> luaList = new List<LuaFile>();
|
||||
public EmuLuaLibrary LuaImp;
|
||||
string lastLuaFile = ""; //TODO: this isn't getting used!
|
||||
string lastLuaFile = String.Empty; //TODO: this isn't getting used!
|
||||
bool changes = false;
|
||||
|
||||
private List<LuaFile> GetLuaFileList()
|
||||
|
@ -32,6 +32,9 @@ namespace BizHawk.MultiClient
|
|||
return l;
|
||||
}
|
||||
|
||||
public bool UpdateBefore { get { return true; } }
|
||||
public void UpdateValues() { }
|
||||
|
||||
public LuaConsole get()
|
||||
{
|
||||
return this;
|
||||
|
@ -1098,7 +1101,7 @@ namespace BizHawk.MultiClient
|
|||
turnOffAllScriptsToolStripMenuItem.Enabled = luaRunning;
|
||||
|
||||
|
||||
showRegisteredFunctionsToolStripMenuItem.Enabled = GlobalWinF.MainForm.LuaConsole1.LuaImp.RegisteredFunctions.Any();
|
||||
showRegisteredFunctionsToolStripMenuItem.Enabled = GlobalWinF.Tools.LuaConsole.LuaImp.RegisteredFunctions.Any();
|
||||
}
|
||||
|
||||
private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
|
||||
|
@ -1244,7 +1247,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
private void showRegisteredFunctionsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (GlobalWinF.MainForm.LuaConsole1.LuaImp.RegisteredFunctions.Any())
|
||||
if (LuaImp.RegisteredFunctions.Any())
|
||||
{
|
||||
LuaRegisteredFunctionsList dialog = new LuaRegisteredFunctionsList();
|
||||
dialog.ShowDialog();
|
||||
|
@ -1253,7 +1256,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
private void contextMenuStrip2_Opening(object sender, CancelEventArgs e)
|
||||
{
|
||||
registeredFunctionsToolStripMenuItem.Enabled = GlobalWinF.MainForm.LuaConsole1.LuaImp.RegisteredFunctions.Any();
|
||||
registeredFunctionsToolStripMenuItem.Enabled = LuaImp.RegisteredFunctions.Any();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace BizHawk.MultiClient
|
|||
private void PopulateListView()
|
||||
{
|
||||
FunctionView.Items.Clear();
|
||||
foreach (LuaDocumentation.LibraryFunction l in GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.FunctionList)
|
||||
foreach (LuaDocumentation.LibraryFunction l in GlobalWinF.Tools.LuaConsole.LuaImp.Docs.FunctionList)
|
||||
{
|
||||
ListViewItem item = new ListViewItem {Text = l.ReturnType};
|
||||
item.SubItems.Add(l.Library + ".");
|
||||
|
@ -42,16 +42,16 @@ namespace BizHawk.MultiClient
|
|||
switch (column)
|
||||
{
|
||||
case 0: //Return
|
||||
GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.FunctionList = GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.FunctionList.OrderByDescending(x => x.ReturnType).ToList();
|
||||
GlobalWinF.Tools.LuaConsole.LuaImp.Docs.FunctionList = GlobalWinF.Tools.LuaConsole.LuaImp.Docs.FunctionList.OrderByDescending(x => x.ReturnType).ToList();
|
||||
break;
|
||||
case 1: //Library
|
||||
GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.FunctionList = GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.FunctionList.OrderByDescending(x => x.Library).ToList();
|
||||
GlobalWinF.Tools.LuaConsole.LuaImp.Docs.FunctionList = GlobalWinF.Tools.LuaConsole.LuaImp.Docs.FunctionList.OrderByDescending(x => x.Library).ToList();
|
||||
break;
|
||||
case 2: //Name
|
||||
GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.FunctionList = GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.FunctionList.OrderByDescending(x => x.Name).ToList();
|
||||
GlobalWinF.Tools.LuaConsole.LuaImp.Docs.FunctionList = GlobalWinF.Tools.LuaConsole.LuaImp.Docs.FunctionList.OrderByDescending(x => x.Name).ToList();
|
||||
break;
|
||||
case 3: //Parameters
|
||||
GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.FunctionList = GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.FunctionList.OrderByDescending(x => x.ParameterList).ToList();
|
||||
GlobalWinF.Tools.LuaConsole.LuaImp.Docs.FunctionList = GlobalWinF.Tools.LuaConsole.LuaImp.Docs.FunctionList.OrderByDescending(x => x.ParameterList).ToList();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -60,16 +60,16 @@ namespace BizHawk.MultiClient
|
|||
switch (column)
|
||||
{
|
||||
case 0: //Return
|
||||
GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.FunctionList = GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.FunctionList.OrderBy(x => x.ReturnType).ToList();
|
||||
GlobalWinF.Tools.LuaConsole.LuaImp.Docs.FunctionList = GlobalWinF.Tools.LuaConsole.LuaImp.Docs.FunctionList.OrderBy(x => x.ReturnType).ToList();
|
||||
break;
|
||||
case 1: //Library
|
||||
GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.FunctionList = GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.FunctionList.OrderBy(x => x.Library).ToList();
|
||||
GlobalWinF.Tools.LuaConsole.LuaImp.Docs.FunctionList = GlobalWinF.Tools.LuaConsole.LuaImp.Docs.FunctionList.OrderBy(x => x.Library).ToList();
|
||||
break;
|
||||
case 2: //Name
|
||||
GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.FunctionList = GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.FunctionList.OrderBy(x => x.Name).ToList();
|
||||
GlobalWinF.Tools.LuaConsole.LuaImp.Docs.FunctionList = GlobalWinF.Tools.LuaConsole.LuaImp.Docs.FunctionList.OrderBy(x => x.Name).ToList();
|
||||
break;
|
||||
case 3: //Parameters
|
||||
GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.FunctionList = GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.FunctionList.OrderBy(x => x.ParameterList).ToList();
|
||||
GlobalWinF.Tools.LuaConsole.LuaImp.Docs.FunctionList = GlobalWinF.Tools.LuaConsole.LuaImp.Docs.FunctionList.OrderBy(x => x.ParameterList).ToList();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
foreach (int index in indexes)
|
||||
{
|
||||
var library_function = GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.FunctionList[index];
|
||||
var library_function = GlobalWinF.Tools.LuaConsole.LuaImp.Docs.FunctionList[index];
|
||||
sb.Append(library_function.Library).Append('.').Append(library_function.Name).Append("()\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
FunctionView.Items.Clear();
|
||||
|
||||
List<NamedLuaFunction> nlfs = GlobalWinF.MainForm.LuaConsole1.LuaImp.RegisteredFunctions.OrderBy(x => x.Event).ThenBy(x => x.Name).ToList();
|
||||
List<NamedLuaFunction> nlfs = GlobalWinF.Tools.LuaConsole.LuaImp.RegisteredFunctions.OrderBy(x => x.Event).ThenBy(x => x.Name).ToList();
|
||||
foreach (NamedLuaFunction nlf in nlfs)
|
||||
{
|
||||
ListViewItem item = new ListViewItem { Text = nlf.Event };
|
||||
|
@ -57,7 +57,7 @@ namespace BizHawk.MultiClient
|
|||
ListView.SelectedIndexCollection indexes = FunctionView.SelectedIndices;
|
||||
if (indexes.Count > 0)
|
||||
{
|
||||
GlobalWinF.MainForm.LuaConsole1.LuaImp.RegisteredFunctions[indexes[0]].Call();
|
||||
GlobalWinF.Tools.LuaConsole.LuaImp.RegisteredFunctions[indexes[0]].Call();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -66,8 +66,8 @@ namespace BizHawk.MultiClient
|
|||
ListView.SelectedIndexCollection indexes = FunctionView.SelectedIndices;
|
||||
if (indexes.Count > 0)
|
||||
{
|
||||
NamedLuaFunction nlf = GlobalWinF.MainForm.LuaConsole1.LuaImp.RegisteredFunctions[indexes[0]];
|
||||
GlobalWinF.MainForm.LuaConsole1.LuaImp.RegisteredFunctions.Remove(nlf);
|
||||
NamedLuaFunction nlf = GlobalWinF.Tools.LuaConsole.LuaImp.RegisteredFunctions[indexes[0]];
|
||||
GlobalWinF.Tools.LuaConsole.LuaImp.RegisteredFunctions.Remove(nlf);
|
||||
PopulateListView();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public void CloseThis()
|
||||
{
|
||||
GlobalWinF.MainForm.LuaConsole1.LuaImp.WindowClosed(Handle);
|
||||
GlobalWinF.Tools.LuaConsole.LuaImp.WindowClosed(Handle);
|
||||
}
|
||||
|
||||
public void DoLuaEvent(IntPtr handle)
|
||||
|
|
|
@ -434,7 +434,7 @@ namespace BizHawk.MultiClient
|
|||
private void GenerateLibraryRegex()
|
||||
{
|
||||
StringBuilder list = new StringBuilder();
|
||||
List<string> Libs = GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.GetLibraryList();
|
||||
List<string> Libs = GlobalWinF.Tools.LuaConsole.LuaImp.Docs.GetLibraryList();
|
||||
for (int i = 0; i < Libs.Count; i++)
|
||||
{
|
||||
list.Append(Libs[i]);
|
||||
|
@ -659,7 +659,7 @@ namespace BizHawk.MultiClient
|
|||
string currentword = CurrentWord();
|
||||
if (IsLibraryWord(currentword))
|
||||
{
|
||||
List<string> libfunctions = GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.GetFunctionsByLibrary(currentword);
|
||||
List<string> libfunctions = GlobalWinF.Tools.LuaConsole.LuaImp.Docs.GetFunctionsByLibrary(currentword);
|
||||
|
||||
// Position autocomplete box near the cursor's current position
|
||||
int x = LuaText.GetPositionFromCharIndex(LuaText.SelectionStart).X + LuaText.Location.X + 5;
|
||||
|
@ -783,7 +783,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
private bool IsLibraryWord(string word)
|
||||
{
|
||||
List<string> Libs = GlobalWinF.MainForm.LuaConsole1.LuaImp.Docs.GetLibraryList();
|
||||
List<string> Libs = GlobalWinF.Tools.LuaConsole.LuaImp.Docs.GetLibraryList();
|
||||
if (Libs.Contains(word))
|
||||
{
|
||||
return true;
|
||||
|
|
|
@ -296,6 +296,29 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
}
|
||||
|
||||
public LuaConsole LuaConsole
|
||||
{
|
||||
get
|
||||
{
|
||||
var tool = _tools.FirstOrDefault(x => x is LuaConsole);
|
||||
if (tool != null)
|
||||
{
|
||||
if (tool.IsDisposed)
|
||||
{
|
||||
_tools.Remove(tool);
|
||||
}
|
||||
else
|
||||
{
|
||||
return tool as LuaConsole;
|
||||
}
|
||||
}
|
||||
|
||||
var newTool = new LuaConsole();
|
||||
_tools.Add(newTool);
|
||||
return newTool;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue