Index: code/trunk/src/modules/overlays/hud/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/overlays/hud/CMakeLists.txt	(revision 11023)
+++ code/trunk/src/modules/overlays/hud/CMakeLists.txt	(revision 11052)
@@ -5,7 +5,13 @@
   HUDSpeedBar.cc
   HUDBoostBar.cc
+  HUDShieldBar.cc
   HUDHealthBar.cc
+  HUDRocketFuelBar.cc
   HUDTimer.cc
   HUDEnemyHealthBar.cc
+  HUDEnemyShieldBar.cc
+  HUDWeaponMode.cc
+  HUDWeapon.cc
+  HUDWeaponSystem.cc
   ChatOverlay.cc
   AnnounceMessage.cc
Index: code/trunk/src/modules/overlays/hud/HUDBar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDBar.cc	(revision 11023)
+++ code/trunk/src/modules/overlays/hud/HUDBar.cc	(revision 11052)
@@ -47,9 +47,8 @@
     RegisterClass(BarColour);
 
-    BarColour::BarColour(Context* context)
-        : BaseObject(context)
+    BarColour::BarColour(Context* context) : BaseObject(context)
     {
         RegisterObject(BarColour);
-
+        
         this->setColour(ColourValue(1.0, 1.0, 1.0, 1.0));
         this->setPosition(0.0);
@@ -69,6 +68,5 @@
     RegisterClass(HUDBar);
 
-    HUDBar::HUDBar(Context* context)
-        : OrxonoxOverlay(context), right2Left_(false), autoColour_(false)
+    HUDBar::HUDBar(Context* context) : OrxonoxOverlay(context), right2Left_(false), autoColour_(false)
     {
         RegisterObject(HUDBar);
@@ -88,4 +86,8 @@
         this->bar_->setMaterialName(materialname);
 
+        this->bar_->setPosition(0.0f,0.0f);
+        this->bar_->setDimensions(1.0f,1.0f);
+
+        this->bUseIcon_ = false;
         this->value_ = 1.0f;  // initialize with 1.0f to trigger a change when calling setValue(0.0f) on the line below
         this->setAutoColour(true);
@@ -95,4 +97,9 @@
 
         this->background_->addChild(bar_);
+
+        this->icon_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDBar_icon_" + getUniqueNumberString()));
+        this->icon_->setPosition(0.06f,0.0f);
+        this->icon_->setDimensions(0.1f,1.0f);
+        this->background_->addChild(this->icon_);
     }
 
@@ -115,4 +122,5 @@
         XMLPortParam(HUDBar, "autocolour",   setAutoColour,  getAutoColour,  xmlelement, mode);
         XMLPortParam(HUDBar, "bartexture",   setBarTexture,  getBarTexture, xmlelement, mode);
+        XMLPortParam(HUDBar, "iconmaterial", setIconMaterial, getIconMaterial, xmlelement, mode);
         XMLPortObject(HUDBar, BarColour, "", addColour, getColour, xmlelement, mode);
     }
@@ -161,17 +169,37 @@
         }
 
+        float height = this->bar_->getHeight();
+        float top = this->bar_->getTop();
+
         // set value
         if (this->right2Left_)
         {
             // backward case
-            this->bar_->setPosition(0.06f + 0.88f * (1 - this->value_), 0.0f);
-            this->bar_->setDimensions(0.88f * this->value_, 1.0f);
+            if (this->bUseIcon_)
+            {
+                this->bar_->setPosition(0.16f + 0.78f * (1 - this->value_), top);
+                this->bar_->setDimensions(0.78f * this->value_, height);
+            }
+            else
+            {
+                this->bar_->setPosition(0.06f + 0.88f * (1 - this->value_), top);
+                this->bar_->setDimensions(0.88f * this->value_, height);
+            }
         }
         else
         {
             // default case
-            this->bar_->setPosition(0.06f, 0.0f);
-            this->bar_->setDimensions(0.88f * this->value_, 1.0f);
-        }
+            if (this->bUseIcon_)
+            {
+                this->bar_->setPosition(0.16f, top);
+                this->bar_->setDimensions(0.78f * this->value_, height);
+            }
+            else
+            {
+                this->bar_->setPosition(0.06f, top);
+                this->bar_->setDimensions(0.88f * this->value_, height);
+            }
+        }
+
         if (this->value_ != 0)
             this->bar_->setTiling(this->value_, 1.0);
@@ -208,3 +236,15 @@
         return this->textureUnitState_->getTextureName();
     }
+
+    void HUDBar::setIconMaterial(const std::string& iconMaterial)
+    {
+        this->bUseIcon_ = true;
+        this->icon_->setMaterialName(iconMaterial);
+        valueChanged();
+    }
+
+    const std::string& HUDBar::getIconMaterial() const
+    {
+        return this->icon_->getMaterialName();
+    }
 }
Index: code/trunk/src/modules/overlays/hud/HUDBar.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDBar.h	(revision 11023)
+++ code/trunk/src/modules/overlays/hud/HUDBar.h	(revision 11052)
@@ -37,4 +37,5 @@
 #include <map>
 #include <vector>
+#include <OgrePanelOverlayElement.h>
 
 #include "util/Math.h"
@@ -51,5 +52,5 @@
         virtual ~BarColour() { }
 
-        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);     
 
         void setColour(const ColourValue& colour) { this->colour_ = colour; }
@@ -115,10 +116,17 @@
         const std::string& getBarTexture() const;
 
+        void setIconMaterial(const std::string& iconMaterial);
+        const std::string& getIconMaterial() const;
+
         inline const ColourValue& getCurrentBarColour() const
             { return this->currentColour_; }
 
+        inline void setIconPosition(Vector2 position)
+            { this->icon_->setPosition(position.x, position.y); }
+        inline void setIconDimensions(Vector2 dimensions)
+            { this->icon_->setDimensions(dimensions.x, dimensions.y); }
+
     protected:
         virtual void valueChanged();
-
     private:
         void addColour(BarColour* colour);
@@ -129,7 +137,9 @@
         float value_;                       //!< progress of bar
         ColourValue currentColour_;
+        bool bUseIcon_;
 
         Ogre::PanelOverlayElement* bar_;
         Ogre::TextureUnitState* textureUnitState_;
+        Ogre::PanelOverlayElement* icon_;
         std::map<float, ColourValue> colours_;
         std::vector<BarColour*> barColours_;
Index: code/trunk/src/modules/overlays/hud/HUDBoostBar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDBoostBar.cc	(revision 11023)
+++ code/trunk/src/modules/overlays/hud/HUDBoostBar.cc	(revision 11052)
@@ -59,5 +59,5 @@
             if (this->owner_->isBoostCoolingDown())
             {
-                this->setBackgroundColour(ColourValue(0.7f, 0.2f, 0.2f));
+                //this->setBackgroundColour(ColourValue(0.7f, 0.2f, 0.2f));
                 if (this->flashDt_ <= 0.0f)
                 {
@@ -72,5 +72,5 @@
                 this->flashDt_ = 0.0f;
                 this->show();
-                this->setBackgroundColour(ColourValue(0.2f, 0.7f, 0.2f));
+                //this->setBackgroundColour(ColourValue(0.2f, 0.7f, 0.2f));
             }
 
Index: code/trunk/src/modules/overlays/hud/HUDEnemyShieldBar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDEnemyShieldBar.cc	(revision 11052)
+++ code/trunk/src/modules/overlays/hud/HUDEnemyShieldBar.cc	(revision 11052)
@@ -0,0 +1,89 @@
+/*
+ *   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:
+ *      Fabien Vultier
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "HUDEnemyShieldBar.h"
+
+#include "core/config/ConfigValueIncludes.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    RegisterClass(HUDEnemyShieldBar);
+
+    HUDEnemyShieldBar::HUDEnemyShieldBar(Context* context) : HUDShieldBar(context)
+    {
+        RegisterObject(HUDEnemyShieldBar);
+
+        this->setConfigValues();
+        this->owner_ = NULL;
+    }
+
+    HUDEnemyShieldBar::~HUDEnemyShieldBar()
+    {
+    }
+
+    void HUDEnemyShieldBar::setConfigValues()
+    {
+        SetConfigValue(useEnemyBar_, true);
+    }
+
+    void HUDEnemyShieldBar::tick(float dt)
+    {
+        this->updateTarget();
+
+        SUPER(HUDEnemyShieldBar, tick, dt);
+    }
+
+    void HUDEnemyShieldBar::updateTarget()
+    {
+        Pawn* pawn = NULL;
+        if (this->owner_ && this->useEnemyBar_)
+        {
+            // Get the owner's current target (target is usually a Model)
+            WorldEntity* target = this->owner_->getTarget();
+            // Find the Pawn that belongs to this target (if any)
+            while (target && !target->isA(Class(Pawn)))
+                target = target->getParent();
+            pawn = orxonox_cast<Pawn*>(target);
+            // Don't show the EnemyShieldBar if the pawn is invisible
+            if (pawn && !pawn->isVisible())
+                pawn = NULL;
+        }
+        // Set the pawn as owner of the EnemyShieldBar
+        this->setShieldBarOwner(pawn);
+        this->setVisible(pawn != NULL);
+    }
+
+    void HUDEnemyShieldBar::changedOwner()
+    {
+        SUPER(HUDEnemyShieldBar, changedOwner);
+
+        this->owner_ = orxonox_cast<ControllableEntity*>(this->getOwner());
+        this->updateTarget();
+    }
+}
Index: code/trunk/src/modules/overlays/hud/HUDEnemyShieldBar.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDEnemyShieldBar.h	(revision 11052)
+++ code/trunk/src/modules/overlays/hud/HUDEnemyShieldBar.h	(revision 11052)
@@ -0,0 +1,58 @@
+/*
+ *   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:
+ *      Fabien Vultier
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _HUDEnemyShieldBar_H__
+#define _HUDEnemyShieldBar_H__
+
+#include "HUDShieldBar.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        This class displays the shield status of the target enemy of it's owner.
+    */
+    class _OverlaysExport HUDEnemyShieldBar : public HUDShieldBar
+    {
+        public:
+            HUDEnemyShieldBar(Context* context);
+            virtual ~HUDEnemyShieldBar();
+
+            void setConfigValues();
+            virtual void tick(float dt);
+
+            void changedOwner();
+
+        private:
+            void updateTarget();
+
+            ControllableEntity* owner_;
+            bool useEnemyBar_;
+    };
+}
+#endif /* _HUDEnemyShieldBar_H__ */
Index: code/trunk/src/modules/overlays/hud/HUDHealthBar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDHealthBar.cc	(revision 11023)
+++ code/trunk/src/modules/overlays/hud/HUDHealthBar.cc	(revision 11052)
@@ -45,4 +45,9 @@
         this->owner_ = 0;
         this->bUseBarColour_ = false;
+        this->textOffset_ = Vector2(0.0f, 0.0f);
+        this->textScale_ = 1.0f;
+
+        this->setIconPosition(Vector2(0.05f,0.5f));
+        this->setIconDimensions(Vector2(0.1f,0.5f));
 
         this->textoverlay_ = new OverlayText(this->getContext());
@@ -51,4 +56,7 @@
 
         this->textoverlay_->setCaption("");
+        this->textoverlay_->setAspectCorrection(false);
+
+        positionText();
     }
 
@@ -58,5 +66,5 @@
         {
             this->textoverlay_->destroy();
-            this->textoverlay_ = 0;
+            this->textoverlay_ = NULL;
         }
     }
@@ -70,10 +78,9 @@
         XMLPortParam(HUDHealthBar, "textusebarcolour",  setTextUseBarColour,     getTextUseBarColour,     xmlelement, mode).defaultValues(false);
         XMLPortParam(HUDHealthBar, "textcolour",        setTextColour,           getTextColour,           xmlelement, mode).defaultValues(ColourValue(1.0, 1.0, 1.0, 1.0));
-        XMLPortParam(HUDHealthBar, "textsize",          setTextSize,             getTextSize,             xmlelement, mode).defaultValues(1.0f);
         XMLPortParam(HUDHealthBar, "textalign",         setTextAlignmentString,  getTextAlignmentString,  xmlelement, mode).defaultValues("left");
         XMLPortParam(HUDHealthBar, "textoffset",        setTextOffset,           getTextOffset,           xmlelement, mode).defaultValues(Vector2::ZERO);
+        XMLPortParam(HUDHealthBar, "textscale",         setTextScale,            getTextScale,            xmlelement, mode).defaultValues(1.0f);
         XMLPortParam(HUDHealthBar, "textpickpoint",     setTextPickPoint,        getTextPickPoint,        xmlelement, mode).defaultValues(Vector2::ZERO);
         XMLPortParam(HUDHealthBar, "textrotation",      setTextRotation,         getTextRotation,         xmlelement, mode).defaultValues(0.0f);
-        XMLPortParam(HUDHealthBar, "textcorrectaspect", setTextAspectCorrection, getTextAspectCorrection, xmlelement, mode).defaultValues(true);
         XMLPortParam(HUDHealthBar, "textspacewidth",    setTextSpaceWidth,       getTextSpaceWidth,       xmlelement, mode).defaultValues(true);
     }
@@ -139,3 +146,21 @@
             this->textoverlay_->setColour(this->textColour_);
     }
+
+    void HUDHealthBar::positionText()
+    {
+        this->textoverlay_->setPosition(this->getPosition() + this->textOffset_*this->getActualSize());
+        this->textoverlay_->setTextSize(this->getActualSize().y*this->textScale_);
+    }
+
+    void HUDHealthBar::positionChanged()
+    {
+        HUDBar::positionChanged();
+        positionText();
+    }
+
+    void HUDHealthBar::sizeChanged()
+    {
+        HUDBar::sizeChanged();
+        positionText();
+    }    
 }
Index: code/trunk/src/modules/overlays/hud/HUDHealthBar.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDHealthBar.h	(revision 11023)
+++ code/trunk/src/modules/overlays/hud/HUDHealthBar.h	(revision 11052)
@@ -75,13 +75,15 @@
                 { return this->textoverlay_->getAlignmentString(); }
 
-            inline void setTextSize(float size)
-                { this->textoverlay_->setTextSize(size); }
-            inline float getTextSize() const
-                { return this->textoverlay_->getTextSize(); }
-
             inline void setTextVisible(bool bVisible)
                 { this->textoverlay_->setVisible(bVisible); }
             inline bool getTextVisible() const
                 { return this->textoverlay_->isVisible(); }
+
+            inline void setTextScale(float scale)
+                { this->textScale_ = scale;
+                  positionText();
+                }
+            inline float getTextScale() const
+                { return this->textScale_; }
 
             inline void setTextPickPoint(const Vector2& pickpoint)
@@ -91,12 +93,9 @@
 
             inline void setTextOffset(const Vector2& position)
-                { this->textoverlay_->setPosition(this->getPosition() + (position - this->getPickPoint()) * this->getSize()); }
+                { this->textOffset_ = position;
+                  this->positionText();
+                }
             inline Vector2 getTextOffset() const
-                { return (this->textoverlay_->getPosition() - this->getPosition()) / this->getSize() + this->getPickPoint(); }
-
-            inline void setTextAspectCorrection(bool correct)
-                { this->textoverlay_->setAspectCorrection(correct); }
-            inline bool getTextAspectCorrection() const
-                { return this->textoverlay_->getAspectCorrection(); }
+                { return this->textOffset_; }
 
             inline void setTextRotation(const Degree& angle)
@@ -112,10 +111,15 @@
             inline void setHealthBarOwner(Pawn* owner)
                 { this->owner_ = owner; }
-
+        protected:
+            virtual void positionChanged();
+            virtual void sizeChanged();
         private:
+            virtual void positionText();
             WeakPtr<Pawn> owner_;
             StrongPtr<OverlayText> textoverlay_;
             bool bUseBarColour_;
             ColourValue textColour_;
+            Vector2 textOffset_;
+            float textScale_;
     };
 }
Index: code/trunk/src/modules/overlays/hud/HUDRadar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDRadar.cc	(revision 11023)
+++ code/trunk/src/modules/overlays/hud/HUDRadar.cc	(revision 11052)
@@ -240,5 +240,5 @@
             }
             else
-                coord = get2DViewcoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition());
+                coord = get2DViewCoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition());
 
             coord *= math::pi / 3.5f; // small adjustment to make it fit the texture
Index: code/trunk/src/modules/overlays/hud/HUDRocketFuelBar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDRocketFuelBar.cc	(revision 11052)
+++ code/trunk/src/modules/overlays/hud/HUDRocketFuelBar.cc	(revision 11052)
@@ -0,0 +1,73 @@
+/*
+ *   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 2src/libraries/core/class/Identifier.h
+ *   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:
+ *      Fabien Vultier
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "HUDRocketFuelBar.h"
+
+#include "core/CoreIncludes.h"
+#include "weapons/projectiles/Rocket.h"
+
+namespace orxonox
+{
+    RegisterClass(HUDRocketFuelBar);
+
+    HUDRocketFuelBar::HUDRocketFuelBar(Context* context) : HUDBar(context)
+    {
+        RegisterObject(HUDRocketFuelBar);
+
+        this->owner_ = NULL;
+    }
+
+    HUDRocketFuelBar::~HUDRocketFuelBar()
+    {
+    }
+
+    void HUDRocketFuelBar::tick(float dt)
+    {
+        SUPER(HUDRocketFuelBar, tick, dt);
+
+        if (this->owner_)
+        {
+            float maxFuel = this->owner_->getMaxFuel();
+            if (maxFuel > 0.0)
+            {
+                this->setValue(this->owner_->getFuel()/maxFuel);
+            }
+            else
+            {
+                this->setValue(0.0);
+            }
+        }
+    }
+
+    void HUDRocketFuelBar::changedOwner()
+    {
+        SUPER(HUDRocketFuelBar, changedOwner);
+
+        this->owner_ = orxonox_cast<Rocket*>(this->getOwner());
+    }
+}
Index: code/trunk/src/modules/overlays/hud/HUDRocketFuelBar.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDRocketFuelBar.h	(revision 11052)
+++ code/trunk/src/modules/overlays/hud/HUDRocketFuelBar.h	(revision 11052)
@@ -0,0 +1,58 @@
+/*
+ *   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:
+ *      Fabien Vultier
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+ /**
+    @file HUDRocketFuelBar.h
+    @brief Definition of the HUDRocketFuelBar class. This HUDBar displays the the amount of fuel  that a rocket has.
+*/
+
+#ifndef _HUDRocketFuelBar_H__
+#define _HUDRocketFuelBar_H__
+
+#include "overlays/OverlaysPrereqs.h"
+
+#include "tools/interfaces/Tickable.h"
+#include "weapons/projectiles/Rocket.h"
+#include "HUDBar.h"
+
+namespace orxonox
+{
+    class _OverlaysExport HUDRocketFuelBar : public HUDBar, public Tickable
+    {
+    public:
+        HUDRocketFuelBar(Context* context);
+        virtual ~HUDRocketFuelBar();
+
+        virtual void tick(float dt);
+        virtual void changedOwner();
+
+    private:
+        Rocket* owner_;
+    };
+}
+#endif /* _HUDRocketFuelBar_H__ */
Index: code/trunk/src/modules/overlays/hud/HUDShieldBar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDShieldBar.cc	(revision 11052)
+++ code/trunk/src/modules/overlays/hud/HUDShieldBar.cc	(revision 11052)
@@ -0,0 +1,81 @@
+/*
+ *   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:
+ *      Fabien Vultier
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "HUDShieldBar.h"
+
+#include "core/CoreIncludes.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    RegisterClass(HUDShieldBar);
+
+    HUDShieldBar::HUDShieldBar(Context* context)
+        : HUDBar(context)
+    {
+        RegisterObject(HUDShieldBar);
+
+        this->owner_ = NULL;
+    }
+
+    HUDShieldBar::~HUDShieldBar()
+    {
+    }
+
+    void HUDShieldBar::tick(float dt)
+    {
+        SUPER(HUDShieldBar, tick, dt);
+
+        if (this->owner_)
+        {
+            float maxShieldHealth = this->owner_->getMaxShieldHealth();
+            float shieldHealth = this->owner_->getShieldHealth();
+
+            if (maxShieldHealth > 0.0f)
+            {
+                this->setValue(shieldHealth/maxShieldHealth);
+            }
+            else
+            {
+                this->setValue(0.0f);
+            }
+        }
+        else
+        {
+            this->setValue(0.0f);
+        }
+    }
+
+    void HUDShieldBar::changedOwner()
+    {
+        SUPER(HUDShieldBar, changedOwner);
+
+        this->owner_ = orxonox_cast<Pawn*>(this->getOwner());
+    }
+}
+
Index: code/trunk/src/modules/overlays/hud/HUDShieldBar.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDShieldBar.h	(revision 11052)
+++ code/trunk/src/modules/overlays/hud/HUDShieldBar.h	(revision 11052)
@@ -0,0 +1,60 @@
+/*
+ *   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:
+ *      Fabien Vultier
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _HUDShieldBar_H__
+#define _HUDShieldBar_H__
+
+#include "overlays/OverlaysPrereqs.h"
+
+#include "tools/interfaces/Tickable.h"
+#include "HUDBar.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        The HUDShieldBar displays the the status of the shield of its owner (a @ref Pawn).
+        The length of the bar is given by the ratio of the shield health and the maximal shield health of the @ref Pawn.
+    */
+
+    class _OverlaysExport HUDShieldBar : public HUDBar, public Tickable
+    {
+    public:
+        HUDShieldBar(Context* context);
+        virtual ~HUDShieldBar();
+
+        virtual void tick(float dt);
+        virtual void changedOwner();
+
+        inline void setShieldBarOwner(Pawn* owner)
+            { this->owner_ = owner; }
+    private:
+        Pawn* owner_;
+    };
+}
+#endif /* _HUDShieldBar_H__ */
Index: code/trunk/src/modules/overlays/hud/HUDWeapon.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDWeapon.cc	(revision 11052)
+++ code/trunk/src/modules/overlays/hud/HUDWeapon.cc	(revision 11052)
@@ -0,0 +1,224 @@
+/*
+ *   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:
+ *      Fabien Vultier
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "HUDWeapon.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Convert.h"
+#include "core/class/Super.h"
+
+namespace orxonox
+{
+    RegisterClass(HUDWeapon);
+
+    HUDWeapon::HUDWeapon(Context* context) : OrxonoxOverlay(context)
+    {
+        RegisterObject(HUDWeapon);
+
+        weaponModeHUDActualSize_ = Vector2(0.0f,0.0f);
+
+        weaponModes_ = NULL;
+        weaponIndex_ = 0;
+        hudWeaponModes_.clear();
+
+        overlayElement_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDWeapon" + getUniqueNumberString()));
+        overlayElement_->setMaterialName("Orxonox/WSHUD_Weapon");
+        overlayElement_->setPosition(0.0f,0.0f);
+        overlayElement_->setDimensions(1.0f,1.0f);
+        this->background_->addChild(overlayElement_);
+    }
+
+    HUDWeapon::~HUDWeapon()
+    {
+        if (this->isInitialized())
+        {
+            destroyHUDChilds();
+        }
+    }
+
+    void HUDWeapon::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(HUDWeapon, XMLPort, xmlelement, mode);
+
+        /*XMLPortParam(HUDWeapons, "sensitivity", setRadarSensitivity, getRadarSensitivity, xmlelement, mode);
+        XMLPortParam(HUDWeapons, "halfDotSizeDistance", setHalfDotSizeDistance, getHalfDotSizeDistance, xmlelement, mode);*/
+    }
+
+    void HUDWeapon::tick(float dt)
+    {
+        SUPER(HUDWeapon, tick, dt);
+
+        if (!weapon_)
+        {
+            // TODO: destroy this HUD id the Weapon does no more exist. (Wehen the weak pointer is NULL)
+        }
+    }    
+
+    void HUDWeapon::positionChanged()
+    {
+        OrxonoxOverlay::positionChanged();
+
+        positionHUDChilds();
+    }
+
+    void HUDWeapon::sizeChanged()
+    {
+        OrxonoxOverlay::sizeChanged();
+
+        positionHUDChilds();
+    }
+
+    void HUDWeapon::changedOwner()
+    {
+        SUPER(HUDWeapon, changedOwner);
+
+        this->owner_ = orxonox_cast<Pawn*>(this->getOwner());
+
+        updateWeaponModeList();
+    }
+
+    void HUDWeapon::changedOverlayGroup()
+    {
+        SUPER(HUDWeapon, changedOverlayGroup);
+    }   
+
+    void HUDWeapon::changedVisibility()
+    {
+        SUPER(HUDWeapon, changedVisibility);
+
+        bool visible = this->isVisible();
+
+        for (std::vector<WeakPtr<HUDWeaponMode> >::iterator it = hudWeaponModes_.begin(); it != hudWeaponModes_.end(); ++it)
+        {
+            (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed
+            (*it)->setVisible(visible);
+        }
+    }
+
+    void HUDWeapon::changedName()
+    {
+        SUPER(HUDWeapon, changedName);
+    }
+
+    void HUDWeapon::setWeapon(Weapon* weapon)
+    {
+        weapon_ = weapon;
+
+        if (!weapon_)
+        {
+            return;
+        }
+
+        updateWeaponModeList();
+    }
+
+    void HUDWeapon::updateWeaponModeList()
+    {
+        if (owner_ == NULL || weapon_ == NULL)
+        {
+            return;
+        }
+            
+        destroyHUDChilds();
+
+        weaponModes_ = weapon_->getAllWeaponmodes();
+
+        updateSize();
+        createHUDChilds();
+        positionHUDChilds();
+    }  
+
+    void HUDWeapon::createHUDChilds()
+    {
+        if (weaponModes_ == NULL)
+        {
+            return;
+        }
+
+        int positionIndex = 0;
+
+        for (std::multimap<unsigned int, WeaponMode*>::iterator it = weaponModes_->begin(); it != weaponModes_->end(); ++it)
+        {
+            HUDWeaponMode* hudWeaponMode = new HUDWeaponMode(this->getContext());
+            hudWeaponMode->setOwner(owner_);
+            hudWeaponMode->setOverlayGroup(this->getOverlayGroup());
+            hudWeaponMode->setVisible(this->isVisible());
+            hudWeaponMode->setWeaponMode(it->second);
+            hudWeaponMode->setWeaponIndex(this->weaponIndex_);                    
+            hudWeaponMode->setAspectCorrection(false);
+            hudWeaponMode->setPickPoint(Vector2(0.0f,0.0f));
+
+            hudWeaponModes_.push_back(hudWeaponMode);
+
+            ++ positionIndex;
+        }
+    }      
+
+    void HUDWeapon::positionHUDChilds()
+    {
+        int positionIndex = 0;
+
+        for (std::vector<WeakPtr<HUDWeaponMode> >::iterator it = hudWeaponModes_.begin(); it != hudWeaponModes_.end(); ++it)
+        {
+            (*it)->setPositionOffset(this->positionOffset_);
+            (*it)->setWeaponModeIndex(positionIndex);
+            (*it)->setWeaponIndex(this->weaponIndex_);
+            (*it)->setWeaponModeHUDActualSize(this->weaponModeHUDActualSize_);
+
+            ++ positionIndex;
+        }
+    }  
+
+    void HUDWeapon::destroyHUDChilds()
+    {
+        for (std::vector<WeakPtr<HUDWeaponMode> >::iterator it = hudWeaponModes_.begin(); it != hudWeaponModes_.end(); ++it)
+        {
+            (*it)->destroy();
+        } 
+
+        hudWeaponModes_.clear();
+    }
+
+    void HUDWeapon::updateSize()
+    {
+        if (weaponModes_ != NULL)
+        {
+            this->setSize(Vector2(weaponModeHUDActualSize_.x,weaponModeHUDActualSize_.y*weaponModes_->size()));
+            updatePosition();
+        }        
+    }
+
+    void HUDWeapon::updatePosition()
+    {
+        if (weaponModes_ != NULL)
+        {
+            this->setPosition(Vector2(weaponModeHUDActualSize_.x*weaponIndex_,0.0f) + this->positionOffset_);
+        }        
+    }       
+}
Index: code/trunk/src/modules/overlays/hud/HUDWeapon.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDWeapon.h	(revision 11052)
+++ code/trunk/src/modules/overlays/hud/HUDWeapon.h	(revision 11052)
@@ -0,0 +1,107 @@
+/*
+ *   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:
+ *      Fabien Vultier
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _HUDWeapon_H__
+#define _HUDWeapon_H__
+
+#include "overlays/OverlaysPrereqs.h"
+
+#include <map>
+#include <vector>
+#include <string>
+
+#include <OgreOverlayManager.h>
+#include <OgrePanelOverlayElement.h> 
+
+#include "overlays/OrxonoxOverlay.h"
+#include "tools/interfaces/Tickable.h"
+#include "worldentities/pawns/Pawn.h"
+#include "overlays/OverlayGroup.h"
+#include "weaponsystem/Weapon.h"
+#include "weaponsystem/WeaponMode.h"
+#include "HUDWeaponMode.h"
+
+namespace orxonox
+{
+    class _OverlaysExport HUDWeapon : public OrxonoxOverlay, public Tickable
+    {
+    public:
+        HUDWeapon(Context* context);
+        virtual ~HUDWeapon();
+
+        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+        virtual void tick(float dt);
+        virtual void changedOwner();
+        virtual void changedOverlayGroup();
+        virtual void changedVisibility();
+        virtual void changedName();
+        virtual void positionChanged();
+        virtual void sizeChanged();
+
+        virtual void setWeapon(Weapon* weapon);
+
+        inline void setWeaponModeHUDActualSize(Vector2 vector)
+            { weaponModeHUDActualSize_ = vector;
+              this->updateSize();
+            }
+        inline Vector2 getWeaponModeHUDActualSize() const
+            { return weaponModeHUDActualSize_; }
+        inline void setPositionOffset(Vector2 positionOffset)
+            {
+                this->positionOffset_ = positionOffset;
+                this->updatePosition();
+            }            
+        inline void setWeaponIndex(int index)
+            {
+                weaponIndex_ = index;
+                this->updatePosition();
+            }        
+
+    private:
+        virtual void createHUDChilds();
+        virtual void positionHUDChilds();
+        virtual void destroyHUDChilds();
+        virtual void updateWeaponModeList();
+        virtual void updateSize();
+        virtual void updatePosition();
+
+        WeakPtr<Pawn> owner_;
+        WeakPtr<Weapon> weapon_;
+
+        std::multimap<unsigned int, WeaponMode*>* weaponModes_;
+        std::vector<WeakPtr<HUDWeaponMode> > hudWeaponModes_;
+
+        Ogre::PanelOverlayElement* overlayElement_;
+
+        Vector2 weaponModeHUDActualSize_;
+        Vector2 positionOffset_;
+        int weaponIndex_;
+    };
+}
+
+#endif /* _HUDWeapon_H__ */
Index: code/trunk/src/modules/overlays/hud/HUDWeaponMode.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDWeaponMode.cc	(revision 11052)
+++ code/trunk/src/modules/overlays/hud/HUDWeaponMode.cc	(revision 11052)
@@ -0,0 +1,289 @@
+/*
+ *   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:
+ *      Fabien Vultier
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "HUDWeaponMode.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Convert.h"
+#include "core/class/Super.h"
+
+namespace orxonox
+{
+    RegisterClass(HUDWeaponMode);
+
+    HUDWeaponMode::HUDWeaponMode(Context* context) : OrxonoxOverlay(context)
+    {
+        RegisterObject(HUDWeaponMode);
+
+        weaponIndex_ = 0;
+        weaponModeIndex_ = 0;
+
+        overlayElementIcon_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDWeaponMode" + getUniqueNumberString()));
+        overlayElementIcon_->setPosition(0.0f,0.0f);
+        overlayElementIcon_->setDimensions(1.0f,1.0f);
+        this->background_->addChild(overlayElementIcon_);
+
+        overlayElementReplenish_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDWeaponMode" + getUniqueNumberString()));
+        overlayElementReplenish_->setPosition(0.0f,0.0f);
+        overlayElementReplenish_->setDimensions(1.0f,1.0f);
+        this->background_->addChild(overlayElementReplenish_);
+
+        overlayElementMunition_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDWeaponMode" + getUniqueNumberString()));
+        overlayElementMunition_->setPosition(0.0f,0.0f);
+        overlayElementMunition_->setDimensions(1.0f,1.0f);
+        this->background_->addChild(overlayElementMunition_);
+
+        overlayElementState_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDWeaponMode" + getUniqueNumberString()));
+        overlayElementState_->setPosition(0.0f,0.0f);
+        overlayElementState_->setDimensions(1.0f,1.0f);
+        this->background_->addChild(overlayElementState_);
+
+        overlayElementIcon_->show();
+        overlayElementReplenish_->show();
+        overlayElementMunition_->show();
+        overlayElementState_->show();
+
+        // Create two text overlays
+        this->textOverlayLeft_ = new OverlayText(this->getContext());
+        assert(this->textOverlayLeft_.get());
+        this->textOverlayLeft_->setCaption("?");
+        textOverlayLeft_->setPickPoint(Vector2(0.0f,0.0f));
+        textOverlayLeft_->setVisible(true);
+        textOverlayLeft_->setAlignment(OverlayText::Center);
+        textOverlayLeft_->setTextSize(0.02f);
+        textOverlayLeft_->setColour(ColourValue(0.21,0.70,0.21,1.0));
+        textOverlayLeft_->setAspectCorrection(false);
+        textOverlayLeft_->setZOrder(600);
+        
+        this->textOverlayRight_ = new OverlayText(this->getContext());
+        assert(this->textOverlayRight_.get());
+        this->textOverlayRight_->setCaption("?");
+        textOverlayRight_->setPickPoint(Vector2(0.0f,0.0f));
+        textOverlayRight_->setVisible(true);
+        textOverlayRight_->setAlignment(OverlayText::Center);
+        textOverlayRight_->setTextSize(0.02f);
+        textOverlayRight_->setColour(ColourValue(0.21,0.70,0.21,1.0));
+        textOverlayRight_->setAspectCorrection(false);
+        textOverlayRight_->setZOrder(600);
+
+        materialNameState_ = "";
+
+        overlayElementReplenish_->setMaterialName("Orxonox/WSHUD_Replenish");
+    }
+
+    HUDWeaponMode::~HUDWeaponMode()
+    {
+        if (this->isInitialized())
+        {
+            this->textOverlayLeft_->destroy();
+            this->textOverlayRight_->destroy();
+        }
+    }
+
+    void HUDWeaponMode::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(HUDWeaponMode, XMLPort, xmlelement, mode);
+    }
+
+    void HUDWeaponMode::tick(float dt)
+    {
+        SUPER(HUDWeaponMode, tick, dt);
+
+        if (this->owner_ && this->weaponMode_)
+        {
+            std::string lastMaterialNameState = materialNameState_;
+
+            if (weaponMode_->getReloading())
+            {
+                materialNameState_ = "Orxonox/WSHUD_Reloading";
+            }
+            else
+            {
+                materialNameState_ = "Orxonox/WSHUD_Ready";
+            }            
+
+            Munition* munition = this->weaponMode_->getMunition();
+
+            if (munition != NULL)
+            {
+                MunitionDeployment::Value deployment = munition->getMunitionDeployment();
+
+                if (deployment == MunitionDeployment::Share)
+                {
+                    this->textOverlayLeft_->setCaption(multi_cast<std::string>(munition->getNumMunitionInCurrentMagazine(weaponMode_)));
+                    this->textOverlayRight_->setCaption(multi_cast<std::string>(munition->getNumMagazines()));
+                }
+                else if (deployment == MunitionDeployment::Stack)
+                {
+                    this->textOverlayLeft_->setCaption(multi_cast<std::string>(munition->getNumMunition(weaponMode_)));
+                    this->textOverlayRight_->setCaption("");
+                }
+                else if (deployment == MunitionDeployment::Separate)
+                {
+                    this->textOverlayLeft_->setCaption(multi_cast<std::string>(munition->getNumMunitionInCurrentMagazine(weaponMode_)));
+                    this->textOverlayRight_->setCaption(multi_cast<std::string>(munition->getNumMagazines()));
+                }
+
+                if (munition->getNumMunition(weaponMode_) == 0)
+                {
+                    materialNameState_ = "Orxonox/WSHUD_Empty";
+                }
+
+                if (munition->isA(Class(ReplenishingMunition)))
+                {
+                    ReplenishingMunition* replenishingMunition = dynamic_cast<ReplenishingMunition*>(munition);
+
+                    if (replenishingMunition->canAddMagazines(1))
+                    {
+                        float progress = 1.0f - replenishingMunition->getProgress();
+                        overlayElementReplenish_->setDimensions(1.0f,progress);                    
+                    }
+                    else
+                    {
+                        overlayElementReplenish_->setDimensions(1.0f,1.0f);
+                    }
+                }
+            }
+
+            if (materialNameState_ != lastMaterialNameState)
+            {
+                overlayElementState_->setMaterialName(materialNameState_);
+            }
+        }
+    }    
+
+    void HUDWeaponMode::positionChanged()
+    {
+        OrxonoxOverlay::positionChanged();
+
+        positionHUDChilds();
+    }
+
+    void HUDWeaponMode::sizeChanged()
+    {
+        OrxonoxOverlay::sizeChanged();
+
+        positionHUDChilds();
+    }
+
+    void HUDWeaponMode::changedOwner()
+    {
+        SUPER(HUDWeaponMode, changedOwner);
+
+        this->owner_ = orxonox_cast<Pawn*>(this->getOwner());
+
+        materialNameState_ = ""; // Needed to set the material in the tick after a change of the owner.
+    }
+
+    void HUDWeaponMode::changedOverlayGroup()
+    {
+        SUPER(HUDWeaponMode, changedOverlayGroup);
+
+        this->getOverlayGroup()->addElement(this->textOverlayLeft_.get());
+        this->getOverlayGroup()->addElement(this->textOverlayRight_.get());
+    }   
+
+    void HUDWeaponMode::changedVisibility()
+    {
+        SUPER(HUDWeaponMode, changedVisibility);
+
+        bool visible = this->isVisible();
+
+        this->textOverlayLeft_->setVisible(visible);
+        this->textOverlayRight_->setVisible(visible);
+    }
+
+    void HUDWeaponMode::changedName()
+    {
+        SUPER(HUDWeaponMode, changedName);
+
+        //this->textOverlay_->setName(this->getName() + "text");
+    }  
+
+    void HUDWeaponMode::setWeaponMode(WeaponMode* weaponMode)
+    {
+        weaponMode_ = weaponMode;
+
+        if (!weaponMode_)
+        {
+            return;
+        }
+
+        std::string materialName = weaponMode_->getHUDImageString();
+
+        overlayElementIcon_->setMaterialName(materialName);
+
+        Munition* munition = this->weaponMode_->getMunition();
+
+        if (munition != NULL)
+        {
+            MunitionDeployment::Value deployment = munition->getMunitionDeployment();
+
+            if (deployment == MunitionDeployment::Share)
+            {
+                overlayElementMunition_->setMaterialName("Orxonox/WSHUD_MunitionShare");
+            }
+            else if (deployment == MunitionDeployment::Stack)
+            {
+                overlayElementMunition_->setMaterialName("Orxonox/WSHUD_MunitionStack");
+            }
+            else if (deployment == MunitionDeployment::Separate)
+            {
+                overlayElementMunition_->setMaterialName("Orxonox/WSHUD_MunitionSeparate");
+            }
+        }
+    }
+
+    void HUDWeaponMode::positionHUDChilds()
+    {
+        Vector2 size = Vector2(getSize().x*45.0f/150.0f, getSize().y);
+        Vector2 offset1 = Vector2(getSize().x*82.5f/150.0f, 0.0f);
+        Vector2 offset2 = Vector2(getSize().x*127.5f/150.0f, 0.0f);
+
+        textOverlayLeft_->setPosition(getPosition() + offset1);
+        textOverlayRight_->setPosition(getPosition() + offset2);
+
+        textOverlayLeft_->setSize(size);
+        textOverlayRight_->setSize(size);
+
+        textOverlayLeft_->setTextSize(getSize().y);
+        textOverlayRight_->setTextSize(getSize().y);
+    }
+
+    void HUDWeaponMode::updateSize()
+    {
+        this->setSize(weaponModeHUDActualSize_);
+        updatePosition();
+    }
+
+    void HUDWeaponMode::updatePosition()
+    {
+        this->setPosition(Vector2(weaponModeHUDActualSize_.x*weaponIndex_,weaponModeHUDActualSize_.y*weaponModeIndex_) + this->positionOffset_);
+    }      
+}
Index: code/trunk/src/modules/overlays/hud/HUDWeaponMode.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDWeaponMode.h	(revision 11052)
+++ code/trunk/src/modules/overlays/hud/HUDWeaponMode.h	(revision 11052)
@@ -0,0 +1,115 @@
+
+/*
+ *   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:
+ *      Fabien Vultier
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _HUDWeaponMode_H__
+#define _HUDWeaponMode_H__
+
+#include "overlays/OverlaysPrereqs.h"
+
+#include <map>
+#include <vector>
+#include <string>
+
+#include <OgreOverlayManager.h>
+#include <OgrePanelOverlayElement.h> 
+
+#include "overlays/OrxonoxOverlay.h"
+#include "overlays/OverlayText.h"
+#include "tools/interfaces/Tickable.h"
+#include "worldentities/pawns/Pawn.h"
+#include "overlays/OverlayGroup.h"
+#include "weaponsystem/ReplenishingMunition.h"
+#include "weaponsystem/WeaponMode.h"
+#include "weaponsystem/Munition.h"
+
+namespace orxonox
+{
+    class _OverlaysExport HUDWeaponMode : public OrxonoxOverlay, public Tickable
+    {
+    public:
+        HUDWeaponMode(Context* context);
+        virtual ~HUDWeaponMode();
+
+        virtual void tick(float dt);
+        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+        virtual void changedOwner();
+        virtual void changedOverlayGroup();
+        virtual void changedVisibility();
+        virtual void changedName();
+        virtual void positionChanged();
+        virtual void sizeChanged();
+
+        virtual void setWeaponMode(WeaponMode* weaponMode);
+
+        inline void setWeaponModeHUDActualSize(Vector2 vector)
+            { weaponModeHUDActualSize_ = vector;
+              this->updateSize();
+            }
+        inline Vector2 getWeaponModeHUDActualSize() const
+            { return weaponModeHUDActualSize_; }
+        inline void setWeaponIndex(int index)
+            { weaponIndex_ = index;
+              this->updatePosition();
+            }
+        inline void setWeaponModeIndex(int index)
+            { weaponModeIndex_ = index;
+              this->updatePosition();
+            }
+        inline void setPositionOffset(Vector2 positionOffset)
+            {
+                this->positionOffset_ = positionOffset;
+                this->updatePosition();
+            }
+
+    private:
+        virtual void updateSize();
+        virtual void updatePosition();
+        virtual void positionHUDChilds();
+
+        WeakPtr<Pawn> owner_;
+        WeakPtr<WeaponMode> weaponMode_;
+
+        Ogre::PanelOverlayElement* overlayElementIcon_;
+        Ogre::PanelOverlayElement* overlayElementReplenish_;
+        Ogre::PanelOverlayElement* overlayElementMunition_;
+        Ogre::PanelOverlayElement* overlayElementState_;
+
+        std::string materialNameState_;
+
+        StrongPtr<OverlayText> textOverlayLeft_;
+        StrongPtr<OverlayText> textOverlayRight_;
+
+        Vector2 weaponModeHUDActualSize_;
+        Vector2 positionOffset_;
+        int weaponIndex_;
+        int weaponModeIndex_;
+    };
+}
+
+#endif /* _HUDWeaponMode_H__ */
Index: code/trunk/src/modules/overlays/hud/HUDWeaponSystem.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDWeaponSystem.cc	(revision 11052)
+++ code/trunk/src/modules/overlays/hud/HUDWeaponSystem.cc	(revision 11052)
@@ -0,0 +1,188 @@
+/*
+ *   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:
+ *      Fabien Vultier
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "HUDWeaponSystem.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "weaponsystem/WeaponSystem.h"
+#include "weaponsystem/WeaponPack.h"
+#include "weaponsystem/Weapon.h"
+#include "util/Convert.h"
+#include "core/class/Super.h"
+
+namespace orxonox
+{
+    RegisterClass(HUDWeaponSystem);
+
+    HUDWeaponSystem::HUDWeaponSystem(Context* context) : OrxonoxOverlay(context)
+    {
+        RegisterObject(HUDWeaponSystem);
+
+        weaponModeHUDSize_ = Vector2(0.0f,0.0f);
+        weaponModeHUDActualSize_ = Vector2(0.0f,0.0f);        
+
+        weapons_.clear();
+        hudWeapons_.clear();
+    }
+
+    HUDWeaponSystem::~HUDWeaponSystem()
+    {
+        if (this->isInitialized())
+        {
+            destroyHUDChilds();
+        }
+    }
+
+    void HUDWeaponSystem::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(HUDWeaponSystem, XMLPort, xmlelement, mode);
+
+        XMLPortParam(HUDWeaponSystem, "weaponModeHUDSize", setWeaponModeHUDSize, getWeaponModeHUDSize, xmlelement, mode);
+    }
+
+    void HUDWeaponSystem::positionChanged()
+    {
+        OrxonoxOverlay::positionChanged();
+
+        positionHUDChilds();
+    }
+
+    void HUDWeaponSystem::sizeChanged()
+    {
+        OrxonoxOverlay::sizeChanged();
+
+        weaponModeHUDActualSize_ = this->getActualSize();
+
+        positionHUDChilds();
+    }
+
+    void HUDWeaponSystem::changedOwner()
+    {
+        SUPER(HUDWeaponSystem, changedOwner);
+
+        this->owner_ = orxonox_cast<Pawn*>(this->getOwner());
+
+        updateWeaponList();
+    }
+
+    void HUDWeaponSystem::changedOverlayGroup()
+    {
+        SUPER(HUDWeaponSystem, changedOverlayGroup);
+    }   
+
+    void HUDWeaponSystem::changedVisibility()
+    {
+        SUPER(HUDWeaponSystem, changedVisibility);
+
+        bool visible = this->isVisible();
+
+        for (std::vector<WeakPtr<HUDWeapon> >::iterator it = hudWeapons_.begin(); it != hudWeapons_.end(); ++it)
+        {
+            (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed
+            (*it)->setVisible(visible);
+        }
+    }
+
+    void HUDWeaponSystem::changedName()
+    {
+        SUPER(HUDWeaponSystem, changedName);
+    }  
+
+    void HUDWeaponSystem::updateWeaponList()
+    {
+        if (owner_ == NULL)
+        {
+            return;
+        }
+
+        weapons_.clear();
+
+        destroyHUDChilds();
+
+        std::vector<WeaponPack*>* weaponPacks = owner_->getAllWeaponPacks();
+
+        for (std::vector<WeaponPack*>::const_iterator itPacks = weaponPacks->begin(); itPacks != weaponPacks->end(); ++itPacks)
+        {
+            std::vector<Weapon*>* weapons = (*itPacks)->getAllWeapons();
+
+            for (std::vector<Weapon*>::const_iterator itWeapons = weapons->begin(); itWeapons != weapons->end(); ++itWeapons)
+            {
+                this->weapons_.push_back(*itWeapons);
+            }
+        }
+
+        createHUDChilds();
+        positionHUDChilds();
+    }
+
+    void HUDWeaponSystem::createHUDChilds()
+    {
+        int positionIndex = 0;
+
+        for (std::vector<WeakPtr<Weapon> >::iterator it = weapons_.begin(); it != weapons_.end(); ++it)
+        {
+            HUDWeapon* hudWeapon = new HUDWeapon(this->getContext());
+            hudWeapon->setOwner(owner_);
+            hudWeapon->setOverlayGroup(this->getOverlayGroup());
+            hudWeapon->setVisible(this->isVisible());
+            hudWeapon->setWeapon(*it);
+            hudWeapon->setAspectCorrection(false);
+            hudWeapon->setPickPoint(Vector2(0.0f,0.0f));
+
+            hudWeapons_.push_back(hudWeapon);
+
+            ++ positionIndex;
+        }
+    }      
+
+    void HUDWeaponSystem::positionHUDChilds()
+    {
+        int positionIndex = 0;
+        Vector2 offset = this->getPosition();
+
+        for (std::vector<WeakPtr<HUDWeapon> >::iterator it = hudWeapons_.begin(); it != hudWeapons_.end(); ++it)
+        {
+            (*it)->setPositionOffset(offset);
+            (*it)->setWeaponIndex(positionIndex);
+            (*it)->setWeaponModeHUDActualSize(this->weaponModeHUDActualSize_);
+
+            ++ positionIndex;
+        }
+    }  
+
+    void HUDWeaponSystem::destroyHUDChilds()
+    {
+        for (std::vector<WeakPtr<HUDWeapon> >::iterator it = hudWeapons_.begin(); it != hudWeapons_.end(); ++it)
+        {
+            (*it)->destroy();
+        } 
+
+        hudWeapons_.clear();     
+    }
+}
Index: code/trunk/src/modules/overlays/hud/HUDWeaponSystem.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDWeaponSystem.h	(revision 11052)
+++ code/trunk/src/modules/overlays/hud/HUDWeaponSystem.h	(revision 11052)
@@ -0,0 +1,81 @@
+/*
+ *   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:
+ *      Fabien Vultier
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _HUDWeaponSystem_H__
+#define _HUDWeaponSystem_H__
+
+#include "overlays/OverlaysPrereqs.h"
+
+#include <map>
+#include <vector>
+#include <string>
+
+#include "overlays/OrxonoxOverlay.h"
+#include "worldentities/pawns/Pawn.h"
+#include "overlays/OverlayGroup.h"
+#include "HUDWeapon.h"
+
+namespace orxonox
+{
+    class _OverlaysExport HUDWeaponSystem : public OrxonoxOverlay
+    {
+    public:
+        HUDWeaponSystem(Context* context);
+        virtual ~HUDWeaponSystem();
+
+        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+        virtual void changedOwner();
+        virtual void changedOverlayGroup();
+        virtual void changedVisibility();
+        virtual void changedName();
+        virtual void positionChanged();
+        virtual void sizeChanged();
+    protected:
+        inline void setWeaponModeHUDSize(Vector2 vector)
+            { weaponModeHUDSize_ = vector;
+                this->setSize(weaponModeHUDSize_);
+            }
+        inline Vector2 getWeaponModeHUDSize() const
+            { return weaponModeHUDSize_; }
+    private:
+        virtual void updateWeaponList();
+        virtual void createHUDChilds();
+        virtual void positionHUDChilds();
+        virtual void destroyHUDChilds();
+
+        WeakPtr<Pawn> owner_;
+
+        std::vector<WeakPtr<Weapon> > weapons_;
+        std::vector<WeakPtr<HUDWeapon> > hudWeapons_;
+
+        Vector2 weaponModeHUDSize_;
+        Vector2 weaponModeHUDActualSize_;
+    };
+}
+
+#endif /* _HUDWeaponSystem_H__ */
