Changeset 11704 for code/trunk/src/modules/overlays/hud/HUDPickupSystem.cc
- Timestamp:
- Jan 6, 2018, 3:16:00 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/overlays/hud/HUDPickupSystem.cc
r11703 r11704 38 38 #include "HUDPickupSystem.h" 39 39 #include "HUDPickupItem.h" 40 #include "pickup/Pickup.h"41 40 #include "pickup/PickupManager.h" 42 41 … … 66 65 } 67 66 68 void HUDPickupSystem:: sync(std::vector<Pickupable*> p, std::map<Pickupable*, uint32_t> indexes_)67 void HUDPickupSystem::tick(float dt) 69 68 { 69 SUPER(HUDPickupSystem, tick, dt); 70 70 71 //hide all pickup symbols in HUD and delete from local map 71 72 72 for(HUDPickupItem* item : items_) 73 73 { … … 84 84 const float y = 0.075f; 85 85 86 for(Pickupable* pickup:p) 86 int numPickups = PickupManager::getInstance().getNumPickups(); 87 for (int index = 0; index < numPickups; ++index) 87 88 { 88 int index = indexes_.find(pickup)->second;89 89 int row = index / 5; 90 90 int column = index % 5; 91 91 92 const PickupInventoryContainer* container = PickupManager::getInstance().popPickup(); 93 92 94 HUDPickupItem* item = new HUDPickupItem(this->getContext()); 93 item->initializeMaterial(this->getIcon( ((Pickup*)pickup)->getRepresentationName()), offsetX+column*x, offsetY+row*y);95 item->initializeMaterial(this->getIcon(container->representationName), offsetX+column*x, offsetY+row*y); 94 96 item->setOverlayGroup(this->getOverlayGroup()); 95 97 items_.push_back(item);
Note: See TracChangeset
for help on using the changeset viewer.