Index: code/branches/console/src/orxonox/console/InGameConsole.cc
===================================================================
--- code/branches/console/src/orxonox/console/InGameConsole.cc	(revision 1317)
+++ code/branches/console/src/orxonox/console/InGameConsole.cc	(revision 1322)
@@ -42,4 +42,5 @@
 #include "core/ConfigValueIncludes.h"
 #include "core/ConsoleCommand.h"
+#include "core/InputManager.h"
 #include "GraphicsEngine.h"
 
@@ -48,9 +49,12 @@
 namespace orxonox
 {
+    ConsoleCommand(InGameConsole, openConsole, AccessLevel::None, true);
+    ConsoleCommand(InGameConsole, closeConsole, AccessLevel::None, true);
+
     using namespace Ogre;
 
     float InGameConsole::REL_WIDTH = 0.8;
     float InGameConsole::REL_HEIGHT = 0.4;
-    float InGameConsole::BLINK = 0.25;
+    float InGameConsole::BLINK = 0.5;
 
     /**
@@ -63,7 +67,10 @@
         this->active_ = false;
         this->cursor_ = 0.0;
+        this->cursorSymbol_ = '|';
 
         this->init();
         this->setConfigValues();
+
+        Shell::getInstance().registerListener(this);
     }
 
@@ -95,5 +102,5 @@
         SetConfigValue(REL_WIDTH, 0.8);
         SetConfigValue(REL_HEIGHT, 0.4);
-        SetConfigValue(BLINK, 0.25);
+        SetConfigValue(BLINK, 0.5);
     }
 
@@ -104,8 +111,15 @@
     {
         std::list<std::string>::const_iterator it = Shell::getInstance().getNewestLineIterator();
-        for (int i = 1; i < LINES && it != Shell::getInstance().getEndIterator(); i++)
-        {
-            this->consoleOverlayTextAreas_[i]->setCaption(*it);
-            ++it;
+        for (int i = 1; i < LINES; i++)
+        {
+            if (it != Shell::getInstance().getEndIterator())
+            {
+                this->print(*it, i);
+                ++it;
+            }
+            else
+            {
+                this->print("", i);
+            }
         }
     }
@@ -117,5 +131,5 @@
     {
         if (LINES > 1)
-            this->consoleOverlayTextAreas_[1]->setCaption(*Shell::getInstance().getNewestLineIterator());
+            this->print(*Shell::getInstance().getNewestLineIterator(), 1);
     }
 
@@ -125,9 +139,5 @@
     void InGameConsole::lineAdded()
     {
-        for (int i = LINES - 1; i > 1; i--)
-            this->consoleOverlayTextAreas_[i]->setCaption(this->consoleOverlayTextAreas_[i - 1]->getCaption());
-
-        if (LINES > 1)
-            this->consoleOverlayTextAreas_[1]->setCaption(*Shell::getInstance().getNewestLineIterator());
+        this->linesChanged();
     }
 
@@ -138,5 +148,5 @@
     {
         if (LINES > 0)
-            this->consoleOverlayTextAreas_[0]->setCaption(Shell::getInstance().getInput());
+            this->print(Shell::getInstance().getInput(), 0);
     }
 
@@ -147,7 +157,7 @@
     {
         std::string input = Shell::getInstance().getInput();
-        input.insert(Shell::getInstance().getCursorPosition(), 1, '|');
+        input.insert(Shell::getInstance().getCursorPosition(), 1, this->cursorSymbol_);
         if (LINES > 0)
-            this->consoleOverlayTextAreas_[0]->setCaption(input);
+            this->print(input, 0);
     }
 
@@ -158,5 +168,5 @@
     {
         this->deactivate();
-        CommandExecutor::execute("set InputMode 2");
+        InputManager::getSingleton().setInputMode(IM_INGAME);
     }
 
@@ -266,5 +276,15 @@
         if (this->cursor_ >= 2 * InGameConsole::BLINK)
             this->cursor_ = 0;
-//        print(convert2UTF(this->ib_->get()));
+
+        if (this->cursor_ >= InGameConsole::BLINK && this->cursorSymbol_ == '|')
+        {
+            this->cursorSymbol_ = ' ';
+            this->cursorChanged();
+        }
+        else if (this->cursor_ < InGameConsole::BLINK && this->cursorSymbol_ == ' ')
+        {
+            this->cursorSymbol_ = '|';
+            this->cursorChanged();
+        }
 
         // this creates a flickering effect
@@ -296,4 +316,6 @@
     void InGameConsole::activate()
     {
+        this->linesChanged();
+
         this->consoleOverlay_->show();
         // just in case window size has changed...
@@ -334,28 +356,8 @@
         @param s String to be printed
     */
-    void InGameConsole::print(Ogre::UTFString s)
-    {
-        if (this->cursor_ > InGameConsole::BLINK)
-            this->consoleOverlayTextAreas_[0]->setCaption(">" + s);
-        else
-            this->consoleOverlayTextAreas_[0]->setCaption(">" + s + "_");
-    }
-
-    /**
-        @brief Shifts all lines up and clears the bottom line.
-    */
-    void InGameConsole::newline()
-    {
-        Ogre::UTFString line;
-        for (int i = LINES - 1; i >= 1; i--)
-        {
-            line = this->consoleOverlayTextAreas_[i - 1]->getCaption();
-            // don't copy the cursor...
-            int l = line.length();
-            if (!line.empty() && line.substr(l-1) == "_")
-                line.erase(l-1);
-            this->consoleOverlayTextAreas_[i]->setCaption(line);
-        }
-        this->consoleOverlayTextAreas_[0]->setCaption(">");
+    void InGameConsole::print(const std::string& text, int index)
+    {
+        if (LINES > index)
+            this->consoleOverlayTextAreas_[index]->setCaption(convert2UTF(text));
     }
 
Index: code/branches/console/src/orxonox/console/InGameConsole.h
===================================================================
--- code/branches/console/src/orxonox/console/InGameConsole.h	(revision 1317)
+++ code/branches/console/src/orxonox/console/InGameConsole.h	(revision 1322)
@@ -71,6 +71,5 @@
             void init();
             void resize();
-            void print(Ogre::UTFString s);
-            void newline();
+            void print(const std::string& text, int index);
             static Ogre::UTFString convert2UTF(std::string s);
 
@@ -84,4 +83,5 @@
             float scrollTimer_;
             float cursor_;
+            char cursorSymbol_;
             bool active_;
             Ogre::OverlayManager* om_;
