diff --git a/src/BizHawk.Client.EmuHawk/MainForm.FileLoader.cs b/src/BizHawk.Client.EmuHawk/MainForm.FileLoader.cs index 53936fc05a..17c91c883d 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.FileLoader.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.FileLoader.cs @@ -74,11 +74,7 @@ namespace BizHawk.Client.EmuHawk private void LoadLuaFile(string filename, string archive = null) { OpenLuaConsole(); - if (Tools.Has()) - { - if (OSTailoredCode.IsUnixHost) Console.WriteLine($"The Lua environment can currently only be created on Windows, {filename} will not be loaded."); - else Tools.LuaConsole.LoadLuaFile(filename); - } + if (Tools.Has()) Tools.LuaConsole.LoadLuaFile(filename); } private void LoadLuaSession(string filename, string archive = null) diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index 339e6f00b8..f55de98e36 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -616,8 +616,7 @@ namespace BizHawk.Client.EmuHawk //load Lua Script if requested in the command line arguments if (_argParser.luaScript != null) { - if (OSTailoredCode.IsUnixHost) Console.WriteLine($"The Lua environment can currently only be created on Windows, {_argParser.luaScript} will not be loaded."); - else Tools.LuaConsole.LoadLuaFile(_argParser.luaScript.MakeAbsolute()); + Tools.LuaConsole.LoadLuaFile(_argParser.luaScript.MakeAbsolute()); } SetStatusBar(); diff --git a/src/BizHawk.Client.EmuHawk/Program.cs b/src/BizHawk.Client.EmuHawk/Program.cs index 87bdc48f5e..3def9e92c9 100644 --- a/src/BizHawk.Client.EmuHawk/Program.cs +++ b/src/BizHawk.Client.EmuHawk/Program.cs @@ -288,10 +288,8 @@ namespace BizHawk.Client.EmuHawk //so.. we're going to resort to something really bad. //avert your eyes. var configPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "config.ini"); - if (!OSTC.IsUnixHost // LuaInterface is not currently working on Mono - && File.Exists(configPath) - && (Array.Find(File.ReadAllLines(configPath), line => line.Contains(" \"LuaEngine\": ")) ?? string.Empty) - .Contains("0")) + if (File.Exists(configPath) + && (Array.Find(File.ReadAllLines(configPath), line => line.Contains(" \"LuaEngine\": ")) ?? string.Empty).Contains("0")) { requested = "LuaInterface"; } diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs index 47a8efc226..0cba9467cf 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs @@ -178,17 +178,7 @@ namespace BizHawk.Client.EmuHawk } } - if (OSTailoredCode.IsUnixHost) - { - OpenSessionMenuItem.Enabled = false; - RecentSessionsSubMenu.Enabled = false; - RecentScriptsSubMenu.Enabled = false; - NewScriptMenuItem.Enabled = false; - OpenScriptMenuItem.Enabled = false; - NewScriptToolbarItem.Enabled = false; - OpenScriptToolbarItem.Enabled = false; - WriteToOutputWindow("The Lua environment can currently only be created on Windows. You may not load scripts."); - } + if (OSTailoredCode.IsUnixHost) WriteToOutputWindow("Lua in Mono is currently experimental. Please report bugs here: https://github.com/TASVideos/BizHawk/issues/2951"); LuaListView.AllColumns.Clear(); SetColumns(); @@ -226,20 +216,16 @@ namespace BizHawk.Client.EmuHawk LuaFileList newScripts = new(LuaImp?.ScriptList, onChanged: SessionChangedCallback); LuaFunctionList registeredFuncList = new(onChanged: UpdateRegisteredFunctionsDialog); - LuaImp = OSTailoredCode.IsUnixHost - ? new UnixLuaLibraries( - newScripts, - registeredFuncList) - : new Win32LuaLibraries( - newScripts, - registeredFuncList, - Emulator.ServiceProvider, - (MainForm) MainForm, //HACK - DisplayManager, - InputManager, - Config, - Emulator, - Game); + LuaImp = new Win32LuaLibraries( + newScripts, + registeredFuncList, + Emulator.ServiceProvider, + (MainForm) MainForm, //HACK + DisplayManager, + InputManager, + Config, + Emulator, + Game); InputBox.AutoCompleteCustomSource.AddRange(LuaImp.Docs.Select(a => $"{a.Library}.{a.Name}").ToArray()); @@ -1306,11 +1292,6 @@ namespace BizHawk.Client.EmuHawk private void LuaConsole_DragDrop(object sender, DragEventArgs e) { - if (OSTailoredCode.IsUnixHost) - { - Console.WriteLine("The Lua environment can currently only be created on Windows, no scripts will be loaded."); - return; - } var filePaths = (string[])e.Data.GetData(DataFormats.FileDrop); try {