Index: code/trunk/src/orxonox/overlays/InGameConsole.cc
===================================================================
--- code/trunk/src/orxonox/overlays/InGameConsole.cc	(revision 6105)
+++ code/trunk/src/orxonox/overlays/InGameConsole.cc	(revision 6417)
@@ -44,5 +44,5 @@
 #include "util/Convert.h"
 #include "util/Math.h"
-#include "util/UTFStringConversions.h"
+#include "util/DisplayStringConversions.h"
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
@@ -61,5 +61,4 @@
     SetConsoleCommand(InGameConsole, closeConsole, true);
 
-    InGameConsole* InGameConsole::singletonPtr_s = 0;
     ManageScopedSingleton(InGameConsole, ScopeID::Graphics, false);
 
@@ -68,5 +67,6 @@
     */
     InGameConsole::InGameConsole()
-        : shell_(new Shell("InGameConsole", true, true))
+        : shell_(new Shell("InGameConsole", true))
+        , bShowCursor_(false)
         , consoleOverlay_(0)
         , consoleOverlayContainer_(0)
@@ -218,4 +218,12 @@
         font->addCodePointRange(Ogre::Font::CodePointRange(161, 255));
 
+        // create noise
+        this->consoleOverlayNoise_ = static_cast<Ogre::PanelOverlayElement*>(ovMan->createOverlayElement("Panel", "InGameConsoleNoise"));
+        this->consoleOverlayNoise_->setMetricsMode(Ogre::GMM_PIXELS);
+        this->consoleOverlayNoise_->setPosition(5,0);
+        this->consoleOverlayNoise_->setMaterialName("ConsoleNoiseSmall");
+        // comment following line to disable noise
+        this->consoleOverlayBorder_->addChild(this->consoleOverlayNoise_);
+
         // create the text lines
         this->consoleOverlayTextAreas_ = new Ogre::TextAreaOverlayElement*[LINES];
@@ -229,5 +237,5 @@
             this->consoleOverlayTextAreas_[i]->setLeft(8);
             this->consoleOverlayTextAreas_[i]->setCaption("");
-            this->consoleOverlayContainer_->addChild(this->consoleOverlayTextAreas_[i]);
+            this->consoleOverlayNoise_->addChild(this->consoleOverlayTextAreas_[i]);
         }
 
@@ -240,13 +248,5 @@
         this->consoleOverlayCursor_->setLeft(7);
         this->consoleOverlayCursor_->setCaption(std::string(this->cursorSymbol_, 1));
-        this->consoleOverlayContainer_->addChild(this->consoleOverlayCursor_);
-
-        // create noise
-        this->consoleOverlayNoise_ = static_cast<Ogre::PanelOverlayElement*>(ovMan->createOverlayElement("Panel", "InGameConsoleNoise"));
-        this->consoleOverlayNoise_->setMetricsMode(Ogre::GMM_PIXELS);
-        this->consoleOverlayNoise_->setPosition(5,0);
-        this->consoleOverlayNoise_->setMaterialName("ConsoleNoiseSmall");
-        // comment following line to disable noise
-        this->consoleOverlayContainer_->addChild(this->consoleOverlayNoise_);
+        this->consoleOverlayNoise_->addChild(this->consoleOverlayCursor_);
 
         this->windowResized(this->getWindowWidth(), this->getWindowWidth());
@@ -268,5 +268,5 @@
     void InGameConsole::linesChanged()
     {
-        std::list<std::string>::const_iterator it = this->shell_->getNewestLineIterator();
+        Shell::LineList::const_iterator it = this->shell_->getNewestLineIterator();
         int max = 0;
         for (int i = 1; i < LINES; ++i)
@@ -282,10 +282,10 @@
 
         for (int i = LINES - 1; i > max; --i)
-            this->print("", i, true);
+            this->print("", Shell::None, i, true);
 
         for (int i = max; i >= 1; --i)
         {
             --it;
-            this->print(*it, i, true);
+            this->print(it->first, it->second, i, true);
         }
     }
@@ -297,5 +297,5 @@
     {
         if (LINES > 1)
-            this->print(*this->shell_->getNewestLineIterator(), 1);
+            this->print(this->shell_->getNewestLineIterator()->first, this->shell_->getNewestLineIterator()->second, 1);
     }
 
@@ -316,7 +316,7 @@
     {
         if (LINES > 0)
-            this->print(this->shell_->getInput(), 0);
-
-        if (this->shell_->getInput() == "" || this->shell_->getInput().size() == 0)
+            this->print(this->shell_->getInput(), Shell::Input, 0);
+
+        if (this->shell_->getInput().empty())
             this->inputWindowStart_ = 0;
     }
@@ -340,5 +340,5 @@
     void InGameConsole::executed()
     {
-        this->shell_->addOutputLine(this->shell_->getInput());
+        this->shell_->addOutput(this->shell_->getInput() + '\n', Shell::Command);
     }
 
@@ -358,5 +358,5 @@
         @brief Used to control the actual scrolling and the cursor.
     */
-    void InGameConsole::update(const Clock& time)
+    void InGameConsole::preUpdate(const Clock& time)
     {
         if (this->scroll_ != 0)
@@ -456,18 +456,10 @@
         @param s String to be printed
     */
-    void InGameConsole::print(const std::string& text, int index, bool alwaysShift)
-    {
-        char level = 0;
-        if (text.size() > 0)
-            level = text[0];
-
+    void InGameConsole::print(const std::string& text, Shell::LineType type, int index, bool alwaysShift)
+    {
         std::string output = text;
-
-        if (level >= -1 && level <= 5)
-            output.erase(0, 1);
-
         if (LINES > index)
         {
-            this->colourLine(level, index);
+            this->colourLine(type, index);
 
             if (index > 0)
@@ -477,12 +469,12 @@
                 {
                     ++linesUsed;
-                    this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output.substr(0, this->maxCharsPerLine_)));
+                    this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::DisplayString>(output.substr(0, this->maxCharsPerLine_)));
                     output.erase(0, this->maxCharsPerLine_);
                     output.insert(0, 1, ' ');
                     if (linesUsed > numLinesShifted_ || alwaysShift)
                         this->shiftLines();
-                    this->colourLine(level, index);
+                    this->colourLine(type, index);
                 }
-                this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output));
+                this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::DisplayString>(output));
                 this->displayedText_ = output;
                 this->numLinesShifted_ = linesUsed;
@@ -502,5 +494,5 @@
                   this->inputWindowStart_ = 0;
                 this->displayedText_ = output;
-                this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output));
+                this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::DisplayString>(output));
             }
         }
@@ -559,41 +551,39 @@
     }
 
-    void InGameConsole::colourLine(int colourcode, int index)
-    {
-        if (colourcode == -1)
-        {
-            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.90, 0.90, 0.90, 1.00));
-            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 1.00, 1.00, 1.00));
-        }
-        else if (colourcode == 1)
-        {
-            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.95, 0.25, 0.25, 1.00));
-            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 0.50, 0.50, 1.00));
-        }
-        else if (colourcode == 2)
-        {
-            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.95, 0.50, 0.20, 1.00));
-            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 0.70, 0.50, 1.00));
-        }
-        else if (colourcode == 3)
-        {
-            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.50, 0.50, 0.95, 1.00));
-            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 0.80, 1.00, 1.00));
-        }
-        else if (colourcode == 4)
-        {
-            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.65, 0.48, 0.44, 1.00));
-            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 0.90, 0.90, 1.00));
-        }
-        else if (colourcode == 5)
-        {
-            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.40, 0.20, 0.40, 1.00));
-            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 0.60, 0.80, 1.00));
-        }
-        else
-        {
-            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.21, 0.69, 0.21, 1.00));
-            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 1.00, 0.80, 1.00));
-        }
+    void InGameConsole::colourLine(Shell::LineType type, int index)
+    {
+        ColourValue colourTop, colourBottom;
+        switch (type)
+        {
+        case Shell::Error:   colourTop = ColourValue(0.95, 0.25, 0.25, 1.00);
+                          colourBottom = ColourValue(1.00, 0.50, 0.50, 1.00); break;
+
+        case Shell::Warning: colourTop = ColourValue(0.95, 0.50, 0.20, 1.00);
+                          colourBottom = ColourValue(1.00, 0.70, 0.50, 1.00); break;
+
+        case Shell::Info:    colourTop = ColourValue(0.50, 0.50, 0.95, 1.00);
+                          colourBottom = ColourValue(0.80, 0.80, 1.00, 1.00); break;
+
+        case Shell::Debug:   colourTop = ColourValue(0.65, 0.48, 0.44, 1.00);
+                          colourBottom = ColourValue(1.00, 0.90, 0.90, 1.00); break;
+
+        case Shell::Verbose: colourTop = ColourValue(0.40, 0.20, 0.40, 1.00);
+                          colourBottom = ColourValue(0.80, 0.60, 0.80, 1.00); break;
+
+        case Shell::Ultra:   colourTop = ColourValue(0.21, 0.69, 0.21, 1.00);
+                          colourBottom = ColourValue(0.80, 1.00, 0.80, 1.00); break;
+
+        case Shell::Command: colourTop = ColourValue(0.80, 0.80, 0.80, 1.00);
+                          colourBottom = ColourValue(0.90, 0.90, 0.90, 0.90); break;
+
+        case Shell::Hint:    colourTop = ColourValue(0.80, 0.80, 0.80, 1.00);
+                          colourBottom = ColourValue(0.90, 0.90, 0.90, 1.00); break;
+
+        default:             colourTop = ColourValue(0.90, 0.90, 0.90, 1.00);
+                          colourBottom = ColourValue(1.00, 1.00, 1.00, 1.00); break;
+        }
+
+        this->consoleOverlayTextAreas_[index]->setColourTop   (colourTop);
+        this->consoleOverlayTextAreas_[index]->setColourBottom(colourBottom);
     }
 
Index: code/trunk/src/orxonox/overlays/InGameConsole.h
===================================================================
--- code/trunk/src/orxonox/overlays/InGameConsole.h	(revision 6105)
+++ code/trunk/src/orxonox/overlays/InGameConsole.h	(revision 6417)
@@ -52,5 +52,5 @@
         void setConfigValues();
 
-        void update(const Clock& time);
+        void preUpdate(const Clock& time);
 
         static void openConsole();
@@ -72,7 +72,7 @@
 
         void shiftLines();
-        void colourLine(int colourcode, int index);
+        void colourLine(Shell::LineType type, int index);
         void setCursorPosition(unsigned int pos);
-        void print(const std::string& text, int index, bool alwaysShift = false);
+        void print(const std::string& text, Shell::LineType type, int index, bool alwaysShift = false);
 
         void windowResized(unsigned int newWidth, unsigned int newHeight);
Index: code/trunk/src/orxonox/overlays/Map.cc
===================================================================
--- code/trunk/src/orxonox/overlays/Map.cc	(revision 6105)
+++ code/trunk/src/orxonox/overlays/Map.cc	(revision 6417)
@@ -49,4 +49,5 @@
 #include <OgreViewport.h>
 
+#include "util/StringUtils.h"
 #include "core/ConsoleCommand.h"
 #include "core/CoreIncludes.h"
@@ -94,9 +95,6 @@
 
         //Getting Scene Manager (Hack)
-        if( !sManager_ )
-        {
-            ObjectList<Scene>::iterator it = ObjectList<Scene>::begin();
-            this->sManager_ = it->getSceneManager();
-        }
+        ObjectList<Scene>::iterator it = ObjectList<Scene>::begin();
+        this->sManager_ = it->getSceneManager();
         if( !Map::getMapSceneManager() )
         {
Index: code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
===================================================================
--- code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 6105)
+++ code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 6417)
@@ -39,8 +39,10 @@
 #include <OgrePanelOverlayElement.h>
 #include <OgreRenderWindow.h>
+#include <OgreMaterialManager.h>
+#include <OgreTechnique.h>
+#include <OgrePass.h>
 
 #include "util/Convert.h"
 #include "util/Exception.h"
-#include "util/StringUtils.h"
 #include "core/GameMode.h"
 #include "core/CoreIncludes.h"
@@ -83,13 +85,13 @@
         // Get aspect ratio from the render window. Later on, we get informed automatically
         this->windowAspectRatio_ = static_cast<float>(this->getWindowWidth()) / this->getWindowHeight();
-        this->sizeCorrectionChanged();
-
-        this->changedVisibility();
-
-        setSize(Vector2(1.0f, 1.0f));
-        setPickPoint(Vector2(0.0f, 0.0f));
-        setPosition(Vector2(0.0f, 0.0f));
-        setRotation(Degree(0.0));
-        setAspectCorrection(false);
+
+        this->size_ = Vector2(1.0f, 1.0f);
+        this->pickPoint_= Vector2(0.0f, 0.0f);
+        this->position_ = Vector2(0.0f, 0.0f);
+        this->angle_ = Degree(0.0);
+        this->bCorrectAspect_ = false;
+        this->rotState_ = Horizontal;
+        this->angleChanged(); // updates all other values as well
+
         setBackgroundMaterial("");
     }
@@ -143,5 +145,5 @@
 
         if (OrxonoxOverlay::overlays_s.find(this->getName()) != OrxonoxOverlay::overlays_s.end())
-            COUT(1) << "Overlay names should be unique or you cannnot access them via console. Name: \"" << this->getName() << "\"" << std::endl;
+            COUT(1) << "Overlay names should be unique or you cannnot access them via console. Name: \"" << this->getName() << '"' << std::endl;
 
         OrxonoxOverlay::overlays_s[this->getName()] = this;
@@ -151,5 +153,5 @@
     void OrxonoxOverlay::setBackgroundMaterial(const std::string& material)
     {
-        if (this->background_ && material != "")
+        if (this->background_ && !material.empty())
             this->background_->setMaterialName(material);
     }
@@ -168,5 +170,5 @@
     {
         SUPER( OrxonoxOverlay, changedVisibility );
-        
+
         if (!this->overlay_)
             return;
@@ -309,5 +311,5 @@
         std::map<std::string, OrxonoxOverlay*>::const_iterator it = overlays_s.find(name);
         if (it != overlays_s.end())
-            (*it).second->scale(Vector2(scale, scale));
+            it->second->scale(Vector2(scale, scale));
     }
 
@@ -324,5 +326,5 @@
         if (it != overlays_s.end())
         {
-            OrxonoxOverlay* overlay= (*it).second;
+            OrxonoxOverlay* overlay= it->second;
             if(overlay->isVisible())
                 overlay->hide();
@@ -343,5 +345,5 @@
         std::map<std::string, OrxonoxOverlay*>::const_iterator it = overlays_s.find(name);
         if (it != overlays_s.end())
-            (*it).second->scroll(scroll);
+            it->second->scroll(scroll);
     }
 
@@ -357,5 +359,5 @@
         std::map<std::string, OrxonoxOverlay*>::const_iterator it = overlays_s.find(name);
         if (it != overlays_s.end())
-            (*it).second->rotate(angle);
+            it->second->rotate(angle);
     }
 
@@ -370,3 +372,9 @@
         }
     }
+
+    void OrxonoxOverlay::setBackgroundAlpha(float alpha) {
+        Ogre::MaterialPtr ptr = this->background_->getMaterial();
+        Ogre::TextureUnitState* tempTx = ptr->getTechnique(0)->getPass(0)->getTextureUnitState(0);
+        tempTx->setAlphaOperation(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, alpha);
+    }
 }
Index: code/trunk/src/orxonox/overlays/OrxonoxOverlay.h
===================================================================
--- code/trunk/src/orxonox/overlays/OrxonoxOverlay.h	(revision 6105)
+++ code/trunk/src/orxonox/overlays/OrxonoxOverlay.h	(revision 6417)
@@ -155,4 +155,9 @@
         static void rotateOverlay(const std::string& name, const Degree& angle);
 
+        void setBackgroundMaterial(const std::string& material);
+        const std::string& getBackgroundMaterial() const;
+
+        void setBackgroundAlpha(float alpha);
+
         virtual void changedVisibility();
 
@@ -172,5 +177,5 @@
         inline OverlayGroup* getOverlayGroup() const
             { return this->group_; }
-        virtual void changedOverlayGroup() 
+        virtual void changedOverlayGroup()
             { this->changedVisibility(); }
 
@@ -180,7 +185,4 @@
         virtual void sizeChanged();
         virtual void positionChanged();
-
-        void setBackgroundMaterial(const std::string& material);
-        const std::string& getBackgroundMaterial() const;
 
         Ogre::Overlay* overlay_;                   //!< The overlay the entire class is about.
@@ -205,4 +207,5 @@
         BaseObject* owner_;
         OverlayGroup* group_;
+        Ogre::Pass* backgroundAlphaPass_;
   };
 
Index: code/trunk/src/orxonox/overlays/OverlayGroup.cc
===================================================================
--- code/trunk/src/orxonox/overlays/OverlayGroup.cc	(revision 6105)
+++ code/trunk/src/orxonox/overlays/OverlayGroup.cc	(revision 6417)
@@ -144,5 +144,5 @@
     {
         SUPER( OverlayGroup, changedVisibility );
-        
+
         for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
             (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed
