Index: code/branches/hudHS14/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/branches/hudHS14/src/modules/overlays/hud/HUDNavigation.cc	(revision 10149)
+++ code/branches/hudHS14/src/modules/overlays/hud/HUDNavigation.cc	(revision 10163)
@@ -83,4 +83,5 @@
         this->setAimMarkerSize(0.02f);
         this->setHealthMarkerSize(0.06f);
+        this->setHealthLevelMarkerSize(0.06f);
 
         this->setDetectionLimit(10000.0f);
@@ -118,4 +119,5 @@
         XMLPortParam(HUDNavigation, "aimMarkerSize", setAimMarkerSize, getAimMarkerSize, xmlelement, mode);
         XMLPortParam(HUDNavigation, "healthMarkerSize", setHealthMarkerSize, getHealthMarkerSize, xmlelement, mode);
+        XMLPortParam(HUDNavigation, "healthLevelMarkerSize", setHealthLevelMarkerSize, getHealthLevelMarkerSize, xmlelement, mode);
 
     }
@@ -305,4 +307,5 @@
                     {
                     	it->second.health_->hide();
+                    	it->second.healthLevel_->hide();
                     	it->second.panel_->setMaterialName(TextureGenerator::getMaterialName("arrows.png", it->first->getRadarObjectColour()));
                         it->second.wasOutOfView_ = true;
@@ -367,6 +370,5 @@
 
 
-                	//calculate the health of the actual selected radarViewable (while (0) is no health left, (1) is the initial health)
-
+                	//calculate the health of the actual selected radarViewable (relativHealthScale: while (0) is no health left, (1) is the initial health)
                     Pawn* pawnPtr = (Pawn*) (it->first->getWorldEntity());
                     float health = pawnPtr->getHealth();
@@ -374,6 +376,21 @@
                     float relativHealthScale = health/initHealth;
 
-                    //values from 0 to 10
+                    //integer values from 0 to 10 (0 is no health and 10 is full health)
                     int discreteHealthScale = 10*relativHealthScale;
+
+                    //calculate the HealthLevel (= OponentLevel or Strength) there are 5 Levels
+                    //Level 1, Level 2,... , Level 5
+                    int HealthLevel = 1;
+
+                    if(initHealth < 200)
+                    	HealthLevel = 1;
+                    if(200 <= initHealth && initHealth < 500)
+                    	HealthLevel = 2;
+                    if(500 <= initHealth && initHealth < 1000)
+                    	HealthLevel = 3;
+                    if(1000 <= initHealth && initHealth < 2500)
+                    	HealthLevel = 4;
+                    if(2500 <= initHealth)
+                    	HealthLevel = 5;
 
 
@@ -387,5 +404,5 @@
                         it->second.target_->setDimensions(this->aimMarkerSize_ * this->getActualSize().x, this->aimMarkerSize_ * this->getActualSize().y);
 
-                        //
+
                         //it->second.health_->setMaterialName(TextureGenerator::getMaterialName("bar2_1.png", it->first->getRadarObjectColour()));
                         it->second.health_->setMaterialName(TextureGenerator::getMaterialName("barSquare.png", it->first->getRadarObjectColour()));
@@ -393,19 +410,31 @@
                         it->second.wasOutOfView_ = false;
 
+                        // because as soon as relative health drops below 10% (0.1) the descrete value is 0 but as long as the
+                        // spaceship is still intact there should be at least one part of the bar left.
                         if(1<=discreteHealthScale){
                         	it->second.health_->setTiling((float)discreteHealthScale , 1 ,0);
                         	it->second.health_->setDimensions(this->healthMarkerSize_ * this->getActualSize().x *0.1*discreteHealthScale, 0.75*this->healthMarkerSize_ * this->getActualSize().y);
                         }
-                    }
-
-
-
-                    // Position and Dimensions (amount) health
+
+
+
+                        //healthLevel
+                        it->second.healthLevel_->setMaterialName(TextureGenerator::getMaterialName("barSquare.png", it->first->getRadarObjectColour()));
+                        it->second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * this->getActualSize().x , 0.75*this->healthLevelMarkerSize_ * this->getActualSize().y);
+                        it->second.wasOutOfView_ = false;
+                        it->second.healthLevel_->setTiling((float)HealthLevel , 1 ,0);
+                        it->second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * this->getActualSize().x *0.1*HealthLevel, 0.25*this->healthLevelMarkerSize_ * this->getActualSize().y);
+                    }
+
+
+
+                    // sets Position and Dimensions (amount) health
                     it->second.health_->setUV(0.0f, 0.0f, 1.0f, 1.0f);
                     it->second.health_->setLeft((pos.x + 0.975f - it->second.panel_->getWidth()) * 0.5f);
                     it->second.health_->setTop((-pos.y + 1.04f - it->second.panel_->getHeight()) * 0.5f);
-                   // it->second.health_->setDimensions(this->healthMarkerSize_ * this->getActualSize().x * relativHealthScale, 0.75*this->healthMarkerSize_ * this->getActualSize().y);
-
-
+
+
+                    // because as soon as relative health drops below 10% (0.1) the descrete value is 0 but as long as the
+                    // spaceship is still intact there should be at least one part of the bar left.
                     if(1<=discreteHealthScale){
                     it->second.health_->setTiling((float)discreteHealthScale , 1 ,0);
@@ -413,4 +442,13 @@
                     }
 
+
+                    //sets Position and Dimensions (level) of healthLevel
+                    it->second.healthLevel_->setMaterialName(TextureGenerator::getMaterialName("barSquare.png", it->first->getRadarObjectColour()));
+                    it->second.healthLevel_->setUV(0.0f, 0.0f, 1.0f, 1.0f);
+                    it->second.healthLevel_->setLeft((pos.x + 0.975f - it->second.panel_->getWidth()) * 0.5f);
+                    it->second.healthLevel_->setTop((-pos.y + 1.125f - it->second.panel_->getHeight()) * 0.5f);
+
+                    it->second.healthLevel_->setTiling((float)HealthLevel , 1 ,0);
+                    it->second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * this->getActualSize().x *0.1*HealthLevel, 0.25*this->healthLevelMarkerSize_ * this->getActualSize().y);
 
 
@@ -424,7 +462,10 @@
                     it->second.text_->setTop((-pos.y + 1.0f + it->second.panel_->getHeight()) * 0.5f);
 
+
+
+
                     // Make sure the overlays are shown
-
                     it->second.health_->show();
+                    it->second.healthLevel_->show();
                     it->second.panel_->show();
                     it->second.text_->show();
@@ -470,5 +511,6 @@
             {
             	it->second.health_->hide();
-                it->second.panel_->hide();
+                it->second.healthLevel_->hide();
+            	it->second.panel_->hide();
                 it->second.text_->hide();
                 it->second.target_->hide();
@@ -495,4 +537,6 @@
         	if (it->second.health_ != NULL)
         	    it->second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);
+        	if (it->second.healthLevel_ != NULL)
+        		it->second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale);
             if (it->second.panel_ != NULL)
                 it->second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);
@@ -523,10 +567,15 @@
 
         // Create health
-                Ogre::PanelOverlayElement* health = static_cast<Ogre::PanelOverlayElement*>( Ogre::OverlayManager::getSingleton()
-                        .createOverlayElement("Panel", "HUDNavigation_healthMarker_" + getUniqueNumberString()));
-                //panel->setMaterialName("Orxonox/NavTDC");
-                health->setMaterialName(TextureGenerator::getMaterialName("barSquare.png", object->getRadarObjectColour()));
-                health->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);
-                //panel->setColour(object->getRadarObjectColour());
+        Ogre::PanelOverlayElement* health = static_cast<Ogre::PanelOverlayElement*>( Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDNavigation_healthMarker_" + getUniqueNumberString()));
+        //panel->setMaterialName("Orxonox/NavTDC");
+        health->setMaterialName(TextureGenerator::getMaterialName("barSquare.png", object->getRadarObjectColour()));
+        health->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);
+        //panel->setColour(object->getRadarObjectColour());
+
+        // Create healthLevel
+        Ogre::PanelOverlayElement* healthLevel = static_cast<Ogre::PanelOverlayElement*>( Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDNavigation_healthLevelMarker_" + getUniqueNumberString()));
+        //panel->setMaterialName("Orxonox/NavTDC");
+        health->setMaterialName(TextureGenerator::getMaterialName("barSquare.png", object->getRadarObjectColour()));
+        health->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale);
 
 
@@ -553,4 +602,5 @@
 
         health->hide();
+        healthLevel->hide();
         panel->hide();
         target->hide();
@@ -558,8 +608,9 @@
 
         ObjectInfo tempStruct =
-        {   health, panel, target, text, false, false, false};
+        {   health, healthLevel, panel, target, text, false, false, false};
         this->activeObjectList_[object] = tempStruct;
 
         this->background_->addChild(health);
+        this->background_->addChild(healthLevel);
         this->background_->addChild(panel);
         this->background_->addChild(target);
@@ -577,4 +628,5 @@
             // Detach overlays
         	this->background_->removeChild(it->second.health_->getName());
+        	this->background_->removeChild(it->second.healthLevel_->getName());
             this->background_->removeChild(it->second.panel_->getName());
             this->background_->removeChild(it->second.target_->getName());
@@ -582,4 +634,5 @@
             // Properly destroy the overlay elements (do not use delete!)
             Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.health_);
+            Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.healthLevel_);
             Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.panel_);
             Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.target_);
