Lua Console: Command window gives slightly more sensible output now.
This commit is contained in:
parent
152323d891
commit
48a6686f31
|
@ -1133,28 +1133,29 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (e.KeyCode == Keys.Enter)
|
if (e.KeyCode == Keys.Enter)
|
||||||
{
|
{
|
||||||
string consoleBeforeCall = OutputBox.Text;
|
string consoleBeforeCall = OutputBox.Text;
|
||||||
|
|
||||||
// TODO: Maybe make these try-catches more general
|
// TODO: Maybe make these try-catches more general
|
||||||
if (InputBox.Text != "")
|
if (InputBox.Text != "")
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
LuaImp.ExecuteString(InputBox.Text);
|
|
||||||
|
|
||||||
// TODO: This isn't exactly optimal
|
|
||||||
if (OutputBox.Text == consoleBeforeCall)
|
|
||||||
ConsoleLog("Command successfully executed");
|
|
||||||
}
|
|
||||||
catch (LuaScriptException ex)
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
LuaImp.ExecuteString(string.Format("console.log({0})", InputBox.Text));
|
LuaImp.ExecuteString(string.Format("console.log({0})", InputBox.Text));
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
LuaImp.ExecuteString(InputBox.Text);
|
||||||
|
|
||||||
|
if (OutputBox.Text == consoleBeforeCall)
|
||||||
|
ConsoleLog("Command successfully executed");
|
||||||
|
}
|
||||||
|
catch (LuaScriptException ex)
|
||||||
{
|
{
|
||||||
ConsoleLog(ex.ToString());
|
ConsoleLog(ex.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_consoleCommandHistory.Insert(0, InputBox.Text);
|
_consoleCommandHistory.Insert(0, InputBox.Text);
|
||||||
_consoleCommandHistoryIndex = -1;
|
_consoleCommandHistoryIndex = -1;
|
||||||
InputBox.Clear();
|
InputBox.Clear();
|
||||||
|
|
Loading…
Reference in New Issue