Index: code/trunk/src/modules/pickup/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/pickup/CMakeLists.txt	(revision 6710)
+++ code/trunk/src/modules/pickup/CMakeLists.txt	(revision 6711)
@@ -15,4 +15,6 @@
   FIND_HEADER_FILES
   TOLUA_FILES
+    PickupManager.h
+    PickupRepresentation.h
   DEFINE_SYMBOL
     "PICKUP_SHARED_BUILD"
Index: code/trunk/src/modules/pickup/PickupManager.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupManager.cc	(revision 6710)
+++ code/trunk/src/modules/pickup/PickupManager.cc	(revision 6711)
@@ -35,14 +35,23 @@
 
 #include "core/CoreIncludes.h"
+#include "core/LuaState.h"
+#include "core/GUIManager.h"
 #include "core/ScopedSingletonManager.h"
 #include "core/Identifier.h"
 #include "interfaces/PickupCarrier.h"
+#include "infos/PlayerInfo.h"
 #include "worldentities/pawns/Pawn.h"
 #include "PickupRepresentation.h"
 
+#include "ToluaBindPickup.h"
+
 namespace orxonox
 {
-
+    // Register tolua_open function when loading the library
+    DeclareToluaInterface(Pickup);
+    
     ManageScopedSingleton(PickupManager, ScopeID::Root, false);
+    
+    /*static*/ const std::string PickupManager::guiName_s = "PickupInventory";
     
     /**
@@ -110,3 +119,60 @@
     }
     
+    PickupCarrier* PickupManager::getPawn(void)
+    {
+        Pawn* pawn = dynamic_cast<Pawn*>(GUIManager::getInstancePtr()->getPlayer(PickupManager::guiName_s)->getControllableEntity());
+        if(pawn == NULL)
+            return NULL;
+        return dynamic_cast<PickupCarrier*>(pawn);
+    }
+    
+    int PickupManager::getNumCarrierChildren(PickupCarrier* carrier)
+    {
+        if(carrier == NULL)
+            return 0;
+        return carrier->getNumCarrierChildren();
+    }
+            
+    PickupCarrier* PickupManager::getCarrierChild(int index, PickupCarrier* carrier)
+    {
+        if(carrier == NULL)
+            return NULL;
+        return carrier->getCarrierChild(index);
+    }
+    
+    const std::string& PickupManager::getCarrierName(orxonox::PickupCarrier* carrier)
+    {
+        if(carrier == NULL)
+            return BLANKSTRING;
+        return carrier->getCarrierName();
+    }
+    
+    PickupRepresentation* PickupManager::getPickupRepresentation(int index, PickupCarrier* carrier)
+    {
+        Pickupable* pickup = carrier->getPickup(index);
+        if(pickup == NULL)
+            return NULL;
+        
+        return this->getRepresentation(pickup->getPickupIdentifier());
+    }
+    
+    int PickupManager::getNumPickups(PickupCarrier* carrier)
+    {
+        if(carrier == NULL)
+            return 0;
+        return carrier->getNumPickups();
+    }
+    
+    void PickupManager::dropPickup(int index, PickupCarrier* carrier)
+    {
+        Pickupable* pickup = carrier->getPickup(index);
+        carrier->drop(pickup);
+    }
+    
+    void PickupManager::usePickup(int index, PickupCarrier* carrier, bool use)
+    {
+        Pickupable* pickup = carrier->getPickup(index);
+        pickup->setUsed(use);
+    }
+    
 }
Index: code/trunk/src/modules/pickup/PickupManager.h
===================================================================
--- code/trunk/src/modules/pickup/PickupManager.h	(revision 6710)
+++ code/trunk/src/modules/pickup/PickupManager.h	(revision 6711)
@@ -44,17 +44,18 @@
 #include "core/OrxonoxClass.h"
 
-namespace orxonox
-{
+namespace orxonox // tolua_export
+{ // tolua_export
 
     /**
     @brief
         Manages Pickupables.
-        In essence has two tasks to fulfill. Firstly it must link Pickupables (through their PickupIdentifiers) and their PickupRepresentations. Secondly it manages the Pickup GUI.
+        In essence has two tasks to fulfill. Firstly it must link Pickupables (through their PickupIdentifiers) and their PickupRepresentations. Secondly it manages the PickupInventory.
         //TODO: Manage Pickup GUI.
     @author
         Damian 'Mozork' Frick
     */
-    class _PickupExport PickupManager : public Singleton<PickupManager>, public OrxonoxClass
-    {
+    class _PickupExport PickupManager // tolua_export
+        : public Singleton<PickupManager>, public OrxonoxClass
+    { // tolua_export
         friend class Singleton<PickupManager>;
         
@@ -63,18 +64,33 @@
             virtual ~PickupManager();
             
-            static PickupManager& getInstance() { return Singleton<PickupManager>::getInstance(); }
+            static PickupManager& getInstance() { return Singleton<PickupManager>::getInstance(); } // tolua_export
             
             bool registerRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation); //!< Registers a PickupRepresentation together with the PickupIdentifier of the Pickupable the PickupRepresentation represents.
             PickupRepresentation* getRepresentation(const PickupIdentifier* identifier); //!< Get the PickupRepresentation representing the Pickupable with the input PickupIdentifier.
             
+            // tolua_begin
+            orxonox::PickupCarrier* getPawn(void);
+            
+            int getNumCarrierChildren(orxonox::PickupCarrier* carrier);
+            orxonox::PickupCarrier* getCarrierChild(int index, orxonox::PickupCarrier* carrier);
+            
+            const std::string& getCarrierName(orxonox::PickupCarrier* carrier);
+            
+            int getNumPickups(orxonox::PickupCarrier* carrier);
+            PickupRepresentation* getPickupRepresentation(int index, orxonox::PickupCarrier* carrier);
+            void dropPickup(int index, orxonox::PickupCarrier* carrier);
+            void usePickup(int index, orxonox::PickupCarrier* carrier, bool use);
+            // tolua_end
+            
         private:
             static PickupManager* singletonPtr_s;
+            static const std::string guiName_s;
             
             PickupRepresentation* defaultRepresentation_; //!< The default PickupRepresentation.
             std::map<const PickupIdentifier*, PickupRepresentation*, PickupIdentifierCompare> representations_; //!< Map linking PickupIdentifiers (representing types if Pickupables) and PickupRepresentations.
         
-    };
+    }; // tolua_export
     
-}
+} // tolua_export
 
 #endif // _PickupManager_H__
Index: code/trunk/src/modules/pickup/PickupPrereqs.h
===================================================================
--- code/trunk/src/modules/pickup/PickupPrereqs.h	(revision 6710)
+++ code/trunk/src/modules/pickup/PickupPrereqs.h	(revision 6711)
@@ -65,5 +65,5 @@
 namespace orxonox
 {
-
+    
     class DroppedPickup;
     class Pickup;
Index: code/trunk/src/modules/pickup/PickupRepresentation.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupRepresentation.cc	(revision 6710)
+++ code/trunk/src/modules/pickup/PickupRepresentation.cc	(revision 6711)
@@ -86,4 +86,5 @@
         this->name_ = "Pickup";
         this->spawnerTemplate_ = "";
+        this->inventoryRepresentation_ = "Default";
         this->pickup_ = NULL;
     }
@@ -97,7 +98,8 @@
         SUPER(PickupRepresentation, XMLPort, xmlelement, mode);
         
-        XMLPortParam(PickupRepresentation, "name", setName, getName, xmlelement, mode);
-        XMLPortParam(PickupRepresentation, "description", setDescription, getDescription, xmlelement, mode);
+        XMLPortParam(PickupRepresentation, "pickupName", setPickupName, getPickupName, xmlelement, mode);
+        XMLPortParam(PickupRepresentation, "pickupDescription", setPickupDescription, getPickupDescription, xmlelement, mode);
         XMLPortParam(PickupRepresentation, "spawnerTemplate", setSpawnerTemplate, getSpawnerTemplate, xmlelement, mode);
+        XMLPortParam(PickupRepresentation, "inventoryRepresentation", setInventoryRepresentation, getInventoryRepresentation, xmlelement, mode);
         XMLPortObject(PickupRepresentation, Pickupable, "pickup", setPickup, getPickup, xmlelement, mode);
         XMLPortObject(PickupRepresentation, StaticEntity, "spawner-representation", setSpawnerRepresentation, getSpawnerRepresentationIndex, xmlelement, mode);
Index: code/trunk/src/modules/pickup/PickupRepresentation.h
===================================================================
--- code/trunk/src/modules/pickup/PickupRepresentation.h	(revision 6710)
+++ code/trunk/src/modules/pickup/PickupRepresentation.h	(revision 6711)
@@ -45,6 +45,6 @@
 #include "core/BaseObject.h"
 
-namespace orxonox
-{
+namespace orxonox // tolua_export
+{ // tolua_export
 
     /**
@@ -53,6 +53,7 @@
         They are created through XML and are registered with the PickupManager.
     */
-    class _PickupExport PickupRepresentation : public BaseObject
-    {
+    class _PickupExport PickupRepresentation // tolua_export
+        : public BaseObject
+    { // tolua_export
         
         public:
@@ -67,5 +68,5 @@
             @param name The name.
             */
-            inline void setName(const std::string& name)
+            inline void setPickupName(const std::string& name)
                 { this->name_ = name; }
             /**
@@ -73,5 +74,5 @@
             @param description The Description.
             */
-            inline void setDescription(const std::string& description)
+            inline void setPickupDescription(const std::string& description)
                 { this->description_ = description; }
             /**
@@ -90,4 +91,10 @@
                 { this->spawnerRepresentation_ = representation; }
             /**
+            @brief Set the image representing the pickup in the PickupInventory.
+            @param image A string with the name of the image representing the pickup.
+            */
+            inline void setInventoryRepresentation(const std::string& image)
+                { this->inventoryRepresentation_ = image; }
+            /**
             @brief Set the Pickupable that is represented by this PickupRepresentation.
             @param pickup A pointer to the Pickupable.
@@ -100,12 +107,10 @@
             @return Returns the name.
             */
-            inline const std::string& getName(void)
-                { return this->name_; }
+            inline const std::string& getPickupName(void) { return this->name_; } // tolua_export
             /**
             @brief Get the description of the Pickupable represented by this PickupRepresentation.
             @return Returns the description.
             */
-            inline const std::string& getDescription(void)
-                { return this->description_; }
+            inline const std::string& getPickupDescription(void) { return this->description_; } // tolua_export
             /**
             @brief Get the name of spawnerTemplate the Pickupable represented by this PickupRepresentation.
@@ -121,4 +126,9 @@
             inline const StaticEntity* getSpawnerRepresentationIndex(unsigned int index)
                 { if(index == 0) return this->spawnerRepresentation_; return NULL; }
+            /**
+            @brief Get the name of the image representing the pickup in the PickupInventory.
+            @return Returns the name of the image as a string.
+            */
+            inline const std::string& getInventoryRepresentation(void) { return this->inventoryRepresentation_; } // tolua_export
             /**
             @brief Get the Pickupable represented by this PickupRepresentation.
@@ -139,10 +149,11 @@
             std::string spawnerTemplate_; //!<  The name of the template of this PickupRepresentation.
             StaticEntity* spawnerRepresentation_; //!< The spawnerRepresentation of this PickupRepresentation.
+            std::string inventoryRepresentation_; //!< The name of an image representing the pickup in the PickupInventory. TODO: Exact format and placement of image?
             
             Pickupable* pickup_; //!< The Pickupable that is represented by this PickupRepresentation.
             
-    };
+    }; // tolua_export
 
-}
+} // tolua_export
     
 #endif // _PickupRepresentation_H__
Index: code/trunk/src/modules/pickup/PickupSpawner.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupSpawner.cc	(revision 6710)
+++ code/trunk/src/modules/pickup/PickupSpawner.cc	(revision 6711)
@@ -180,6 +180,7 @@
             {
                 Vector3 distance = it->getWorldPosition() - this->getWorldPosition();
+                PickupCarrier* carrier = dynamic_cast<PickupCarrier*>(*it);
                 //! If a Pawn, that fits the target-range of the item spawned by this Pickup, is in trigger-distance.
-                if (distance.length() < this->triggerDistance_ && this->pickup_->isTarget(*it))
+                if (distance.length() < this->triggerDistance_ && carrier != NULL && carrier->isTarget(this->pickup_))
                 {
                     this->trigger(*it);
Index: code/trunk/src/orxonox/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/CMakeLists.txt	(revision 6710)
+++ code/trunk/src/orxonox/CMakeLists.txt	(revision 6711)
@@ -58,4 +58,5 @@
     MoodManager.h
     controllers/HumanController.h
+    interfaces/PickupCarrier.h
     sound/SoundManager.h
   DEFINE_SYMBOL
Index: code/trunk/src/orxonox/interfaces/InterfaceCompilation.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/InterfaceCompilation.cc	(revision 6710)
+++ code/trunk/src/orxonox/interfaces/InterfaceCompilation.cc	(revision 6711)
@@ -60,4 +60,5 @@
         RegisterRootObject(PickupCarrier);
         
+        this->setCarrierName("PickupCarrier");
     }
     
Index: code/trunk/src/orxonox/interfaces/PickupCarrier.h
===================================================================
--- code/trunk/src/orxonox/interfaces/PickupCarrier.h	(revision 6710)
+++ code/trunk/src/orxonox/interfaces/PickupCarrier.h	(revision 6711)
@@ -45,8 +45,9 @@
 #include "core/OrxonoxClass.h"
 
-namespace orxonox
-{
+namespace orxonox // tolua_export
+{ // tolua_export
 
     //! Forward-declarations.
+    class PickupManager;
     class Pickup;
     class HealthPickup;
@@ -61,9 +62,11 @@
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport PickupCarrier : virtual public OrxonoxClass
-    {
+    class _OrxonoxExport PickupCarrier  // tolua_export
+        : virtual public OrxonoxClass
+    { // tolua_export
         //! So that the different Pickupables have full access to their PickupCarrier.
+        friend class Pickupable;
+        friend class PickupManager;
         //! Friends. 
-        friend class Pickupable;
         friend class Pickup;
         friend class HealthPickup;
@@ -120,6 +123,6 @@
 
                     //! Go recursively through all children to check whether they are a target.
-                    std::list<PickupCarrier*>* children = this->getCarrierChildren();
-                    for(std::list<PickupCarrier*>::const_iterator it = children->begin(); it != children->end(); it++)
+                    std::vector<PickupCarrier*>* children = this->getCarrierChildren();
+                    for(std::vector<PickupCarrier*>::const_iterator it = children->begin(); it != children->end(); it++)
                     {
                         if((*it)->isTarget(pickup))
@@ -147,6 +150,6 @@
 
                     //! Go recursively through all children to check whether they are the target.
-                    std::list<PickupCarrier*>* children = this->getCarrierChildren();
-                    for(std::list<PickupCarrier*>::iterator it = children->begin(); it != children->end(); it++)
+                    std::vector<PickupCarrier*>* children = this->getCarrierChildren();
+                    for(std::vector<PickupCarrier*>::iterator it = children->begin(); it != children->end(); it++)
                     {
                         if(pickup->isTarget(*it))
@@ -166,6 +169,12 @@
             */
             virtual const Vector3& getCarrierPosition(void) = 0;
-
-        protected:
+            
+            /**
+            @brief Get the name of this PickupCarrier.
+            @return Returns the name as a string.
+            */
+            const std::string& getCarrierName(void) { return this->carrierName_; } // tolua_export
+            
+        protected:        
             /**
             @brief Get all direct children of this PickupSpawner.
@@ -174,5 +183,5 @@
             @return Returns a pointer to a list of all direct children.
             */
-            virtual std::list<PickupCarrier*>* getCarrierChildren(void) = 0;
+            virtual std::vector<PickupCarrier*>* getCarrierChildren(void) = 0;
             /**
             @brief Get the parent of this PickupSpawner
@@ -188,10 +197,68 @@
             std::set<Pickupable*>& getPickups(void)
                 { return this->pickups_; }
-
+                
+            /**
+            @brief Set the name of this PickupCarrier.
+                   The name needs to be set in the constructor of every class inheriting from PickupCarrier, by calling setCarrierName().
+            @param name The name to be set.
+            */
+            void setCarrierName(const std::string& name)
+                { this->carrierName_ = name; }
+        
         private:
             std::set<Pickupable*> pickups_; //!< The list of Pickupables carried by this PickupCarrier.
-
-    };
-}
+            std::string carrierName_; //!< The name of the PickupCarrier, as displayed in the PickupInventory.
+            
+            /**
+            @brief Get the number of carrier children this PickupCarrier has.
+            @return Returns the number of carrier children.
+            */
+            unsigned int getNumCarrierChildren(void)
+                {
+                    std::vector<PickupCarrier*>* list = this->getCarrierChildren();
+                    unsigned int size = list->size();
+                    delete list;
+                    return size;
+                }
+            
+            /**
+            @brief Get the index-th child of this PickupCarrier.
+            @param index The index of the child to return.
+            @return Returns the index-th child.
+            */
+            PickupCarrier* getCarrierChild(unsigned int index)
+                {
+                    std::vector<PickupCarrier*>* list = this->getCarrierChildren();
+                    if(list->size() < index)
+                        return NULL;
+                    PickupCarrier* carrier = (*list)[index];
+                    delete list;
+                    return carrier;
+                }
+            
+            /**
+            @brief Get the number of Pickupables this PickupCarrier carries.
+            @return returns the number of pickups.
+            */
+            unsigned int getNumPickups(void)
+                { return this->pickups_.size(); }
+            
+            /**
+            @brief Get the index-th Pickupable of this PickupCarrier.
+            @param index The index of the Pickupable to return.
+            @return Returns the index-th pickup.
+            */
+            Pickupable* getPickup(unsigned int index)
+                {
+                    std::set<Pickupable*>::iterator it;
+                    for(it = this->pickups_.begin(); index != 0 && it != this->pickups_.end(); it++)
+                        index--;
+                    if(it == this->pickups_.end())
+                        return NULL;
+                    return *it;
+                }
+            
+    }; // tolua_export
+} // tolua_export
 
 #endif /* _PickupCarrier_H__ */
Index: code/trunk/src/orxonox/items/Engine.cc
===================================================================
--- code/trunk/src/orxonox/items/Engine.cc	(revision 6710)
+++ code/trunk/src/orxonox/items/Engine.cc	(revision 6711)
@@ -64,4 +64,5 @@
         this->boostBlur_ = 0;
 
+        this->setCarrierName("Engine");
         this->speedAdd_ = 0.0;
         this->speedMultiply_ = 1.0;
Index: code/trunk/src/orxonox/items/Engine.h
===================================================================
--- code/trunk/src/orxonox/items/Engine.h	(revision 6710)
+++ code/trunk/src/orxonox/items/Engine.h	(revision 6711)
@@ -122,6 +122,6 @@
 
         protected:
-            virtual std::list<PickupCarrier*>* getCarrierChildren(void)
-                { return new std::list<PickupCarrier*>(); }
+            virtual std::vector<PickupCarrier*>* getCarrierChildren(void)
+                { return new std::vector<PickupCarrier*>(); }
             virtual PickupCarrier* getCarrierParent(void);
 
Index: code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
===================================================================
--- code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 6710)
+++ code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 6711)
@@ -327,8 +327,15 @@
         {
             OrxonoxOverlay* overlay= it->second;
+            COUT(1) << "MUP" << std::endl;
             if(overlay->isVisible())
+            {
                 overlay->hide();
+                COUT(1) << "HIDE " << name << std::endl;
+            }
             else
+            {
                 overlay->show();
+                COUT(1) << "SHOW " << name << std::endl;
+            }
         }
     }
Index: code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.cc	(revision 6710)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.cc	(revision 6711)
@@ -78,4 +78,6 @@
         else
             this->weaponSystem_ = 0;
+        
+        this->setCarrierName("Pawn");
 
         this->setRadarObjectColour(ColourValue::Red);
Index: code/trunk/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.h	(revision 6710)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.h	(revision 6711)
@@ -37,8 +37,9 @@
 #include "worldentities/ControllableEntity.h"
 
-namespace orxonox
-{
-    class _OrxonoxExport Pawn : public ControllableEntity, public RadarViewable, public PickupCarrier
-    {
+namespace orxonox // tolua_export
+{ // tolua_export
+    class _OrxonoxExport Pawn // tolua_export
+        : public ControllableEntity, public RadarViewable, public PickupCarrier
+    { // tolua_export
         friend class WeaponSystem;
 
@@ -132,6 +133,6 @@
             bool bAlive_;
 
-            virtual std::list<PickupCarrier*>* getCarrierChildren(void)
-                { return new std::list<PickupCarrier*>(); }
+            virtual std::vector<PickupCarrier*>* getCarrierChildren(void)
+                { return new std::vector<PickupCarrier*>(); }
             virtual PickupCarrier* getCarrierParent(void)
                 { return NULL; }
@@ -155,6 +156,6 @@
 
             Vector3 aimPosition_;
-    };
-}
+    }; // tolua_export
+} // tolua_export
 
 #endif /* _Pawn_H__ */
Index: code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc	(revision 6710)
+++ code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc	(revision 6711)
@@ -221,8 +221,8 @@
     }
 
-    std::list<PickupCarrier*>* SpaceShip::getCarrierChildren(void)
-    {
-        std::list<PickupCarrier*>* list = new std::list<PickupCarrier*>();
-        list->push_front(this->engine_);
+    std::vector<PickupCarrier*>* SpaceShip::getCarrierChildren(void)
+    {
+        std::vector<PickupCarrier*>* list = new std::vector<PickupCarrier*>();
+        list->push_back(this->engine_);
         return list;
     }
Index: code/trunk/src/orxonox/worldentities/pawns/SpaceShip.h
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/SpaceShip.h	(revision 6710)
+++ code/trunk/src/orxonox/worldentities/pawns/SpaceShip.h	(revision 6711)
@@ -86,5 +86,5 @@
 
         protected:
-            virtual std::list<PickupCarrier*>* getCarrierChildren(void);
+            virtual std::vector<PickupCarrier*>* getCarrierChildren(void);
             bool bInvertYAxis_;
 
