Index: code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationOverlay.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationOverlay.cc	(revision 2780)
+++ code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationOverlay.cc	(revision 2781)
@@ -43,10 +43,10 @@
 {
 
-    NotificationOverlay::NotificationOverlay(BaseObject* creator) : OrxonoxOverlay(creator)
+    NotificationOverlay::NotificationOverlay(BaseObject* creator) : OverlayText(creator)
     {
         this->initialize();
     }
-    
-    NotificationOverlay::NotificationOverlay(NotificationQueue* queue, Notification* notification) : OrxonoxOverlay(this)
+
+    NotificationOverlay::NotificationOverlay(NotificationQueue* queue, Notification* notification) : OverlayText(this)
     {
         this->initialize();
@@ -61,11 +61,4 @@
         
         this->processNotification(notification);
-
-        COUT(3) << getCaption() << std::endl;
-        COUT(3) << getFontSize() << std::endl;
-        //COUT(3) << getFont() << std::endl;
-        COUT(3) << getWidth() << std::endl;
-        COUT(3) << getAlignmentString() << std::endl;
-        COUT(3) << getTextSize() << std::endl;
     }
     
@@ -75,6 +68,4 @@
         
         this->queue_ = NULL;
-        this->notificationText_ = NULL;
-        this->width_ = 0;
     }
     
@@ -82,50 +73,14 @@
     {
         this->setFont(this->queue_->getFont());
-        this->setFontSize(this->queue_->getFontSize());
-        
-        this->notificationText_ = static_cast<Ogre::TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton().createOverlayElement("TextArea", "NotificationOverlay_notificationText_" + getUniqueNumberString()));
-        this->notificationText_->setCharHeight(1.0);
-        this->notificationText_->setColour(ColourValue(1.0, 1.0, 1.0, 1.0));
-        this->notificationText_->setAlignment(Ogre::TextAreaOverlayElement::Center);
-        this->notificationText_->setCaption("");
-        
-        this->background_->addChild(this->notificationText_);
-        COUT(3) << this->queue_->getFont() << std::endl;
+        this->setTextSize(this->queue_->getFontSize());
     }
-    
+
     NotificationOverlay::~NotificationOverlay()
     {
-    
-    }
-    
-    void NotificationOverlay::setFont(const std::string & font)
-    {
-        if (this->notificationText_ && font != "")
-            this->notificationText_->setFontName(font);
     }
 
-    void NotificationOverlay::setFontSize(float size)
-    {
-        if (this->notificationText_ && size >= 0)
-            this->notificationText_->setCharHeight(size);
-    }
-    
-    void NotificationOverlay::setWidth(int width)
-    {
-        this->width_ = width;
-        this->notificationText_->setCaption(clipMessage(this->notification_->getMessage()));
-    }
-
-    float NotificationOverlay::getFontSize(void) const
-    {
-        if (this->notificationText_)
-            return this->notificationText_->getCharHeight();
-        else
-            return 0;
-    }
-    
     bool NotificationOverlay::processNotification(Notification* notification)
     {
-        this->notificationText_->setCaption(clipMessage(notification->getMessage()));
+        this->setCaption(clipMessage(notification->getMessage()));
         this->notification_ = notification;
         return true;
@@ -139,100 +94,3 @@
     }
 
-    const std::string NotificationOverlay::clipMessage2(const std::string & str)
-    {
-    
-        std::string message = str;
-        unsigned int i = 0;
-        
-        unsigned int found = message.find("\\n", i);
-        while(found != std::string::npos)
-        {
-            message.replace(found, 2, "\n");
-            i = found+2;
-            found = message.find("\\n", i);
-        }
-    
-        std::string clippedMessage = "";
-        int wordLength = 0;
-        i = 0;
-        int widthLeft = this->getWidth();
-        while(i < message.length())
-        {
-            while(i < message.length() && message[i] != ' ' && message[i] != '\n')
-            {
-                i++;
-                wordLength++;
-            }
-            
-            if(wordLength <= widthLeft)
-            {
-                clippedMessage = clippedMessage + message.substr(i-wordLength, wordLength);
-                if(i < message.length())
-                {
-                    clippedMessage = clippedMessage + message.substr(i,1);
-                }
-                widthLeft -= (wordLength+1);
-                if(message[i] == '\n')
-                {
-                    widthLeft = this->getWidth() - (wordLength+1);
-                }
-                wordLength = 0;
-                i++;
-            }
-            else
-            {
-                clippedMessage.push_back('\n');
-                clippedMessage = clippedMessage + message.substr(i-wordLength, wordLength);
-                if(i < message.length())
-                {
-                    clippedMessage = clippedMessage + message.substr(i,1);
-                }
-                widthLeft = this->getWidth() - (wordLength+1);
-                i++;
-                wordLength = 0;
-            }
-        }
-        
-        return clippedMessage;
-    }
-
-    void NotificationOverlay::sizeChanged()
-    {
-        if (this->rotState_ == Horizontal)
-            this->overlay_->setScale(size_.y * sizeCorrection_.y, size_.y * sizeCorrection_.y);
-        else if (this->rotState_ == Vertical)
-            this->overlay_->setScale(size_.y / (sizeCorrection_.y * sizeCorrection_.y), size_.y * sizeCorrection_.y);
-        else
-            this->overlay_->setScale(size_.y, size_.y);
-
-        positionChanged();
-    }
-
-    void NotificationOverlay::setAlignmentString(const std::string& alignment)
-    {
-        if (alignment == "right")
-            this->setAlignment(Ogre::TextAreaOverlayElement::Right);
-        else if (alignment == "center")
-            this->setAlignment(Ogre::TextAreaOverlayElement::Center);
-        else // "left" and default
-            this->setAlignment(Ogre::TextAreaOverlayElement::Left);
-    }
-
-    std::string NotificationOverlay::getAlignmentString() const
-    {
-        Ogre::TextAreaOverlayElement::Alignment alignment = this->notificationText_->getAlignment();
-
-        switch (alignment)
-        {
-            case Ogre::TextAreaOverlayElement::Right:
-                return "right";
-            case Ogre::TextAreaOverlayElement::Center:
-                return "center";
-            case Ogre::TextAreaOverlayElement::Left:
-                return "left";
-            default:
-                assert(false); return "";
-        }
-    }
-
 }
Index: code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationOverlay.h
===================================================================
--- code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationOverlay.h	(revision 2780)
+++ code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationOverlay.h	(revision 2781)
@@ -32,5 +32,5 @@
 #include "OrxonoxPrereqs.h"
 
-#include "orxonox/overlays/OrxonoxOverlay.h"
+#include "orxonox/overlays/OverlayText.h"
 
 #include <string>
@@ -48,9 +48,7 @@
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport NotificationOverlay : public OrxonoxOverlay
+    class _OrxonoxExport NotificationOverlay : public OverlayText
     {
-    
-        friend class NotificationQueue; //TDO: Best solution?
-    
+
         public:
             NotificationOverlay(BaseObject* creator);
@@ -59,49 +57,17 @@
             
             bool processNotification(Notification* notification);
+
+            void setFontSize(float size)
+                { this->setTextSize(size); }
         
         protected:
             const std::string clipMessage(const std::string & message);
-            const std::string clipMessage2(const std::string & message); //Outdated
-        
+
         private:
             NotificationQueue* queue_;
             Notification* notification_;
-            
-            int width_;
-            
-            Ogre::TextAreaOverlayElement* notificationText_;
-            
+
             void initialize(void);
             void defineOverlay(void);
-
-            virtual void sizeChanged();
-
-            void setAlignment(Ogre::TextAreaOverlayElement::Alignment alignment)
-                { this->notificationText_->setAlignment(alignment); }
-            void setCaption(const std::string& caption)
-                { this->notificationText_->setCaption(caption); }
-            void setColour(const ColourValue& colour)
-                { this->notificationText_->setColour(colour); }
-            void setFont(const std::string & font);
-            void setFontSize(float size);
-            void setWidth(int width);
-            void setAlignmentString(const std::string& alignment);
-            void setTextSize(float size)
-                { this->setSize(Vector2(size, size)); }
-            
-            Ogre::TextAreaOverlayElement::Alignment getAlignment() const
-                { return this->notificationText_->getAlignment(); }
-            std::string getCaption() const
-                { return this->notificationText_->getCaption(); }
-            float getFontSize(void) const;
-            const std::string & getFont(void) const
-                { return this->notificationText_->getFontName(); }
-            int getWidth(void) const
-                { return this->width_; }
-            const ColourValue& getColour() const
-                { return this->notificationText_->getColour(); }
-            std::string getAlignmentString() const;
-            float getTextSize() const
-                { return this->getSize().y; }
 
     };
