diff options
author | Stijn Buys <ingar@osirion.org> | 2008-10-10 16:41:38 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-10-10 16:41:38 +0000 |
commit | 02fcd22d8cde355aa898a8c6bb4773d9434b8e9a (patch) | |
tree | 9397f1f5b61a0978acadc4c15fd330ee7138c59b /src/sys | |
parent | 4331f5c17901f46693dcb5c2df96276f6851be25 (diff) |
adds KeyPress, DevInfo and Stats widgets
Diffstat (limited to 'src/sys')
-rw-r--r-- | src/sys/consoleinterface.cc | 9 | ||||
-rw-r--r-- | src/sys/consoleinterface.h | 20 |
2 files changed, 18 insertions, 11 deletions
diff --git a/src/sys/consoleinterface.cc b/src/sys/consoleinterface.cc index 45508ee..073f34b 100644 --- a/src/sys/consoleinterface.cc +++ b/src/sys/consoleinterface.cc @@ -72,7 +72,6 @@ void ConsoleInterface::flush() char line[MAXCMDSIZE]; while(consoleinterface_buffer.getline(line, MAXCMDSIZE-1)) { - while (consoleinterface_text.size() >= MAXCONLINES) { consoleinterface_text.pop_front(); } @@ -175,7 +174,12 @@ void ConsoleInterface::print_ansi(const char *line) std::cout << "\033[0;39m"; } -void ConsoleInterface::buffer_rcon(bool enable) +void ConsoleInterface::set_ansi(bool enable) +{ + consoleinterface_ansi = enable; +} + +void ConsoleInterface::set_rcon(bool enable) { if (enable) { flush(); @@ -185,3 +189,4 @@ void ConsoleInterface::buffer_rcon(bool enable) } } // namespace sys + diff --git a/src/sys/consoleinterface.h b/src/sys/consoleinterface.h index 33052cf..5411cb6 100644 --- a/src/sys/consoleinterface.h +++ b/src/sys/consoleinterface.h @@ -60,20 +60,22 @@ public: /// resize the console (ncurses stub) virtual void resize(); - /// turn ANSI color codes on or off - inline void set_ansi(bool ansi) { consoleinterface_ansi = ansi; } - - /// a pointer to the current console instance - static ConsoleInterface *instance(); - - /// enable or disable rcon - void buffer_rcon(bool enable = true); - /// return the console inputbuffer inline std::stringstream & buffer() { return consoleinterface_buffer; } inline bool rcon() { return consoleinterface_rcon; } + inline bool ansi() { return consoleinterface_ansi; } + + /// enable or disable ANSI escape sequences + void set_ansi(bool enable = true); + + /// enable or disable rcon + void set_rcon(bool enable = true); + + /// a pointer to the current console instance + static ConsoleInterface *instance(); + protected: std::deque<std::string> consoleinterface_text; std::stringstream consoleinterface_buffer; |