Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/consoleinterface.cc9
-rw-r--r--src/sys/consoleinterface.h20
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;