mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-03 14:26:09 +00:00
begin rewrite: add lionkor/commandline
This commit is contained in:
committed by
Anonymous275
parent
6a2ce7faab
commit
e5e447c7af
17
src/TConsole.cpp
Normal file
17
src/TConsole.cpp
Normal 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
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user