Index: code/branches/tutoriallevel3/src/modules/notifications/CMakeLists.txt
===================================================================
--- code/branches/tutoriallevel3/src/modules/notifications/CMakeLists.txt	(revision 8452)
+++ code/branches/tutoriallevel3/src/modules/notifications/CMakeLists.txt	(revision 8453)
@@ -1,7 +1,7 @@
 SET_SOURCE_FILES(NOTIFICATIONS_SRC_FILES
-  Notification.cc
   NotificationDispatcher.cc
   NotificationManager.cc
   NotificationQueue.cc
+  NotificationQueueCEGUI.cc
 )
 
@@ -13,5 +13,5 @@
   TOLUA_FILES
     NotificationManager.h
-    NotificationQueue.h
+    NotificationQueueCEGUI.h
   PCH_FILE
     NotificationsPrecompiledHeaders.h
Index: code/branches/tutoriallevel3/src/modules/notifications/Notification.cc
===================================================================
--- code/branches/tutoriallevel3/src/modules/notifications/Notification.cc	(revision 8452)
+++ 	(revision )
@@ -1,77 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See thes
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Damian 'Mozork' Frick
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @file Notification.cc
-    @brief Implementation of the Notification class.
-*/
-
-#include "Notification.h"
-
-#include "core/CoreIncludes.h"
-#include "NotificationManager.h"
-
-namespace orxonox
-{
-
-    /**
-    @brief
-        Constructor. Creates a Notification with the input message and sender.
-    @param message
-        The message of the Notification.
-    @param sender
-        The sender of the Notification.
-    */
-    Notification::Notification(const std::string& message, const std::string& sender)
-    {
-        RegisterRootObject(Notification);
-        this->initialize();
-        this->message_ = message;
-        this->sender_ = sender;
-    }
-
-    /**
-    @brief
-        Destructor.
-    */
-    Notification::~Notification()
-    {
-
-    }
-
-    /**
-    @brief
-        Registers the object and sets some default values.
-    */
-    void Notification::initialize(void)
-    {
-        this->message_.clear();
-        this->sender_ = NotificationManager::NONE;
-    }
-
-}
Index: code/branches/tutoriallevel3/src/modules/notifications/Notification.h
===================================================================
--- code/branches/tutoriallevel3/src/modules/notifications/Notification.h	(revision 8452)
+++ 	(revision )
@@ -1,88 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Damian 'Mozork' Frick
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @file Notification.h
-    @brief Definition of the Notification class.
-    @ingroup Notifications
-*/
-
-#ifndef _Notification_H__
-#define _Notification_H__
-
-#include "notifications/NotificationsPrereqs.h"
-
-#include <string>
-#include "core/OrxonoxClass.h"
-
-namespace orxonox
-{
-
-    /**
-    @brief
-        A Notification represents a short message used to inform the player about something that just happened. With the @ref orxonox::NotificationManager "NotificationManager" a Notification can be sent from any part of orxonox and is then displayed by the proper @ref orxonox::NotificationQueue "NotificationQueue(s)" (depending on which senders the specific @ref orxonox::NotificationQueue "NotificationQueues" accepts).
-
-        A Notification is just a datastructure that is used internally by the Notifications module.
-
-    @author
-        Damian 'Mozork' Frick
-
-    @ingroup Notifications
-    */
-    class _NotificationsExport Notification : public OrxonoxClass
-    {
-        public:
-            Notification(const std::string& message, const std::string& sender);
-            virtual ~Notification();
-
-            /**
-            @brief Get the message of the Notification.
-            @return Returns the message of the Notification.
-            */
-            inline const std::string & getMessage(void) const
-                { return this->message_; }
-
-            /**
-            @brief Get the sender of the Notification.
-            @return Returns the sender of the Notification.
-            */
-            inline const std::string & getSender(void) const
-                { return this->sender_; }
-
-        private:
-            std::string message_; //!< The Notification message.
-            std::string sender_; //!< The sender of the notification.
-
-            void initialize(void); //!< Registers the object and sets some default values.
-            void registerVariables(void) {}
-
-    };
-
-}
-
-#endif /* _Notification_H__ */
Index: code/branches/tutoriallevel3/src/modules/notifications/NotificationDispatcher.cc
===================================================================
--- code/branches/tutoriallevel3/src/modules/notifications/NotificationDispatcher.cc	(revision 8452)
+++ code/branches/tutoriallevel3/src/modules/notifications/NotificationDispatcher.cc	(revision 8453)
@@ -41,8 +41,7 @@
 
 #include "infos/PlayerInfo.h"
+#include "interfaces/NotificationListener.h"
 #include "interfaces/PlayerTrigger.h"
 #include "worldentities/pawns/Pawn.h"
-
-#include "NotificationManager.h"
 
 namespace orxonox
@@ -61,5 +60,5 @@
         RegisterObject(NotificationDispatcher);
 
-        this->sender_ = NotificationManager::NONE;
+        this->sender_ = NotificationListener::NONE;
         this->registerVariables();
     }
@@ -114,5 +113,6 @@
         {
             const std::string message = this->createNotificationMessage();
-            NotificationManager::sendNotification(message, clientId, this->getSender());
+            // TODO: Make the type configurable.
+            NotificationListener::sendNotification(message, this->getSender(), notificationMessageType::info, notificationSendMode::network, clientId);
         }
         else if(GameMode::isServer())
Index: code/branches/tutoriallevel3/src/modules/notifications/NotificationManager.cc
===================================================================
--- code/branches/tutoriallevel3/src/modules/notifications/NotificationManager.cc	(revision 8452)
+++ code/branches/tutoriallevel3/src/modules/notifications/NotificationManager.cc	(revision 8453)
@@ -36,33 +36,17 @@
 #include "core/command/ConsoleCommand.h"
 #include "core/CoreIncludes.h"
-#include "core/GUIManager.h"
 #include "core/LuaState.h"
-#include "network/Host.h"
-#include "network/NetworkFunction.h"
 #include "util/ScopedSingletonManager.h"
 
 #include "interfaces/NotificationListener.h"
 
-#include "Notification.h"
 #include "NotificationQueue.h"
-
-#include "ToluaBindNotifications.h"
+#include "NotificationQueueCEGUI.h"
 
 namespace orxonox
 {
 
-    const std::string NotificationManager::ALL("all");
-    const std::string NotificationManager::NONE("none");
-
-    // Register tolua_open function when loading the library.
-    DeclareToluaInterface(Notifications);
-
     ManageScopedSingleton(NotificationManager, ScopeID::Root, false);
 
-    // Setting console command to enter the edit mode.
-    SetConsoleCommand("enterEditMode", &NotificationManager::enterEditMode);
-
-    registerStaticNetworkFunction(NotificationManager::sendNotification);
-
     /**
     @brief
@@ -73,8 +57,4 @@
         RegisterRootObject(NotificationManager);
 
-        this->highestIndex_ = 0;
-
-        ModifyConsoleCommand("enterEditMode").setObject(this);
-
         COUT(3) << "NotificatioManager created." << std::endl;
     }
@@ -86,6 +66,4 @@
     NotificationManager::~NotificationManager()
     {
-        ModifyConsoleCommand("enterEditMode").setObject(NULL);
-
         // Destroys all Notifications.
         for(std::multimap<std::time_t, Notification*>::iterator it = this->allNotificationsList_.begin(); it!= this->allNotificationsList_.end(); it++)
@@ -106,5 +84,5 @@
         while(it != this->queues_.end())
         {
-            it->second->destroy(true);
+            it->second->destroy();
             it = this->queues_.begin();
         }
@@ -115,33 +93,75 @@
     /**
     @brief
-        Sends a Notification with the specified message to the specified client from the specified sender.
+        Creates and registers a Notification with the input message from the input sender.
+        This is called by the NotificationListener, whenever a new notification arrives.
     @param message
-        The message that should be sent.
-    @param clientId
-        The id of the client the notification should be sent to.
+        The message of the new Notification.
     @param sender
-        The sender that sent the notification.
-    @param isLocal
-        If this is set to true (false is default), then the Notification is sent to the client where this function is executed, meaning the Notification is sent locally.
-    */
-    /*static*/ void NotificationManager::sendNotification(const std::string& message, unsigned int clientId, const std::string& sender, bool isLocal)
-    {
-        // If we're in standalone mode or we're already no the right client we create and send the Notification.
-        if(GameMode::isStandalone() || isLocal || Host::getPlayerID() == clientId)
-        {
-            Notification* notification = new Notification(message, sender);
-            if(NotificationManager::getInstance().registerNotification(notification))
-                COUT(3) << "Notification \"" << notification->getMessage() << "\" sent." << std::endl;
-        }
-        // If we're on the server (and the server is not the intended recipient of the Notification) we send it over the network.
-        else if(GameMode::isServer())
-        {
-            callStaticNetworkFunction(NotificationManager::sendNotification, clientId, message, clientId, sender);
-        }
-    }
-
-    /**
-    @brief
-        Registers a Notification within the NotificationManager and makes sure that the Notification is sent to all the NotificationListeners associated with its sender.
+        The name of the entity (of the collective) that sent the new Notification.
+    @param type
+        The type of the new Notification.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationManager::registerNotification(const std::string& message, const std::string& sender, notificationMessageType::Value type)
+    {
+        // TODO: Do something with the type.
+        Notification* notification = new Notification(message, sender, type);
+        return this->registerNotification(notification);
+    }
+
+    /**
+    @brief
+        Executes the input command from the input sender.
+        This is called by the NotificationListener, whenever a new command arrives.
+    @param command
+        The command to be executed,
+    @param sender
+        The The name of the entity (of the collective) that sent the command.
+    @return
+        Returns true if the command was successfully executed.
+    */
+    bool NotificationManager::executeCommand(notificationCommand::Value command, const std::string& sender)
+    {
+        bool commandExecuted = false;
+        if(command == notificationCommand::clear)
+        {
+            if(this->commandClear(sender))
+                commandExecuted = true;
+        }
+
+        if(commandExecuted)
+            COUT(3) << "Notification command \"" << NotificationListener::command2Str(command) << "\" executed." << endl;
+
+        return commandExecuted;
+    }
+
+    /**
+    @brief
+        The clear command. Clears all NotificationQueues that have its sender as a target.
+    @param sender
+        The sender of the clear command.
+    @return
+        Returns true if the command was successfully executed by at least one NotificationQueue, false if it was not executed.
+    */
+    bool NotificationManager::commandClear(const std::string& sender)
+    {
+        bool all = (sender == NotificationListener::ALL);
+        bool executed = false;
+        // Clear all NotificationQueues that have the input sender as target.
+        for(std::map<const std::string, NotificationQueue*>::iterator it = this->queues_.begin(); it != this->queues_.end(); it++) // Iterate through all NotificationQueues.
+        {
+            const std::set<std::string>& set = it->second->getTargetsSet();
+            // If either the sender is 'all', the NotificationQueue has as target all or the NotificationQueue has the input sender as a target.
+            if(all || set.find(NotificationListener::ALL) != set.end() || set.find(sender) != set.end())
+                executed = it->second->tidy() || executed;
+        }
+
+        return executed;
+    }
+    
+    /**
+    @brief
+        Registers a Notification within the NotificationManager and makes sure that the Notification is sent to all the NotificationQueues associated with its sender.
     @param notification
         The Notification to be registered.
@@ -158,22 +178,21 @@
         this->allNotificationsList_.insert(std::pair<std::time_t, Notification*>(time, notification));
 
-        if(notification->getSender() == NotificationManager::NONE) // If the sender has no specific name, then the Notification is only added to the list of all Notifications.
+        if(notification->getSender() == NotificationListener::NONE) // If the sender has no specific name, then the Notification is only added to the list of all Notifications.
             return true;
 
-        bool all = false;
-        if(notification->getSender() == NotificationManager::ALL) // If all are the sender, then the Notifications is added to every NotificationListener.
-            all = true;
-
-        // Insert the Notification in all NotificationListeners that have its sender as target.
-        for(std::map<NotificationListener*, unsigned int>::iterator it = this->listenerList_.begin(); it != this->listenerList_.end(); it++) // Iterate through all NotificationListeners.
-        {
-            const std::set<std::string>& set = it->first->getTargetsSet();
-            bool bAll = set.find(NotificationManager::ALL) != set.end();
-            // If either the Notification has as sender 'all', the NotificationListener displays all Notifications or the NotificationListener has the sender of the Notification as target.
+        // If all are the sender, then the Notifications is added to every NotificationQueue.
+        bool all = (notification->getSender() == NotificationListener::ALL);
+
+        // Insert the Notification in all NotificationQueues that have its sender as target.
+        for(std::map<const std::string, NotificationQueue*>::iterator it = this->queues_.begin(); it != this->queues_.end(); it++) // Iterate through all NotificationQueues.
+        {
+            const std::set<std::string>& set = it->second->getTargetsSet();
+            bool bAll = set.find(NotificationListener::ALL) != set.end();
+            // If either the Notification has as sender 'all', the NotificationQueue displays all Notifications or the NotificationQueue has the sender of the Notification as target.
             if(all || bAll || set.find(notification->getSender()) != set.end())
             {
                 if(!bAll)
-                    this->notificationLists_[it->second]->insert(std::pair<std::time_t, Notification*>(time, notification)); // Insert the Notification in the notifications list of the current NotificationListener.
-                it->first->update(notification, time); // Update the NotificationListener.
+                    this->notificationLists_[it->second->getName()]->insert(std::pair<std::time_t, Notification*>(time, notification)); // Insert the Notification in the notifications list of the current NotificationQueue.
+                it->second->update(notification, time); // Update the NotificationQueue.
             }
         }
@@ -186,19 +205,19 @@
     /**
     @brief
-        Unregisters a Notification within the NotificationManager for a given NotificationListener.
+        Unregisters a Notification within the NotificationManager for a given NotificationQueue.
     @param notification
         A pointer to the Notification to be unregistered.
-    @param listener
-        A pointer to the NotificationListener the Notification is unregistered for.
-    */
-    void NotificationManager::unregisterNotification(Notification* notification, NotificationListener* listener)
+    @param queue
+        A pointer to the NotificationQueue the Notification is unregistered for.
+    */
+    void NotificationManager::unregisterNotification(Notification* notification, NotificationQueue* queue)
     {
         assert(notification);
-        assert(listener);
-
-        // Remove the Notification from the list of Notifications of the input NotificationListener.
-        this->removeNotification(notification, *(this->notificationLists_.find(this->listenerList_.find(listener)->second)->second));
-
-        COUT(4) << "Notification (&" << notification << ") unregistered with the NotificationManager from listener (&" << listener << ")" << std::endl;
+        assert(queue);
+
+        // Remove the Notification from the list of Notifications of the input NotificationQueue.
+        this->removeNotification(notification, *(this->notificationLists_.find(queue->getName())->second));
+
+        COUT(4) << "Notification (&" << notification << ") unregistered with the NotificationManager from NotificationQueue " << queue->getName() << "." << std::endl;
     }
 
@@ -230,89 +249,7 @@
     /**
     @brief
-        Registers a NotificationListener within the NotificationManager.
-    @param listener
-        The NotificationListener to be registered.
-    @return
-        Returns true if successful.  Fales if the NotificationListener is already registered.
-    */
-    bool NotificationManager::registerListener(NotificationListener* listener)
-    {
-        assert(listener);
-
-        // If the NotificationListener is already registered.
-        if(this->listenerList_.find(listener) != this->listenerList_.end())
-            return false;
-
-        this->highestIndex_ += 1;
-        unsigned int index = this->highestIndex_; // An identifier that identifies each registered NotificationListener uniquely.
-
-        this->listenerList_[listener] = index; // Add the NotificationListener to the list of NotificationListeners.
-
-        const std::set<std::string>& set = listener->getTargetsSet();
-
-        // If all senders are the target of the NotificationListener, then the list of Notifications for that specific NotificationListener is the same as the list of all Notifications.
-        bool bAll = set.find(NotificationManager::ALL) != set.end();
-        std::multimap<std::time_t, Notification*>* map = NULL;
-        if(bAll)
-            this->notificationLists_[index] = &this->allNotificationsList_;
-        // Else a new list (resp. multimap) is created and added to the list of Notification lists for NotificationListeners.
-        else
-        {
-            this->notificationLists_[index] = new std::multimap<std::time_t, Notification*>;
-            map = this->notificationLists_[index];
-        }
-
-        // Iterate through all Notifications to determine whether any of them should belong to the newly registered NotificationListener.
-        for(std::multimap<std::time_t, Notification*>::iterator it = this->allNotificationsList_.begin(); it != this->allNotificationsList_.end(); it++)
-        {
-            if(!bAll && set.find(it->second->getSender()) != set.end()) // Checks whether the listener has the sender of the current Notification as target.
-                map->insert(std::pair<std::time_t, Notification*>(it->first, it->second));
-        }
-
-        listener->update(); // Update the listener.
-
-        COUT(4) << "NotificationListener registered with the NotificationManager." << std::endl;
-
-        return true;
-    }
-
-    /**
-    @brief
-        Unregisters a NotificationListener within the NotificationManager.
-    @param listener
-        The NotificationListener to be unregistered.
-    */
-    void NotificationManager::unregisterListener(NotificationListener* listener)
-    {
-        assert(listener);
-
-        unsigned int identifier = this->listenerList_.find(listener)->second;
-        std::multimap<std::time_t, Notification*>* map = this->notificationLists_.find(identifier)->second;
-
-        // If the map is not the map of all Notifications, make sure all Notifications are unregistered.
-        std::multimap<std::time_t, Notification*>::iterator it = map->begin();
-        if(map != &this->allNotificationsList_)
-        {
-            while(it != map->end())
-            {
-                this->unregisterNotification(it->second, listener);
-                it = map->begin();
-            }
-            delete map;
-        }
-
-        COUT(4) << "NotificationListener '" << identifier << "' unregistered with the NotificationManager." << std::endl;
-
-        // Remove the NotificationListener from the list of NotificationListeners.
-        this->listenerList_.erase(listener);
-        // Remove the Notifications list that was associated with the input NotificationListener.
-        this->notificationLists_.erase(identifier);
-    }
-
-    /**
-    @brief
-        Fetches the Notifications for a specific NotificationListener in a specified timeframe and stores them in the input map.
-    @param listener
-        The NotificationListener the Notifications are fetched for.
+        Fetches the Notifications for a specific NotificationQueue in a specified timeframe and stores them in the input map.
+    @param queue
+        The NotificationQueue the Notifications are fetched for.
     @param map
         A pointer to a multimap, in which the notifications are stored. The map needs to have been allocated.
@@ -324,10 +261,10 @@
         Returns true if successful.
     */
-    void NotificationManager::getNotifications(NotificationListener* listener, std::multimap<std::time_t,Notification*>* map, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd)
-    {
-        assert(listener);
+    void NotificationManager::getNotifications(NotificationQueue* queue, std::multimap<std::time_t,Notification*>* map, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd)
+    {
+        assert(queue);
         assert(map);
 
-        std::multimap<std::time_t, Notification*>* notifications = this->notificationLists_[this->listenerList_[listener]]; // All the Notifications for the input NotificationListener.
+        std::multimap<std::time_t, Notification*>* notifications = this->notificationLists_[queue->getName()]; // All the Notifications for the input NotificationQueue.
 
         std::multimap<std::time_t,Notification*>::iterator it, itLowest, itHighest;
@@ -342,13 +279,31 @@
     /**
     @brief
-        Enters the edit mode of the NotificationLayer.
-    */
-    void NotificationManager::enterEditMode(void)
-    {
-        if(GameMode::showsGraphics())
-        {
-            GUIManager::getInstance().hideGUI("NotificationLayer");
-            GUIManager::getInstance().showGUI("NotificationLayer", false, false);
-            GUIManager::getInstance().getLuaState()->doString("NotificationLayer.enterEditMode()");
+        Fetches the newest Notifications for a specific NotificationQueue and stores them in the input map.
+    @param queue
+        The NotificationQueue the Notifications are fetched for.
+    @param map
+        A pointer to a multimap, in which the notifications are stored. The map needs to have been allocated.
+    @param numberOfNotifications
+        The number of newest Notifications to be got.
+    @return
+        Returns true if successful.
+    */
+    void NotificationManager::getNewestNotifications(NotificationQueue* queue, std::multimap<std::time_t, Notification*>* map, int numberOfNotifications)
+    {
+        assert(queue);
+        assert(map);
+
+        std::multimap<std::time_t, Notification*>* notifications = this->notificationLists_[queue->getName()]; // All the Notifications for the input NotificationQueue.
+
+        if(!notifications->empty()) // If the list of Notifications is not empty.
+        {
+            std::multimap<std::time_t,Notification*>::iterator it = notifications->end();
+            for(int i = 0; i < numberOfNotifications; i++) // Iterate through the Notifications from the newest until we have the specified number of notifications.
+            {
+                it--;
+                map->insert(std::pair<std::time_t, Notification*>(it->first, it->second)); // Add the found Notifications to the map.
+                if(it == notifications->begin())
+                    break;
+            }
         }
     }
@@ -357,5 +312,5 @@
     @brief
         Registers a NotificationQueue.
-        This makes sure that the NotificationQueue can be attained through lua by name. It also makes sure that the NotificationQueue is destroyed upon destruction of the NotificationManager.
+        This makes sure that the NotificationQueue can be accessed through lua by name. It also makes sure that the NotificationQueue is destroyed upon destruction of the NotificationManager.
     @param queue
         A pointer to the NotificationQueue to be registered.
@@ -365,6 +320,37 @@
     bool NotificationManager::registerQueue(NotificationQueue* queue)
     {
+        assert(queue);
+
+        // If the NotificationQueue is already registered.
+        if(this->queues_.find(queue->getName()) != this->queues_.end())
+            return false;
+
+        this->queues_.insert(std::pair<const std::string, NotificationQueue*>(queue->getName(), queue)); // Add the NotificationQueue to the list of NotificationQueues.
+
+        const std::set<std::string>& set = queue->getTargetsSet();
+
+        // If all senders are the target of the NotificationQueue, then the list of Notifications for that specific NotificationQueue is the same as the list of all Notifications.
+        bool bAll = set.find(NotificationListener::ALL) != set.end();
+        std::multimap<std::time_t, Notification*>* map = NULL;
+        if(bAll)
+            this->notificationLists_[queue->getName()] = &this->allNotificationsList_;
+        // Else a new list (resp. multimap) is created and added to the list of Notification lists for NotificationQueues.
+        else
+        {
+            this->notificationLists_[queue->getName()] = new std::multimap<std::time_t, Notification*>;
+            map = this->notificationLists_[queue->getName()];
+        }
+
+        // Iterate through all Notifications to determine whether any of them should belong to the newly registered NotificationQueue.
+        for(std::multimap<std::time_t, Notification*>::iterator it = this->allNotificationsList_.begin(); it != this->allNotificationsList_.end(); it++)
+        {
+            if(!bAll && set.find(it->second->getSender()) != set.end()) // Checks whether the listener has the sender of the current Notification as target.
+                map->insert(std::pair<std::time_t, Notification*>(it->first, it->second));
+        }
+
+        queue->update(); // Update the queue.
+        
         COUT(4) << "NotificationQueue '" << queue->getName() << "' registered with the NotificationManager." << std::endl;
-        return this->queues_.insert(std::pair<const std::string, NotificationQueue*>(queue->getName(), queue)).second;
+        return true;
     }
 
@@ -377,27 +363,26 @@
     void NotificationManager::unregisterQueue(NotificationQueue* queue)
     {
+        assert(queue);
+
+        std::multimap<std::time_t, Notification*>* map = this->notificationLists_.find(queue->getName())->second;
+
+        // If the map is not the map of all Notifications, make sure all Notifications are unregistered.
+        std::multimap<std::time_t, Notification*>::iterator it = map->begin();
+        if(map != &this->allNotificationsList_)
+        {
+            while(it != map->end())
+            {
+                this->unregisterNotification(it->second, queue);
+                it = map->begin();
+            }
+            delete map;
+        }
+
+        // Remove the NotificationQueue from the list of NotificationQueues.
+        this->queues_.erase(queue->getName());
+        // Remove the Notifications list that was associated with the input NotificationQueue.
+        this->notificationLists_.erase(queue->getName());
+        
         COUT(4) << "NotificationQueue '" << queue->getName() << "' unregistered with the NotificationManager." << std::endl;
-        this->queues_.erase(queue->getName());
-    }
-
-    /**
-    @brief
-        Loads all the NotificationQueues that should exist.
-    */
-    void NotificationManager::loadQueues(void)
-    {
-        new NotificationQueue("all");
-    }
-
-    /**
-    @brief
-        Creates a new NotificationQueue.
-        This is used in lua.
-    @param name
-        The name of the new NotificationQueue.
-    */
-    void NotificationManager::createQueue(const std::string& name)
-    {
-        new NotificationQueue(name);
     }
 
@@ -420,3 +405,60 @@
     }
 
+    /**
+    @brief
+        Loads all the NotificationQueues that should exist.
+    */
+    void NotificationManager::loadQueues(void)
+    {
+        NotificationQueueCEGUI* allQueue = new NotificationQueueCEGUI("all");
+        allQueue->setDisplaySize(Vector2(0.5, 0));
+        allQueue->setPosition(Vector4(0.0, 10, 0.3, 0));
+
+        NotificationQueueCEGUI* infoQueue = new NotificationQueueCEGUI("info", "gameinfo", 1, -1);
+        infoQueue->setPosition(Vector4(0.2, 0, 0.8, 0));
+        infoQueue->setFontSize(24);
+        infoQueue->setFontColor(Vector4(1.0, 1.0, 0.0, 0.8));
+        infoQueue->setAlignment("HorzCentred");
+        infoQueue->setDisplaySize(Vector2(0.6, 0.0));
+    }
+
+    // Notification class
+
+    /**
+    @brief
+        Constructor. Creates a Notification with the input message and sender.
+    @param message
+        The message of the Notification.
+    @param sender
+        The sender of the Notification.
+    @param type
+
+    */
+    Notification::Notification(const std::string& message, const std::string& sender, notificationMessageType::Value type)
+    {
+        this->initialize();
+        this->message_ = message;
+        this->sender_ = sender;
+        this->type_ = type;
+    }
+
+    /**
+    @brief
+        Destructor.
+    */
+    Notification::~Notification()
+    {
+
+    }
+
+    /**
+    @brief
+        Registers the object and sets some default values.
+    */
+    void Notification::initialize(void)
+    {
+        this->message_.clear();
+        this->sender_ = NotificationListener::NONE;
+    }
+
 }
Index: code/branches/tutoriallevel3/src/modules/notifications/NotificationManager.h
===================================================================
--- code/branches/tutoriallevel3/src/modules/notifications/NotificationManager.h	(revision 8452)
+++ code/branches/tutoriallevel3/src/modules/notifications/NotificationManager.h	(revision 8453)
@@ -42,6 +42,7 @@
 #include <string>
 
+#include "core/OrxonoxClass.h"
 #include "util/Singleton.h"
-#include "core/OrxonoxClass.h"
+#include "interfaces/NotificationListener.h"
 
 namespace orxonox // tolua_export
@@ -50,7 +51,60 @@
     /**
     @brief
-        The Singleton NotificationManager functions as a gateway between @ref orxonox::Notification "Notifications" and @ref orxonox::NotificationListener "NotificationListeners".
-        It receives, organizes @ref orxonox::Notification "Notifications" and the redistributes them to the specific @ref orxonox::NotificationListener "NotificationListeners".
-        It also provides a static function to send @ref orxonox::Notification "Notifications" and works as a liaison between the @ref orxonox::NotificationQueue "NotificationQueues" and the GUI that displays notification, called NotificationLayer.
+        A Notification represents a short message used to inform the player about something that just happened. With the @ref orxonox::NotificationManager "NotificationManager" a Notification can be sent from any part of orxonox and is then displayed by the proper @ref orxonox::NotificationQueue "NotificationQueue(s)" (depending on which senders the specific @ref orxonox::NotificationQueue "NotificationQueues" accepts).
+
+        A Notification is just a data structure that is used internally by the Notifications module.
+
+    @author
+        Damian 'Mozork' Frick
+
+    @ingroup Notifications
+    */
+    class _NotificationsExport Notification
+    {
+        public:
+            Notification(const std::string& message, const std::string& sender, notificationMessageType::Value type);
+            virtual ~Notification();
+
+            /**
+            @brief Destroys the Notification.
+            */
+            void destroy(void)
+                { delete this; }
+
+            /**
+            @brief Get the message of the Notification.
+            @return Returns the message of the Notification.
+            */
+            inline const std::string & getMessage(void) const
+                { return this->message_; }
+
+            /**
+            @brief Get the sender of the Notification.
+            @return Returns the sender of the Notification.
+            */
+            inline const std::string & getSender(void) const
+                { return this->sender_; }
+
+            /**
+            @brief Get the type of the Notification.
+            @return Returns an enum with the type of the Notification.
+            */
+            inline notificationMessageType::Value getType(void) const
+                { return this->type_; }
+
+        private:
+            std::string message_; //!< The Notification message.
+            std::string sender_; //!< The sender of the notification.
+            notificationMessageType::Value type_; //!< The type of the notification.
+
+            void initialize(void); //!< Registers the object and sets some default values.
+
+    };
+
+    /**
+    @brief
+        The Singleton NotificationManager is a NotificationListener and functions as a gateway between @ref orxonox::Notification "Notifications" and @ref orxonox::NotificationQueue "NotificationQueues".
+        It receives, organizes @ref orxonox::Notification "Notifications" and the redistributes them to the specific @ref orxonox::NotificationQueue "NotificationQueues".
+        It also works as a liaison between the @ref orxonox::NotificationQueue "NotificationQueues" and the GUI that displays notification, called NotificationLayer.
 
     @author
@@ -60,5 +114,5 @@
     */
     class _NotificationsExport NotificationManager // tolua_export
-        : public Singleton<NotificationManager>, public OrxonoxClass
+        : public Singleton<NotificationManager>, public NotificationListener
     { // tolua_export
             friend class Singleton<NotificationManager>;
@@ -67,5 +121,5 @@
             virtual ~NotificationManager();
 
-            virtual void preDestroy(void); //!< Is called before the object is destroyed.
+            virtual void preDestroy(void); // Is called before the object is destroyed.
 
             /**
@@ -75,50 +129,43 @@
             static NotificationManager& getInstance() { return Singleton<NotificationManager>::getInstance(); } // tolua_export
 
-            static const std::string ALL; //!< Static string to indicate a sender that sends to all NotificationListeners.
-            static const std::string NONE; //!< Static string to indicare a sender that sends to no specific NotificationListener.
+            virtual bool registerNotification(const std::string& message, const std::string& sender, notificationMessageType::Value type);
+            virtual bool executeCommand(notificationCommand::Value command, const std::string& sender);
 
-            //! Sends a Notification with the specified message to the specified client from the specified sender.
-            static void sendNotification(const std::string& message, unsigned int clientId, const std::string& sender = NotificationManager::NONE, bool isLocal = false);
+            bool registerNotification(Notification* notification); // Registers a Notification within the NotificationManager.
+            void unregisterNotification(Notification* notification, NotificationQueue* queue); // Unregisters a Notification within the NotificationManager for a given NotificationQueue.
 
-            bool registerNotification(Notification* notification); //!< Registers a Notification within the NotificationManager.
-            void unregisterNotification(Notification* notification, NotificationListener* listener); //!< Unregisters a Notification within the NotificationManager for a given NotificationListener.
-            bool registerListener(NotificationListener* listener); //!< Registers a NotificationListener within the NotificationManager.
-            void unregisterListener(NotificationListener* listener); //!< Unregisters a NotificationListener withing the NotificationManager.
-
-            void getNotifications(NotificationListener* listener, std::multimap<std::time_t, Notification*>* map, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd); //!< Fetches the Notifications for a specific NotificationListener in a specified timeframe and stores them in the input map.
+            void getNotifications(NotificationQueue* queue, std::multimap<std::time_t, Notification*>* map, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd); // Fetches the Notifications for a specific NotificationQueue in a specified timeframe and stores them in the input map.
 
             /**
-            @brief Fetches the Notifications for a specific NotificationListener in a timeframe from now-timeDelay to now and stores them in the input map.
-            @param listener The NotificationListener the Notifications are fetched for.
+            @brief Fetches the Notifications for a specific NotificationQueue in a timeframe from (now-timeDelay) to now and stores them in the input map.
+            @param queue The NotificationQueue the Notifications are fetched for.
             @param map A pointer to a multimap, in which the notifications are stored. The map needs to have been allocated.
             @param timeDelay The timespan.
             @return Returns true if successful.
             */
-            void getNotifications(NotificationListener* listener, std::multimap<std::time_t, Notification*>* map, int timeDelay)
-                { this->getNotifications(listener, map, std::time(0)-timeDelay, std::time(0)); }
+            void getNotifications(NotificationQueue* queue, std::multimap<std::time_t, Notification*>* map, int timeDelay)
+                { this->getNotifications(queue, map, std::time(0)-timeDelay, std::time(0)); }
 
-            void enterEditMode(void); //!< Enters the edit mode of the NotificationLayer.
+            void getNewestNotifications(NotificationQueue* queue, std::multimap<std::time_t, Notification*>* map, int numberOfNotifications); // Fetches the newest Notifications for a specific NotificationQueue and stores them in the input map.
 
-            bool registerQueue(NotificationQueue* queue); //!< Registers a NotificationQueue.
-            void unregisterQueue(NotificationQueue* queue); //!< Unregisters a NotificationQueue.
+            bool registerQueue(NotificationQueue* queue); // Registers a NotificationQueue.
+            void unregisterQueue(NotificationQueue* queue); // Unregisters a NotificationQueue.
 
-            // tolua_begin
-            void loadQueues(void); //!< Loads all the NotificationQueues that should exist.
-            void createQueue(const std::string& name); //!< Creates a new NotificationQueue.
-            orxonox::NotificationQueue* getQueue(const std::string & name); //!< Get the NotificationQueue with the input name.
-            // tolua_end
+            void loadQueues(void); // tolua_export // Loads all the NotificationQueues that should exist.
+
+            NotificationQueue* getQueue(const std::string & name); // Get the NotificationQueue with the input name.
 
         private:
             static NotificationManager* singletonPtr_s;
 
-            unsigned int highestIndex_; //!< This variable holds the highest index (resp. key) in notificationLists_s, to secure that no key appears twice.
-
             std::multimap<std::time_t, Notification*> allNotificationsList_; //!< Container where all Notifications are stored.
-            std::map<NotificationListener*, unsigned int> listenerList_; //!< Container where all NotificationListeners are stored with a number as identifier.
-            std::map<int,std::multimap<std::time_t, Notification*>*> notificationLists_; //!< Container where all Notifications, for each identifier (associated with a NotificationListener), are stored.
+            std::map<const std::string, std::multimap<std::time_t, Notification*>*> notificationLists_; //!< Container where all Notifications, for each identifier (associated with a NotificationQueue), are stored.
 
             std::map<const std::string, NotificationQueue*> queues_; //!< The list of NotificationQueues created by the NotificationManager.
 
-            bool removeNotification(Notification* notification, std::multimap<std::time_t, Notification*>& map); //!< Helper method that removes an input Notification form an input map.
+            bool removeNotification(Notification* notification, std::multimap<std::time_t, Notification*>& map); // Helper method that removes an input Notification form an input map.
+            
+            // Commands
+            bool commandClear(const std::string& sender); // The clear command. Clears all NotificationQueues that have its sender as a target.
 
     }; // tolua_export
Index: code/branches/tutoriallevel3/src/modules/notifications/NotificationQueue.cc
===================================================================
--- code/branches/tutoriallevel3/src/modules/notifications/NotificationQueue.cc	(revision 8452)
+++ code/branches/tutoriallevel3/src/modules/notifications/NotificationQueue.cc	(revision 8453)
@@ -38,11 +38,5 @@
 
 #include "core/CoreIncludes.h"
-#include "core/GameMode.h"
-#include "core/GUIManager.h"
-#include "core/LuaState.h"
-#include "util/Convert.h"
 #include "util/SubString.h"
-
-#include "Notification.h"
 
 namespace orxonox
@@ -56,5 +50,5 @@
     @param senders
         The senders that are targets of this NotificationQueue, i.e. the names of senders whose Notifications this NotificationQueue displays.
-        The senders need to be seperated by commas.
+        The senders need to be separated by commas.
     @param size
         The size (the maximum number of displayed Notifications) of this NotificationQueue.
@@ -88,66 +82,24 @@
         }
 
-        this->create(); // Creates the NotificationQueue in lua.
-
-        // Register the NotificationQueue as NotificationListener with the NotificationManager.
-        bool listenerRegistered = NotificationManager::getInstance().registerListener(this);
-        if(!listenerRegistered) // If the registration has failed.
-        {
-            this->registered_ = false;
-            // Remove the NotificationQueue in lua.
-            if(GameMode::showsGraphics())
-                GUIManager::getInstance().getLuaState()->doString("NotificationLayer.removeQueue(\"" + this->getName() +  "\")");
+        COUT(3) << "NotificationQueue '" << this->getName() << "' created." << std::endl;
+    }
+
+    /**
+    @brief
+        Destructor.
+    */
+    NotificationQueue::~NotificationQueue()
+    {
+        this->targets_.clear();
+
+        if(this->registered_) // If the NotificationQueue is registered.
+        {
+            this->clear(true);
+
+            // Unregister with the NotificationManager.
             NotificationManager::getInstance().unregisterQueue(this);
-            COUT(1) << "Error: NotificationQueue '" << this->getName() << "' could not be registered." << std::endl;
-            return;
-        }
-
-        COUT(3) << "NotificationQueue '" << this->getName() << "' created." << std::endl;
-    }
-
-    /**
-    @brief
-        Destructor.
-    */
-    NotificationQueue::~NotificationQueue()
-    {
-        this->targets_.clear();
-
-        if(this->registered_) // If the NotificationQueue is registered.
-        {
-            this->clear(true);
-
-            // Unregister with the NotificationManager.
-            NotificationManager::getInstance().unregisterListener(this);
-            NotificationManager::getInstance().unregisterQueue(this);
-        }
-    }
-
-    /**
-    @brief
-        Destroys the NotificationQueue.
-        Used in lua and NotificationManager.
-    @param noGraphics
-        If this is set to true (false is default), then the queue is not removed in lua. This is used to destroy the queue, after the GUIManager has been destroyed.
-    */
-    void NotificationQueue::destroy(bool noGraphics)
-    {
-        // Remove the NotificationQueue in lua.
-        if(GameMode::showsGraphics() && !noGraphics)
-            GUIManager::getInstance().getLuaState()->doString("NotificationLayer.removeQueue(\"" + this->getName() +  "\")");
-
+        }
+        
         COUT(3) << "NotificationQueue '" << this->getName() << "' destroyed." << std::endl;
-
-        this->OrxonoxClass::destroy();
-    }
-
-    /**
-    @brief
-        Creates the NotificationQueue in lua.
-    */
-    void NotificationQueue::create(void)
-    {
-        if(GameMode::showsGraphics())
-            GUIManager::getInstance().getLuaState()->doString("NotificationLayer.createQueue(\"" + this->getName() +  "\", " + multi_cast<std::string>(this->getMaxSize()) + ")");
     }
 
@@ -161,5 +113,5 @@
     {
         this->tickTime_ += dt; // Add the time interval that has passed to the time counter.
-        if(this->tickTime_ >= 1.0) // If the time counter is greater than 1s all Notifications that have expired are removed, if it is smaller we wait to the next tick.
+        if(this->displayTime_ != INF && this->tickTime_ >= 1.0) // If the time counter is greater than 1s all Notifications that have expired are removed, if it is smaller we wait to the next tick.
         {
             this->timeLimit_.time = std::time(0)-this->displayTime_; // Container containig the current time.
@@ -181,4 +133,5 @@
         Updates the NotificationQueue.
         Updates by clearing the queue and requesting all relevant Notifications from the NotificationManager and inserting them into the queue.
+        This is called by the NotificationManager when the Notifications have changed so much, that the NotificationQueue may have to re-initialize his operations.
     */
     void NotificationQueue::update(void)
@@ -188,5 +141,8 @@
         std::multimap<std::time_t, Notification*>* notifications = new std::multimap<std::time_t, Notification*>;
         // Get the Notifications sent in the interval from now to now minus the display time.
-        NotificationManager::getInstance().getNotifications(this, notifications, this->displayTime_);
+        if(this->displayTime_ == INF)
+            NotificationManager::getInstance().getNewestNotifications(this, notifications, this->getMaxSize());
+        else
+            NotificationManager::getInstance().getNotifications(this, notifications, this->displayTime_);
 
         if(!notifications->empty())
@@ -246,9 +202,9 @@
         this->notifications_.insert(this->notifications_.begin(), container);
 
-        // Push the Notification to the GUI.
-        if(GameMode::showsGraphics())
-            GUIManager::getInstance().getLuaState()->doString("NotificationLayer.pushNotification(\"" + this->getName() + "\", \"" + notification->getMessage() + "\")");
+        // Inform that a Notification was pushed.
+        this->notificationPushed(notification);
 
         COUT(5) << "Notification \"" << notification->getMessage() << "\" pushed to NotificationQueue '" << this->getName() << "'" << endl;
+        COUT(3) << "NotificationQueue \"" << this->getName() << "\": " << notification->getMessage() << endl;
     }
 
@@ -279,7 +235,6 @@
         delete container;
 
-        // Pops the Notification from the GUI.
-        if(GameMode::showsGraphics())
-            GUIManager::getInstance().getLuaState()->doString("NotificationLayer.popNotification(\"" + this->getName() + "\")");
+        // Inform that a Notification was popped.
+        this->notificationPopped();
     }
 
@@ -305,7 +260,7 @@
         delete *containerIterator;
 
-        // Removes the Notification from the GUI.
-        if(GameMode::showsGraphics())
-            GUIManager::getInstance().getLuaState()->doString("NotificationLayer.removeNotification(\"" + this->getName() + "\", " + multi_cast<std::string>(index) + ")");
+        // TODO: index automatically cast?
+        // Inform that a Notification was removed.
+        this->notificationRemoved(index);
     }
 
@@ -314,5 +269,5 @@
         Clears the NotificationQueue by removing all NotificationContainers.
     @param noGraphics
-        If this is eset to true the GUI is not informed of the clearing of the NotificationQueue. This is needed only internally.
+        If this is set to true the GUI is not informed of the clearing of the NotificationQueue. This is needed only internally.
     */
     void NotificationQueue::clear(bool noGraphics)
@@ -326,8 +281,4 @@
         this->notifications_.clear();
         this->size_ = 0;
-
-        // Clear the NotificationQueue in the GUI.
-        if(GameMode::showsGraphics() && !noGraphics)
-            GUIManager::getInstance().getLuaState()->doString("NotificationLayer.clearQueue(\"" + this->getName() + "\")");
     }
 
@@ -364,9 +315,7 @@
         Sets the maximum number of seconds a Notification is displayed.
     @param time
-        The number of seconds the Notifications is displayed.
-    @return
-        Returns true if successful.
-    */
-    void NotificationQueue::setDisplayTime(unsigned int time)
+        The number of seconds a Notification is displayed.
+    */
+    void NotificationQueue::setDisplayTime(int time)
     {
         if(this->displayTime_ == time)
@@ -381,5 +330,5 @@
     /**
     @brief
-        Produces all targets of the NotificationQueue concatinated as string, with commas (',') as seperators.
+        Produces all targets of the NotificationQueue concatenated as string, with commas (',') as separators.
     @return
         Returns the targets as a string.
@@ -407,5 +356,5 @@
         The targets are the senders whose Notifications are displayed in this queue.
     @param targets
-        Accepts a string of targets, each seperated by commas (','), spaces are ignored.
+        Accepts a string of targets, each separated by commas (','), spaces are ignored.
     */
     void NotificationQueue::setTargets(const std::string & targets)
@@ -417,9 +366,23 @@
             this->targets_.insert(string[i]);
 
+        // TODO: Why?
         if(this->registered_)
         {
-            NotificationManager::getInstance().unregisterListener(this);
-            NotificationManager::getInstance().registerListener(this);
-        }
+            NotificationManager::getInstance().unregisterQueue(this);
+            NotificationManager::getInstance().registerQueue(this);
+        }
+    }
+
+    /**
+    @brief
+        Pops all Notifications from the NotificationQueue.
+    @return
+        Returns true if successful, false if not.
+    */
+    bool NotificationQueue::tidy(void)
+    {
+        while(this->size_ > 0)
+            this->pop();
+        return true;
     }
 
Index: code/branches/tutoriallevel3/src/modules/notifications/NotificationQueue.h
===================================================================
--- code/branches/tutoriallevel3/src/modules/notifications/NotificationQueue.h	(revision 8452)
+++ code/branches/tutoriallevel3/src/modules/notifications/NotificationQueue.h	(revision 8453)
@@ -46,8 +46,7 @@
 
 #include "tools/interfaces/Tickable.h"
-#include "interfaces/NotificationListener.h"
 
-namespace orxonox // tolua_export
-{ // tolua_export
+namespace orxonox
+{
 
     /**
@@ -78,5 +77,5 @@
         Displays @ref orxonox::Notification "Notifications" from specific senders.
 
-        There are quite some parameters that influence the behaviour of the NotificationQueue:
+        There are quite some parameters that influence the behavior of the NotificationQueue:
         - @b name The name of the NotificationQueue. It needs to be unique.
         - @b senders The senders that are targets of this NotificationQueue, i.e. the names of senders whose Notifications this NotificationQueue displays.
@@ -89,14 +88,10 @@
     @ingroup Notifications
     */
-    class _NotificationsExport NotificationQueue // tolua_export
-        : public Tickable, public NotificationListener
-    { // tolua_export
+    class _NotificationsExport NotificationQueue : public Tickable
+    {
 
         public:
-            NotificationQueue(const std::string& name, const std::string& senders = NotificationManager::ALL, unsigned int size = NotificationQueue::DEFAULT_SIZE, unsigned int displayTime = NotificationQueue::DEFAULT_DISPLAY_TIME);
+            NotificationQueue(const std::string& name, const std::string& senders = NotificationListener::ALL, unsigned int size = NotificationQueue::DEFAULT_SIZE, unsigned int displayTime = NotificationQueue::DEFAULT_DISPLAY_TIME);
             virtual ~NotificationQueue();
-
-            //! Destroys the NotificationQueue.
-            void destroy(bool noGraphics = false); // tolua_export
 
             virtual void tick(float dt); //!< To update from time to time.
@@ -121,10 +116,10 @@
                 { return this->maxSize_; }
 
-            void setDisplayTime(unsigned int time); //!< Sets the maximum number of seconds a Notification is displayed.
+            void setDisplayTime(int time); //!< Sets the maximum number of seconds a Notification is displayed.
             /**
             @brief Returns the time interval the Notification is displayed.
             @return Returns the display time.
             */
-            inline unsigned int getDisplayTime() const
+            inline int getDisplayTime() const
                 { return this->displayTime_; }
             // tolua_end
@@ -144,18 +139,38 @@
                 { return this->targets_; }
 
-            // tolua_begin
             void setTargets(const std::string & targets); //!< Set the targets of this NotificationQueue.
-            const std::string& getTargets(void) const; //!< Returns a string consisting of the concatination of the targets.
-            // tolua_end
+            const std::string& getTargets(void) const; //!< Returns a string consisting of the concatenation of the targets.
+
+            bool tidy(void); // Pops all Notifications from the NotificationQueue.
+            
+        protected:
+            /**
+            @brief Is called when a notification was pushed.
+            @param notification The Notification that was pushed.
+            */
+            virtual void notificationPushed(Notification* notification) {}
+            /**
+            @brief Is called when a notification was popped.
+            */
+            virtual void notificationPopped(void) {}
+            /**
+            @brief Is called when a notification was removed.
+            @param index The index the removed notification was at.
+            */
+            virtual void notificationRemoved(unsigned int index) {}
+            
+            virtual void clear(bool noGraphics = false); //!< Clears the NotificationQueue by removing all NotificationContainers.
+
+        protected:
+            static const unsigned int DEFAULT_SIZE = 5; //!< The default maximum number of Notifications displayed.
+            static const unsigned int DEFAULT_DISPLAY_TIME = 30; //!< The default display time.
+            static const int INF = -1; //!< Constant denoting infinity.
 
         private:
-            static const unsigned int DEFAULT_SIZE = 5; //!< The default maximum number of Notifications displayed.
-            static const unsigned int DEFAULT_DISPLAY_TIME = 30; //!< The default display time.
-
             std::string name_; //!< The name of the NotificationQueue.
 
             unsigned int maxSize_; //!< The maximal number of Notifications displayed.
             unsigned int size_; //!< The number of Notifications displayed.
-            unsigned int displayTime_; //!< The time a Notification is displayed.
+            int displayTime_; //!< The time a Notification is displayed.
 
             bool registered_; //!< Helper variable to remember whether the NotificationQueue is registered already.
@@ -169,6 +184,4 @@
             NotificationContainer timeLimit_; //!< Helper object to check against to determine whether Notifications have expired.
 
-            void create(void); //!< Creates the NotificationQueue in lua.
-
             void setName(const std::string& name); //!< Sets the name of the NotificationQueue.
 
@@ -177,9 +190,7 @@
             void remove(const std::multiset<NotificationContainer*, NotificationContainerCompare>::iterator& containerIterator); //!< Removes the Notification that is stored in the input NotificationContainer.
 
-            void clear(bool noGraphics = false); //!< Clears the NotificationQueue by removing all NotificationContainers.
+    };
 
-    }; // tolua_export
+}
 
-} // tolua_export
-
-#endif /* _NotificationOverlay_H__ */
+#endif /* _NotificationQueue_H__ */
Index: code/branches/tutoriallevel3/src/modules/notifications/NotificationQueueCEGUI.cc
===================================================================
--- code/branches/tutoriallevel3/src/modules/notifications/NotificationQueueCEGUI.cc	(revision 8453)
+++ code/branches/tutoriallevel3/src/modules/notifications/NotificationQueueCEGUI.cc	(revision 8453)
@@ -0,0 +1,273 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file NotificationQueueCEGUI.cc
+    @brief Implementation of the NotificationQueueCEGUI class.
+*/
+
+#include "NotificationQueueCEGUI.h"
+
+#include <sstream>
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/GUIManager.h"
+#include "core/LuaState.h"
+#include "util/Convert.h"
+
+#include "ToluaBindNotifications.h"
+
+namespace orxonox
+{
+
+    // Register tolua_open function when loading the library.
+    DeclareToluaInterface(Notifications);
+
+    /*static*/ const std::string NotificationQueueCEGUI::NOTIFICATION_LAYER("NotificationLayer");
+
+    NotificationQueueCEGUI::NotificationQueueCEGUI(const std::string& name, const std::string& senders, unsigned int size, unsigned int displayTime) : NotificationQueue(name, senders, size, displayTime)
+    {
+        RegisterObject(NotificationQueueCEGUI);
+
+        this->displaySize_ = Vector4(1.0, 0.0, 0.0, 0.0);
+        this->position_ = Vector4(0.0, 0.0, 0.0, 0.0);
+        this->alignment_ = "LeftAligned";
+        this->fontSize_ = 12;
+        this->fontColor_ = Vector4(1.0, 1.0, 1.0, 1.0);
+        this->fontColorStr_ = "FFFFFFFF";
+        
+        // Create the NotificationQueueCEGUI in lua.
+        this->create();
+    }
+    
+    NotificationQueueCEGUI::~NotificationQueueCEGUI()
+    {
+        
+    }
+
+    /**
+    @brief
+        Destroys the NotificationQueueCEGUI.
+        Used in lua and NotificationManager.
+    @param noGraphics
+        If this is set to true (false is default), then the queue is not removed in lua. This is used to destroy the queue, after the GUIManager has been destroyed.
+    */
+    void NotificationQueueCEGUI::destroy(bool noGraphics)
+    {
+        // Remove the NotificationQueue in lua.
+        if(GameMode::showsGraphics() && !noGraphics)
+            GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".removeQueue(\"" + this->getName() +  "\")");
+
+        NotificationQueue::destroy();
+    }
+
+    /**
+    @brief
+        Set the size of the window that displays the NotificationQueue.
+    @param size
+        The size is a vector with components:
+        - The relative width of the window. (A value between 0 and 1)
+        - The absolute width in pixels. (Additional to the relative width, can be negative)
+        - The relative height of the window. (A value between 0 and 1)
+        - The absolute height in pixels. (Additional to the relative width, can be negative.)
+        If both the 3rd and 4th component of size are set to 0 the height is set such that exactly as many Notifications fit as is the maximum size of the NotificationQueue (in terms of the number of Notifications).
+    */
+    void NotificationQueueCEGUI::setDisplaySize(const Vector4& size)
+    {
+        if(this->displaySize_ == size)
+            return;
+
+        if(size.x < 0.0 || size.x > 1.0 || size.z < 0.0 || size.z > 1.0)
+        {
+            COUT(2) << "The display size of the NotificationQueueCEGUI " << this->getName() << " was trying to be set, but the relative size was not in [0,1]. Aborting..." << endl;
+            return;
+        }
+
+        this->displaySize_ = size;
+        if(size.z == 0.0 && size.w == 0.0)
+            GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".resizeQueue(\"" + this->getName() + "\", " + multi_cast<std::string>(this->displaySize_.x) + ", " + multi_cast<std::string>(this->displaySize_.y) + ")");
+        else
+            GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".resizeQueue(\"" + this->getName() + "\", " + multi_cast<std::string>(this->displaySize_.x) + ", " + multi_cast<std::string>(this->displaySize_.y) + ", " + multi_cast<std::string>(this->displaySize_.z) + ", " + multi_cast<std::string>(this->displaySize_.w) + ")");
+    }
+
+    /**
+    @brief
+        Set the position of the window that displays the NotificationQueue.
+    @param position
+        The position is a vector with components:
+        - The relative x-position of the window. (A value between 0 and 1)
+        - The absolute x-position in pixels. (Additional to the relative x-position, can be negative)
+        - The relative y-position of the window. (A value between 0 and 1)
+        - The absolute y-position in pixels. (Additional to the relative y-position, can be negative.)
+    */
+    void NotificationQueueCEGUI::setPosition(const Vector4& position)
+    {
+        if(this->position_ == position)
+            return;
+
+        if(position.x < 0.0 || position.x > 1.0 || position.z < 0.0 || position.z > 1.0)
+        {
+            COUT(2) << "The position the NotificationQueueCEGUI " << this->getName() << " was trying to be set, but the relative position was not in [0,1]. Aborting..." << endl;
+            return;
+        }
+
+        this->position_ = position;
+        GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".moveQueue(\"" + this->getName() + "\", " + multi_cast<std::string>(this->position_.x) + ", " + multi_cast<std::string>(this->position_.y) + ", " + multi_cast<std::string>(this->position_.z) + ", " + multi_cast<std::string>(this->position_.w) + ")");
+    }
+
+    /**
+    @brief
+        Set the horizontal alignment of the Notifications text.
+    @param alignment
+        The alignment of the Notifications, they are the possible string that the CEGUI Falagard StaticText HorzFormatting property can take.
+    @see http://cegui.org.uk/api_reference/classCEGUI_1_1FalagardStaticTextProperties_1_1HorzFormatting.html
+    */
+    void NotificationQueueCEGUI::setAlignment(const std::string& alignment)
+    {
+        if(this->alignment_ == alignment)
+            return;
+
+        // TODO: Check whether the alignment string is correct?
+        this->alignment_ = alignment;
+        GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".changeQueueAlignment(\"" + this->getName() + "\", \"" + this->alignment_ + "\")");
+    }
+
+    /**
+    @brief
+        Set the font size of the text displayed by this NotificationQueue.
+    @param size
+        The font size.
+    */
+    void NotificationQueueCEGUI::setFontSize(unsigned int size)
+    {
+        if(this->fontSize_ == size)
+            return;
+
+        this->fontSize_ = size;
+        GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".changeQueueFontSize(\"" + this->getName() + "\", " + multi_cast<std::string>(this->fontSize_) + ")");
+    }
+
+    /**
+    @brief
+        Set the font color if the text displayed by this NotificationQueue.
+    @param color
+        The color is a vector with the components being RGBA and taking values from 0 to 1.
+    */
+    void NotificationQueueCEGUI::setFontColor(const Vector4& color)
+    {
+        if(this->fontColor_ == color)
+            return;
+
+        this->fontColor_ = color;
+        // Convert to ARGB format.
+        std::stringstream stream;
+        for(unsigned int i = 0; i < 4; i++)
+            stream << std::hex << std::setw(2) << std::setfill('0') << int(this->fontColor_[(i+3)%4]*255);
+        this->fontColorStr_ = stream.str();
+        GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".changeQueueFontColor(\"" + this->getName() + "\", \"" + this->fontColorStr_ + "\")");
+    }
+
+    /**
+    @brief
+        Get the NotificationQueueCEGUI with the input name.
+    @param name
+        The name of the NotificationQueueCEGUI to be got.
+    @return
+        Returns a pointer to the NotificationQueueCEGUI, or NULL if it doesn't exist.
+    */
+    /*static*/ NotificationQueueCEGUI* NotificationQueueCEGUI::getQueue(const std::string& name)
+    {
+        NotificationQueue* queue = NotificationManager::getInstance().getQueue(name);
+        if(queue == NULL || !queue->isA(Class(NotificationQueueCEGUI)))
+            return NULL;
+        return static_cast<NotificationQueueCEGUI*>(queue);
+    }
+
+    /**
+    @brief
+        Is called by the NotificationQueue when a notification was pushed.
+    @param notification
+        The Notification that was pushed.
+    */
+    void NotificationQueueCEGUI::notificationPushed(Notification* notification)
+    {
+         // Push the Notification to the GUI.
+        if(GameMode::showsGraphics())
+            GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".pushNotification(\"" + this->getName() + "\", \"" + notification->getMessage() + "\")");
+    }
+
+    /**
+    @brief
+        Is called by the NotificationQueue when a notification was popped.
+    */
+    void NotificationQueueCEGUI::notificationPopped(void)
+    {
+        // Pops the Notification from the GUI.
+        if(GameMode::showsGraphics())
+            GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".popNotification(\"" + this->getName() + "\")");
+    }
+
+    /**
+    @brief Is called when a notification was removed.
+    @param index The index the removed notification was at.
+    */
+    void NotificationQueueCEGUI::notificationRemoved(unsigned int index)
+    {
+        // Removes the Notification from the GUI.
+        if(GameMode::showsGraphics())
+            GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".removeNotification(\"" + this->getName() + "\", " + multi_cast<std::string>(index) + ")");
+    }
+
+    /**
+    @brief
+        Clears the NotificationQueue by removing all NotificationContainers.
+    @param noGraphics
+        If this is set to true the GUI is not informed of the clearing of the NotificationQueue. This is needed only internally.
+    */
+    void NotificationQueueCEGUI::clear(bool noGraphics)
+    {
+        NotificationQueue::clear(noGraphics);
+
+        // Clear the NotificationQueue in the GUI.
+        if(GameMode::showsGraphics() && !noGraphics)
+            GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".clearQueue(\"" + this->getName() + "\")");
+    }
+
+    /**
+    @brief
+        Creates the NotificationQueue in lua.
+    */
+    void NotificationQueueCEGUI::create(void)
+    {
+        if(GameMode::showsGraphics())
+            GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".createQueue(\"" + this->getName() +  "\", " + multi_cast<std::string>(this->getMaxSize()) + ")");
+    }
+
+}
+
Index: code/branches/tutoriallevel3/src/modules/notifications/NotificationQueueCEGUI.h
===================================================================
--- code/branches/tutoriallevel3/src/modules/notifications/NotificationQueueCEGUI.h	(revision 8453)
+++ code/branches/tutoriallevel3/src/modules/notifications/NotificationQueueCEGUI.h	(revision 8453)
@@ -0,0 +1,155 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file NotificationQueueCEGUI.h
+    @brief Definition of the NotificationQueueCEGUI class.
+    @ingroup Notifications
+*/
+
+#ifndef _NotificationOueueCEGUI_H__
+#define _NotificationOueueCEGUI_H__
+
+#include "notifications/NotificationsPrereqs.h"
+
+#include <string>
+#include "util/Math.h"
+
+#include "NotificationManager.h"
+
+#include "NotificationQueue.h"
+
+namespace orxonox // tolua_export
+{ // tolua_export
+
+    /**
+    @brief
+        Displays @ref orxonox::Notification "Notifications" using CEGUI.
+
+        Apart form the parameters inherited by the @ref orxonox::NotificationQueue "NotificationQueue", there are some more parameters that influence the behavior of the NotificationQueueCEGUI:
+        - @b displaySize The size of the window that displays the NotificationQueue.
+        - @b position The position if the window that displays the NotificationQueue.
+        - @b alignment The horizontal alignment of the displayed Notifications.
+        - @b fontSize The font size of the displayed Notifications.
+        - @b fontColor The font color of the displayed Notifications.
+
+    @author
+        Damian 'Mozork' Frick
+
+    @see NotificationQueue
+    @ingroup Notifications
+    */
+    class _NotificationsExport NotificationQueueCEGUI // tolua_export
+        : public NotificationQueue
+    { // tolua_export
+
+        public:
+            NotificationQueueCEGUI(const std::string& name, const std::string& senders = NotificationListener::ALL, unsigned int size = NotificationQueue::DEFAULT_SIZE, unsigned int displayTime = NotificationQueue::DEFAULT_DISPLAY_TIME);
+            virtual ~NotificationQueueCEGUI();
+
+            void destroy(bool noGraphics = false); // Destroys the NotificationQueue.
+
+            /**
+            @brief Set the size of the window that displays the NotificationQueue.
+            @param size A vector whose first component is the relative width of the window (a value between 0 and 1) and whose second component is the absolute width in pixels (additional to the relative width, can be negative). The height is set such that exactly as many Notifications fit as is the maximum size of the NotificationQueue (in terms of the number of Notifications).
+            */
+            inline void setDisplaySize(const Vector2& size)
+                { this->setDisplaySize(Vector4(size.x, size.y, 0.0, 0.0)); }
+            void setDisplaySize(const Vector4& size); // Set the size of the window that displays the NotificationQueue.
+            /**
+            @brief Get the size of the window that displays the NotificationQueue.
+            @return Returns a vector with the display size.
+            */
+            inline const Vector4& getDisplaySize(void) const
+                { return this->displaySize_; }
+
+            void setPosition(const Vector4& position); // Set the position of the window that displays the NotificationQueue.
+            /**
+            @brief Get the position of the window that displays the NotificationQueue.
+            @return Returns a vector with the position.
+            */
+            inline const Vector4& getPosition(void) const
+                { return this->position_; }
+
+            void setAlignment(const std::string& alignment); // Set the horizontal alignment of the Notifications text.
+            /**
+            @brief Get the horizontal alignment of the Notifications text.
+            @return Returns a string with the horizontal alignment property.
+            */
+            inline const std::string& getAlignment(void)
+                { return this->alignment_; }
+
+            void setFontSize(unsigned int size); // Set the font size of the text displayed by this NotificationQueue.
+            /**
+            @brief Get the font size of the text displayed by this NotificationQueue.
+            @return Returns the font size.
+            */
+            inline unsigned int getFontSize(void)
+                { return this->fontSize_; }
+
+            void setFontColor(const Vector4& color); // Set the font color if the text displayed by this NotificationQueue.
+            /**
+            @brief Get the font color of the text displayed by this NotificationQueue.
+            @return Returns a vector with the components being RGBA, with values from 0 to 1.
+            */
+            inline const Vector4& getFontColor(void) const
+                { return this->fontColor_; }
+            /**
+            @brief Get the font color of the text displayed by this NotificationQueue.
+            @return Returns a string with the ARGB values in hexadecimal format.
+            */
+            inline const std::string& getFontColorStr(void) const
+                { return this->fontColorStr_; }
+
+            static NotificationQueueCEGUI* getQueue(const std::string& name); // tolua_export // Get the NotificationQueueCEGUI with the input name.
+            
+        protected:
+            virtual void notificationPushed(Notification* notification); // Is called by the NotificationQueue when a notification was pushed
+            virtual void notificationPopped(void); // Is called by the NotificationQueue when a notification was popped.
+            virtual void notificationRemoved(unsigned int index); // Is called when a notification was removed.
+            
+            virtual void clear(bool noGraphics = false); // Clears the NotificationQueue by removing all NotificationContainers.
+
+        protected:
+            static const std::string NOTIFICATION_LAYER; //!< The name of the NotificationLayer menu sheet.
+            
+        private:
+            Vector4 displaySize_; //!< The size of the window that displays the NotificationQueue.
+            Vector4 position_; //!< The position of the window that displays the NotificationQueue.
+            std::string alignment_; //!< The horizontal alignment of the Notifications text.
+            unsigned int fontSize_; //!< The font size of the Notifications text.
+            Vector4 fontColor_; //!< The font color of the Notifications text as a vector, in RGBA form, with values from 0 to 1.
+            std::string fontColorStr_; //!< The font color of the Notifications text as a string with the ARGB hexadecimal values.
+            
+            void create(void); // Creates the NotificationQueue in lua.
+
+    }; // tolua_export
+
+} // tolua_export
+
+#endif /* _NotificationQueueCEGUI_H__ */
