Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 25, 2009, 5:38:00 PM (15 years ago)
Author:
danielh
Message:
  • Moved pickups to a seperate directory
  • Added two pickups: HealthImmediate, HealthUsable
Location:
code/branches/pickups2/src/orxonox/objects/pickup
Files:
8 added
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickups2/src/orxonox/objects/pickup/CMakeLists.txt

    r2972 r3063  
    33  DroppedItem.cc
    44  EquipmentItem.cc
    5   Jump.cc
    65  ModifierPickup.cc
    76  PassiveItem.cc
     
    1110  UsableItem.cc
    1211)
     12
     13ADD_SUBDIRECTORY(items)
  • code/branches/pickups2/src/orxonox/objects/pickup/PickupSpawner.cc

    r3046 r3063  
    3434#include "PickupSpawner.h"
    3535#include "BaseItem.h"
     36#include "PickupInventory.h"    // HACK; Only for hack, remove later
     37#include "gui/GUIManager.h"     // HACK; see above
    3638
    3739#include "core/CoreIncludes.h"
     
    7981        XMLPortParam(PickupSpawner, "triggerDistance", setTriggerDistance, getTriggerDistance, xmlelement, mode);
    8082        XMLPortParam(PickupSpawner, "respawnTime", setRespawnTime, getRespawnTime, xmlelement, mode);
     83
     84        // HACKs
     85        // Load the GUI image as soon as the PickupSpawner gets loaded
     86        //  = less delays while running
     87        BaseObject* newObject = this->itemTemplate_->getBaseclassIdentifier()->fabricate(this);
     88        BaseItem* asItem = dynamic_cast<BaseItem*>(newObject);
     89        if (asItem)
     90        {
     91            asItem->addTemplate(this->itemTemplate_);
     92            PickupInventory::getImageForItem(asItem);
     93            delete newObject;
     94        }
     95
     96        //  & load the GUI itself too, along with some empty windows
     97        //   = even less delays
     98        GUIManager::getInstancePtr()->showGUI("PickupInventory");
     99        GUIManager::getInstancePtr()->executeCode("hideGUI(\"PickupInventory\")");
     100        PickupInventory::getSingleton();
    81101    }
    82102    /**
Note: See TracChangeset for help on using the changeset viewer.