Index: code/trunk/src/orxonox/overlays/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/overlays/CMakeLists.txt	(revision 3089)
+++ code/trunk/src/orxonox/overlays/CMakeLists.txt	(revision 3099)
@@ -3,4 +3,5 @@
   OverlayGroup.cc
   OverlayText.cc
+  FadeoutText.cc
   GUIOverlay.cc
 )
Index: code/trunk/src/orxonox/overlays/FadeoutText.cc
===================================================================
--- code/trunk/src/orxonox/overlays/FadeoutText.cc	(revision 3099)
+++ code/trunk/src/orxonox/overlays/FadeoutText.cc	(revision 3099)
@@ -0,0 +1,117 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "FadeoutText.h"
+
+#include <OgreTextAreaOverlayElement.h>
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    CreateFactory(FadeoutText);
+
+    FadeoutText::FadeoutText(BaseObject* creator) : OverlayText(creator)
+    {
+        RegisterObject(FadeoutText);
+
+        this->delay_ = 3.0f;
+        this->fadeouttime_ = 1.0f;
+
+        this->bFadingOut_ = false;
+        this->fadeouttimer_.setTimer(3.0f, false, this, createExecutor(createFunctor(&FadeoutText::fadeout)));
+        this->fadeouttimer_.stopTimer();
+
+        this->initialAlpha_ = 1.0f;
+    }
+
+    void FadeoutText::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(FadeoutText, XMLPort, xmlelement, mode);
+
+        XMLPortParam(FadeoutText, "delay", setDelay, getDelay, xmlelement, mode);
+        XMLPortParam(FadeoutText, "fadeout", setFadeouttime, getFadeouttime, xmlelement, mode);
+    }
+
+    void FadeoutText::tick(float dt)
+    {
+        if (this->bFadingOut_)
+        {
+            ColourValue colour = this->getColour();
+
+            if (colour.a > 0)
+            {
+                float alpha = colour.a;
+
+                alpha -= dt / this->fadeouttime_;
+                if (alpha < 0)
+                    alpha = 0;
+                colour.a = alpha;
+
+                this->text_->setColour(colour);
+            }
+            else
+            {
+                this->text_->setCaption("");
+                this->reset();
+            }
+        }
+    }
+
+    void FadeoutText::fadeout()
+    {
+        this->bFadingOut_ = true;
+    }
+
+    void FadeoutText::reset()
+    {
+        this->bFadingOut_ = false;
+
+        ColourValue colour = this->getColour();
+        colour.a = this->initialAlpha_;
+        this->text_->setColour(colour);
+    }
+
+    void FadeoutText::changedColour()
+    {
+        OverlayText::changedColour();
+
+        this->initialAlpha_ = this->getColour().a;
+    }
+
+    void FadeoutText::changedCaption()
+    {
+        OverlayText::changedCaption();
+
+        this->reset();
+        this->fadeouttimer_.setInterval(this->delay_);
+        this->fadeouttimer_.startTimer();
+    }
+}
Index: code/trunk/src/orxonox/overlays/FadeoutText.h
===================================================================
--- code/trunk/src/orxonox/overlays/FadeoutText.h	(revision 3099)
+++ code/trunk/src/orxonox/overlays/FadeoutText.h	(revision 3099)
@@ -0,0 +1,75 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _FadeoutText_H__
+#define _FadeoutText_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "overlays/OverlayText.h"
+#include "objects/Tickable.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport FadeoutText : public OverlayText, public Tickable
+    {
+        public:
+            FadeoutText(BaseObject* creator);
+            virtual ~FadeoutText() {}
+
+            virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
+            virtual void tick(float dt);
+
+            inline void setDelay(float delay)
+                { this->delay_ = delay; }
+            inline float getDelay() const
+                { return this->delay_; }
+
+            inline void setFadeouttime(float fadeouttime)
+                { this->fadeouttime_ = fadeouttime; }
+            inline float getFadeouttime() const
+                { return this->fadeouttime_; }
+
+        private:
+            virtual void changedColour();
+            virtual void changedCaption();
+
+            void fadeout();
+            void reset();
+
+            float delay_;
+            float fadeouttime_;
+
+            bool bFadingOut_;
+            Timer<FadeoutText> fadeouttimer_;
+
+            float initialAlpha_;
+    };
+}
+#endif /* _FadeoutText_H__ */
Index: code/trunk/src/orxonox/overlays/OverlayText.h
===================================================================
--- code/trunk/src/orxonox/overlays/OverlayText.h	(revision 3089)
+++ code/trunk/src/orxonox/overlays/OverlayText.h	(revision 3099)
@@ -47,5 +47,5 @@
         virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
 
-        inline void setCaption(const std::string& caption) { this->text_->setCaption(caption); }
+        inline void setCaption(const std::string& caption) { this->text_->setCaption(caption); this->changedCaption(); }
         inline std::string getCaption() const              { return this->text_->getCaption(); }
 
@@ -56,5 +56,5 @@
         inline float getSpaceWidth() const     { return this->text_->getSpaceWidth(); }
 
-        inline void setColour(const ColourValue& colour) { this->text_->setColour(colour); }
+        inline void setColour(const ColourValue& colour) { this->text_->setColour(colour); this->changedColour(); }
         inline const ColourValue& getColour() const      { return this->text_->getColour(); }
 
@@ -70,4 +70,6 @@
     protected:
         virtual void sizeChanged();
+        virtual void changedColour() {}
+        virtual void changedCaption() {}
 
         Ogre::TextAreaOverlayElement* text_;
Index: code/trunk/src/orxonox/overlays/hud/AnnounceMessage.cc
===================================================================
--- code/trunk/src/orxonox/overlays/hud/AnnounceMessage.cc	(revision 3099)
+++ code/trunk/src/orxonox/overlays/hud/AnnounceMessage.cc	(revision 3099)
@@ -0,0 +1,61 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "AnnounceMessage.h"
+
+#include "core/CoreIncludes.h"
+#include "objects/infos/PlayerInfo.h"
+
+namespace orxonox
+{
+    CreateFactory(AnnounceMessage);
+
+    AnnounceMessage::AnnounceMessage(BaseObject* creator) : FadeoutText(creator)
+    {
+        RegisterObject(AnnounceMessage);
+
+        this->owner_ = 0;
+
+        this->setDelay(3.0f);
+        this->setFadeouttime(1.0f);
+    }
+
+    void AnnounceMessage::announcemessage(const GametypeInfo* gtinfo, const std::string& message)
+    {
+        if (this->owner_ && this->owner_->getGametypeInfo() == gtinfo)
+            this->setCaption(message);
+    }
+
+    void AnnounceMessage::changedOwner()
+    {
+        SUPER(AnnounceMessage, changedOwner);
+
+        this->owner_ = dynamic_cast<PlayerInfo*>(this->getOwner());
+    }
+}
Index: code/trunk/src/orxonox/overlays/hud/AnnounceMessage.h
===================================================================
--- code/trunk/src/orxonox/overlays/hud/AnnounceMessage.h	(revision 3099)
+++ code/trunk/src/orxonox/overlays/hud/AnnounceMessage.h	(revision 3099)
@@ -0,0 +1,53 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _AnnounceMessage_H__
+#define _AnnounceMessage_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "overlays/FadeoutText.h"
+#include "objects/GametypeMessageListener.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport AnnounceMessage : public FadeoutText, public GametypeMessageListener
+    {
+        public:
+            AnnounceMessage(BaseObject* creator);
+            virtual ~AnnounceMessage() {}
+
+            virtual void changedOwner();
+
+            void announcemessage(const GametypeInfo* gtinfo, const std::string& message);
+
+        private:
+            PlayerInfo* owner_;
+    };
+}
+#endif /* _AnnounceMessage_H__ */
Index: code/trunk/src/orxonox/overlays/hud/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/overlays/hud/CMakeLists.txt	(revision 3089)
+++ code/trunk/src/orxonox/overlays/hud/CMakeLists.txt	(revision 3099)
@@ -8,4 +8,7 @@
   ChatOverlay.cc
   GametypeStatus.cc
+  AnnounceMessage.cc
+  KillMessage.cc
+  DeathMessage.cc
   PongScore.cc
 )
Index: code/trunk/src/orxonox/overlays/hud/DeathMessage.cc
===================================================================
--- code/trunk/src/orxonox/overlays/hud/DeathMessage.cc	(revision 3099)
+++ code/trunk/src/orxonox/overlays/hud/DeathMessage.cc	(revision 3099)
@@ -0,0 +1,61 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "DeathMessage.h"
+
+#include "core/CoreIncludes.h"
+#include "objects/infos/PlayerInfo.h"
+
+namespace orxonox
+{
+    CreateFactory(DeathMessage);
+
+    DeathMessage::DeathMessage(BaseObject* creator) : FadeoutText(creator)
+    {
+        RegisterObject(DeathMessage);
+
+        this->owner_ = 0;
+
+        this->setDelay(2.0f);
+        this->setFadeouttime(0.5f);
+    }
+
+    void DeathMessage::deathmessage(const GametypeInfo* gtinfo, const std::string& message)
+    {
+        if (this->owner_ && this->owner_->getGametypeInfo() == gtinfo)
+            this->setCaption(message);
+    }
+
+    void DeathMessage::changedOwner()
+    {
+        SUPER(DeathMessage, changedOwner);
+
+        this->owner_ = dynamic_cast<PlayerInfo*>(this->getOwner());
+    }
+}
Index: code/trunk/src/orxonox/overlays/hud/DeathMessage.h
===================================================================
--- code/trunk/src/orxonox/overlays/hud/DeathMessage.h	(revision 3099)
+++ code/trunk/src/orxonox/overlays/hud/DeathMessage.h	(revision 3099)
@@ -0,0 +1,53 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _DeathMessage_H__
+#define _DeathMessage_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "overlays/FadeoutText.h"
+#include "objects/GametypeMessageListener.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport DeathMessage : public FadeoutText, public GametypeMessageListener
+    {
+        public:
+            DeathMessage(BaseObject* creator);
+            virtual ~DeathMessage() {}
+
+            virtual void changedOwner();
+
+            void deathmessage(const GametypeInfo* gtinfo, const std::string& message);
+
+        private:
+            PlayerInfo* owner_;
+    };
+}
+#endif /* _DeathMessage_H__ */
Index: code/trunk/src/orxonox/overlays/hud/KillMessage.cc
===================================================================
--- code/trunk/src/orxonox/overlays/hud/KillMessage.cc	(revision 3099)
+++ code/trunk/src/orxonox/overlays/hud/KillMessage.cc	(revision 3099)
@@ -0,0 +1,61 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "KillMessage.h"
+
+#include "core/CoreIncludes.h"
+#include "objects/infos/PlayerInfo.h"
+
+namespace orxonox
+{
+    CreateFactory(KillMessage);
+
+    KillMessage::KillMessage(BaseObject* creator) : FadeoutText(creator)
+    {
+        RegisterObject(KillMessage);
+
+        this->owner_ = 0;
+
+        this->setDelay(2.0f);
+        this->setFadeouttime(0.5f);
+    }
+
+    void KillMessage::killmessage(const GametypeInfo* gtinfo, const std::string& message)
+    {
+        if (this->owner_ && this->owner_->getGametypeInfo() == gtinfo)
+            this->setCaption(message);
+    }
+
+    void KillMessage::changedOwner()
+    {
+        SUPER(KillMessage, changedOwner);
+
+        this->owner_ = dynamic_cast<PlayerInfo*>(this->getOwner());
+    }
+}
Index: code/trunk/src/orxonox/overlays/hud/KillMessage.h
===================================================================
--- code/trunk/src/orxonox/overlays/hud/KillMessage.h	(revision 3099)
+++ code/trunk/src/orxonox/overlays/hud/KillMessage.h	(revision 3099)
@@ -0,0 +1,53 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _KillMessage_H__
+#define _KillMessage_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "overlays/FadeoutText.h"
+#include "objects/GametypeMessageListener.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport KillMessage : public FadeoutText, public GametypeMessageListener
+    {
+        public:
+            KillMessage(BaseObject* creator);
+            virtual ~KillMessage() {}
+
+            virtual void changedOwner();
+
+            void killmessage(const GametypeInfo* gtinfo, const std::string& message);
+
+        private:
+            PlayerInfo* owner_;
+    };
+}
+#endif /* _KillMessage_H__ */
