- Timestamp:
- Dec 8, 2016, 6:34:27 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.cc
r11323 r11325 51 51 overlayElement_->setPosition(0.0f,0.0f); 52 52 overlayElement_->setDimensions(0.70f,0.15f); 53 orxout() << "hello here is the HUDPickupSystem" << endl;54 53 this->background_->addChild(overlayElement_); 55 54 } … … 63 62 } 64 63 65 //TODO: XMLPort66 67 64 void HUDPickupSystem::updatePickupList(std::vector<Pickupable*> picks) 68 65 { 69 66 int i=0; 70 const float offsetX = 0.3 2f;67 const float offsetX = 0.335f; 71 68 float offsetY = 0.77f; 72 69 const float x = 0.1f; … … 88 85 { 89 86 HUDPickupItem* item = new HUDPickupItem(this->getContext()); 90 // item->initializeMaterial(((Pickup*)p)->getRepresentationName(), offsetX+i*x, offsetY); 91 if(i%2==0) 92 item->initializeMaterial("Shield", offsetX+i*x, offsetY); 93 else 94 item->initializeMaterial("ArrowUp", offsetX+i*x, offsetY); 95 item->setOverlayGroup(this->getOverlayGroup()); 96 this->picks[p] = item; 87 item->initializeMaterial(this->getIcon(((Pickup*)p)->getRepresentationName()), offsetX+i*x, offsetY); 88 orxout() << ((Pickup*)p)->getRepresentationName() << endl; 89 90 item->setOverlayGroup(this->getOverlayGroup()); 91 this->picks[p] = item; 97 92 } 98 93 … … 113 108 assert(item); 114 109 // item->setOverlayGroup(nullptr); 115 item->hideMe(pickup );110 item->hideMe(pickup, repaint); 116 111 assert(overlayElement_); 117 112 // overlayElement_->_update(); … … 125 120 this->background_->removeChild(overlayElement_->getName()); 126 121 } 122 123 std::string HUDPickupSystem::getIcon(std::string repName) 124 { 125 if(repName.find("invisible", 0)!=std::string::npos) return "Eye"; 126 else if(repName.find("tri", 0)!=std::string::npos) return "Asterix"; 127 else if(repName.find("health", 0)!=std::string::npos || repName.find("Health", 0)!=std::string::npos) return "Cross"; 128 else if(repName.find("shield", 0)!=std::string::npos) return "Shield"; 129 else if(repName.find("munition", 0)!=std::string::npos) return "Munition"; 130 else if(repName.find("shrink", 0)!=std::string::npos) return "Shrink"; 131 else if(repName.find("boost", 0)!=std::string::npos) return "Flash"; 132 else if(repName.find("speed", 0)!=std::string::npos) return "3arrowsup"; 133 else if(repName.find("drone", 0)!=std::string::npos) return "Damage"; 134 // else if(repName.find("xxxxxxx", 0)!=std::string::npos) return "Splash"; 135 else return "Unknown"; 136 } 127 137 }
Note: See TracChangeset
for help on using the changeset viewer.