Disable Lua script loading on Unix (resolves #1735)

This commit is contained in:
YoshiRulz 2019-11-17 02:24:54 +10:00
parent a7ffdd948e
commit 6e809adc66
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
3 changed files with 21 additions and 2 deletions

View File

@ -81,7 +81,8 @@ namespace BizHawk.Client.EmuHawk
OpenLuaConsole();
if (GlobalWin.Tools.Has<LuaConsole>())
{
GlobalWin.Tools.LuaConsole.LoadLuaFile(filename);
if (OSTailoredCode.IsUnixHost) Console.WriteLine($"The Lua environment can currently only be created on Windows, {filename} will not be loaded.");
else GlobalWin.Tools.LuaConsole.LoadLuaFile(filename);
}
}

View File

@ -383,7 +383,8 @@ namespace BizHawk.Client.EmuHawk
//load Lua Script if requested in the command line arguments
if (_argParser.luaScript != null)
{
GlobalWin.Tools.LuaConsole.LoadLuaFile(_argParser.luaScript);
if (OSTailoredCode.IsUnixHost) Console.WriteLine($"The Lua environment can currently only be created on Windows, {_argParser.luaScript} will not be loaded.");
else GlobalWin.Tools.LuaConsole.LoadLuaFile(_argParser.luaScript);
}
GlobalWin.Tools.AutoLoad();

View File

@ -148,6 +148,18 @@ 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;
ConsoleLog("The Lua environment can currently only be created on Windows. You may not load scripts.");
}
LuaListView.AllColumns.Clear();
SetColumns();
}
@ -1249,6 +1261,11 @@ 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
{