Index: code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupItem.cc
===================================================================
--- code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupItem.cc	(revision 11323)
+++ code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupItem.cc	(revision 11325)
@@ -52,7 +52,6 @@
 
         overlayElement_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", name ));
-        // overlayElement_->setName(name);
 
-        overlayElement_->setDimensions(0.1f,0.1f);
+        overlayElement_->setDimensions(0.075f,0.1f);
         
     }
@@ -75,6 +74,7 @@
     }
 
-    void HUDPickupItem::hideMe(Pickupable* p)
+    void HUDPickupItem::hideMe(Pickupable* p, bool repaint)
     {
+        if(!repaint) return;                     //dont do anything, if we are not allowed to repaint because the level is terminating
         assert(overlayElement_);
         assert(this->background_);
@@ -91,161 +91,3 @@
         // orxout() << "after the call the element is visible: " << overlayElement_->isVisible() << endl;
     }
-
-    // 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 (HUDWeaponMode* hudWeaponMode : hudWeaponModes_)
-    //     {
-    //         hudWeaponMode->changedVisibility(); //inform all Child Overlays that our visibility has changed
-    //         hudWeaponMode->setVisible(visible);
-    //     }
-    // }
-
-    // void HUDWeapon::changedName()
-    // {
-    //     SUPER(HUDWeapon, changedName);
-    // }
-
-    // void HUDWeapon::setWeapon(Weapon* weapon)
-    // {
-    //     weapon_ = weapon;
-
-    //     if (!weapon_)
-    //     {
-    //         return;
-    //     }
-
-    //     updateWeaponModeList();
-    // }
-
-    // void HUDWeapon::updateWeaponModeList()
-    // {
-    //     if (owner_ == nullptr || weapon_ == nullptr)
-    //     {
-    //         return;
-    //     }
-            
-    //     destroyHUDChilds();
-
-    //     updateSize();
-    //     createHUDChilds();
-    //     positionHUDChilds();
-    // }  
-
-    // void HUDWeapon::createHUDChilds()
-    // {
-    //     if (weapon_ == nullptr)
-    //     {
-    //         return;
-    //     }
-
-    //     int positionIndex = 0;
-
-    //     for (const auto& mapEntry : weapon_->getAllWeaponmodes())
-    //     {
-    //         HUDWeaponMode* hudWeaponMode = new HUDWeaponMode(this->getContext());
-    //         hudWeaponMode->setOwner(owner_);
-    //         hudWeaponMode->setOverlayGroup(this->getOverlayGroup());
-    //         hudWeaponMode->setVisible(this->isVisible());
-    //         hudWeaponMode->setWeaponMode(mapEntry.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 (HUDWeaponMode* hudWeaponMode : hudWeaponModes_)
-    //     {
-    //         hudWeaponMode->setPositionOffset(this->positionOffset_);
-    //         hudWeaponMode->setWeaponModeIndex(positionIndex);
-    //         hudWeaponMode->setWeaponIndex(this->weaponIndex_);
-    //         hudWeaponMode->setWeaponModeHUDActualSize(this->weaponModeHUDActualSize_);
-
-    //         ++ positionIndex;
-    //     }
-    // }  
-
-    // void HUDWeapon::destroyHUDChilds()
-    // {
-    //     for (HUDWeaponMode* hudWeaponMode : hudWeaponModes_)
-    //     {
-    //         hudWeaponMode->destroy();
-    //     } 
-
-    //     hudWeaponModes_.clear();
-    // }
-
-    // void HUDWeapon::updateSize()
-    // {
-    //     if (weapon_ != nullptr)
-    //     {
-    //         this->setSize(Vector2(weaponModeHUDActualSize_.x,weaponModeHUDActualSize_.y*weapon_->getAllWeaponmodes().size()));
-    //         updatePosition();
-    //     }        
-    // }
-
-    // void HUDWeapon::updatePosition()
-    // {
-    //     if (weapon_ != nullptr)
-    //     {
-    //         this->setPosition(Vector2(weaponModeHUDActualSize_.x*weaponIndex_,0.0f) + this->positionOffset_);
-    //     }        
-    // }       
 }
Index: code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupItem.h
===================================================================
--- code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupItem.h	(revision 11323)
+++ code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupItem.h	(revision 11325)
@@ -38,5 +38,5 @@
         // void setPickup(Pickup* pickup);  
         void initializeMaterial(const std::string& s, float x, float y);  
-        void hideMe(Pickupable* p); 
+        void hideMe(Pickupable* p, bool repaint); 
 
     private:
Index: code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.cc
===================================================================
--- code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.cc	(revision 11323)
+++ code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.cc	(revision 11325)
@@ -51,5 +51,4 @@
         overlayElement_->setPosition(0.0f,0.0f);
         overlayElement_->setDimensions(0.70f,0.15f);
-        orxout() << "hello here is the HUDPickupSystem" << endl;
         this->background_->addChild(overlayElement_);
     }
@@ -63,10 +62,8 @@
     }
 
-   //TODO: XMLPort
-
     void HUDPickupSystem::updatePickupList(std::vector<Pickupable*> picks)
     {
         int i=0;
-        const float offsetX = 0.32f;
+        const float offsetX = 0.335f;
         float offsetY = 0.77f;
         const float x = 0.1f;
@@ -88,11 +85,9 @@
                 {
                     HUDPickupItem* item = new HUDPickupItem(this->getContext());
-                    // item->initializeMaterial(((Pickup*)p)->getRepresentationName(), offsetX+i*x, offsetY);
-                if(i%2==0)
-                    item->initializeMaterial("Shield", offsetX+i*x, offsetY);
-                else
-                    item->initializeMaterial("ArrowUp", offsetX+i*x, offsetY);
-                item->setOverlayGroup(this->getOverlayGroup());
-                this->picks[p] = item;
+                    item->initializeMaterial(this->getIcon(((Pickup*)p)->getRepresentationName()), offsetX+i*x, offsetY);
+                    orxout() << ((Pickup*)p)->getRepresentationName() << endl;
+                
+                    item->setOverlayGroup(this->getOverlayGroup());
+                    this->picks[p] = item;
                 }
                 
@@ -113,5 +108,5 @@
         assert(item);
         // item->setOverlayGroup(nullptr);
-        item->hideMe(pickup);
+        item->hideMe(pickup, repaint);
         assert(overlayElement_);
         // overlayElement_->_update();
@@ -125,3 +120,18 @@
         this->background_->removeChild(overlayElement_->getName());
     }
+
+    std::string HUDPickupSystem::getIcon(std::string repName)
+    {
+        if(repName.find("invisible", 0)!=std::string::npos) return "Eye";
+        else if(repName.find("tri", 0)!=std::string::npos) return "Asterix";
+        else if(repName.find("health", 0)!=std::string::npos || repName.find("Health", 0)!=std::string::npos) return "Cross";
+        else if(repName.find("shield", 0)!=std::string::npos) return "Shield";
+        else if(repName.find("munition", 0)!=std::string::npos) return "Munition";
+        else if(repName.find("shrink", 0)!=std::string::npos) return "Shrink";
+        else if(repName.find("boost", 0)!=std::string::npos) return "Flash";
+        else if(repName.find("speed", 0)!=std::string::npos) return "3arrowsup";
+        else if(repName.find("drone", 0)!=std::string::npos) return "Damage";
+        //        else if(repName.find("xxxxxxx", 0)!=std::string::npos) return "Splash";
+        else return "Unknown";
+    }
 }
Index: code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.h
===================================================================
--- code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.h	(revision 11323)
+++ code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.h	(revision 11325)
@@ -66,7 +66,11 @@
         void createPickupList();  
         void removePickup(Pickupable* pickup);
+
+        bool repaint=true;
+
     private:
         
         void destroyAll();
+        std::string getIcon(std::string repName);
 
         std::map<Pickupable*, HUDPickupItem*> picks;
Index: code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc
===================================================================
--- code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc	(revision 11323)
+++ code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc	(revision 11325)
@@ -314,5 +314,5 @@
 
             this->indexes_.erase(pickup);
-            this->pickups_.find(index)->second=nullptr; //set to null, so that can be identified as free slot by getPickupIndex()
+            this->pickups_.erase(index); //set to null, so that can be identified as free slot by getPickupIndex()
 
 
@@ -355,4 +355,6 @@
         PickupManager& manager = PickupManager::getInstance();
 
+        if(!manager.pickups_.count(index)) return; //if pickup is no longer here, dont do anything
+
         Pickupable* pickup=manager.pickups_.find(index)->second;
         if(pickup==nullptr)
@@ -364,5 +366,6 @@
         orxout() << "The pickup is being used: " << pickup->isUsed() << endl;
 
-        pickup->drop(true);
+        manager.dropPickup(index);
+
         // if(pickup->isUsed())
         //     manager.usePickup(index, false);
@@ -557,5 +560,5 @@
         for(uint32_t i=0; i<10; i++)
         {
-            if(pickups_.find(i)->second==nullptr) return i;
+            if(!pickups_.count(i)) return i;
         }
         //all slots are full and we have to drop sth
