fix double new line in lua console.log()

This commit is contained in:
adelikat 2019-12-15 10:18:58 -06:00
parent 5d03062c4c
commit b6df55bbf0
2 changed files with 10 additions and 5 deletions

View File

@ -133,7 +133,10 @@ namespace BizHawk.Client.EmuHawk
} }
} }
if (!string.IsNullOrEmpty(terminator))
{
GlobalWin.Tools.LuaConsole.WriteToOutputWindow(terminator); GlobalWin.Tools.LuaConsole.WriteToOutputWindow(terminator);
} }
} }
} }
}

View File

@ -462,6 +462,8 @@ namespace BizHawk.Client.EmuHawk
NumberOfScripts.Text = message; NumberOfScripts.Text = message;
} }
private void WriteLine(string message) => WriteToOutputWindow(message + "\n");
private int _messageCount; private int _messageCount;
private const int MaxCount = 50; private const int MaxCount = 50;
public void WriteToOutputWindow(string message) public void WriteToOutputWindow(string message)
@ -477,7 +479,7 @@ namespace BizHawk.Client.EmuHawk
if (_messageCount <= MaxCount) if (_messageCount <= MaxCount)
{ {
OutputBox.Text += message + "\n"; OutputBox.Text += message;
OutputBox.SelectionStart = OutputBox.Text.Length; OutputBox.SelectionStart = OutputBox.Text.Length;
OutputBox.ScrollToCaret(); OutputBox.ScrollToCaret();
} }
@ -874,7 +876,7 @@ namespace BizHawk.Client.EmuHawk
} }
catch (IOException) catch (IOException)
{ {
WriteToOutputWindow($"Unable to access file {item.Path}"); WriteLine($"Unable to access file {item.Path}");
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -1363,7 +1365,7 @@ namespace BizHawk.Client.EmuHawk
{ {
if (InputBox.Text.Contains("emu.frameadvance(")) if (InputBox.Text.Contains("emu.frameadvance("))
{ {
WriteToOutputWindow("emu.frameadvance() can not be called from the console"); WriteLine("emu.frameadvance() can not be called from the console");
return; return;
} }
@ -1378,7 +1380,7 @@ namespace BizHawk.Client.EmuHawk
if (OutputBox.Text == consoleBeforeCall) if (OutputBox.Text == consoleBeforeCall)
{ {
WriteToOutputWindow("Command successfully executed"); WriteLine("Command successfully executed");
} }
}); });
}); });