fully implement lua

This commit is contained in:
Lion Kortlepel
2021-02-16 12:03:23 +01:00
committed by Anonymous275
parent 459814a6ec
commit 4cda6e8bc3
12 changed files with 252 additions and 234 deletions

View File

@@ -40,12 +40,12 @@ std::string GetDate() {
}
TConsole::TConsole() {
_Commandline.enable_history();
_Commandline.set_history_limit(20);
_Commandline.set_prompt("> ");
_Commandline.on_command = [this](Commandline& c) {
mCommandline.enable_history();
mCommandline.set_history_limit(20);
mCommandline.set_prompt("> ");
mCommandline.on_command = [this](Commandline& c) {
auto cmd = c.get_command();
_Commandline.write("> " + cmd);
mCommandline.write("> " + cmd);
if (cmd == "exit") {
info("gracefully shutting down");
Application::GracefullyShutdown();
@@ -59,7 +59,7 @@ TConsole::TConsole() {
void TConsole::Write(const std::string& str) {
auto ToWrite = GetDate() + str;
_Commandline.write(ToWrite);
mCommandline.write(ToWrite);
// TODO write to logfile, too
}