begin rewrite: add lionkor/commandline

This commit is contained in:
Lion Kortlepel
2021-02-14 13:03:59 +01:00
committed by Anonymous275
parent 6a2ce7faab
commit e5e447c7af
43 changed files with 120 additions and 3536 deletions

17
src/TConsole.cpp Normal file
View File

@@ -0,0 +1,17 @@
#include "TConsole.h"
#include "Compat.h"
TConsole::TConsole() {
_Commandline.enable_history();
_Commandline.set_history_limit(20);
_Commandline.on_command = [](Commandline& c) {
auto cmd = c.get_command();
if (cmd == "exit") {
_Exit(0);
} else if (cmd == "clear" || cmd == "cls") {
// TODO: clear screen
} else {
// TODO: execute as lua
}
};
}