Changeset 11336 for code/branches/HUD_HS16/src/modules/overlays/hud
- Timestamp:
- Dec 12, 2016, 4:20:50 PM (8 years ago)
- Location:
- code/branches/HUD_HS16/src/modules/overlays/hud
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupItem.cc
r11325 r11336 53 53 overlayElement_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", name )); 54 54 55 overlayElement_->setDimensions(0.075f,0. 1f);55 overlayElement_->setDimensions(0.075f,0.08f); 56 56 57 57 } … … 67 67 void HUDPickupItem::initializeMaterial(const std::string& s, float x, float y) 68 68 { 69 orxout() << "material name is: " << s << endl;70 69 overlayElement_->setMaterialName(s); 71 70 overlayElement_->setPosition(x, y); … … 79 78 assert(overlayElement_); 80 79 assert(this->background_); 81 // if(p->isBeingDestroyed()) //if the pickup is being destroyed, we do nothing82 // {83 // orxout() << "now i didnt repaint" << endl;84 // return;85 // }86 orxout() << "name overlay element: " << overlayElement_->getName() << endl;87 // orxout() << this << " has called hide" << endl;88 80 overlayElement_->hide(); 89 81 this->background_->removeChild(overlayElement_->getName()); 90 // this->background_->_update();91 // orxout() << "after the call the element is visible: " << overlayElement_->isVisible() << endl;92 82 } 93 83 } -
code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupItem.h
r11325 r11336 26 26 Ogre::PanelOverlayElement* overlayElement_; 27 27 virtual ~HUDPickupItem(); 28 29 // virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 30 // virtual void tick(float dt) override; 31 // virtual void changedOwner() override; 32 // virtual void changedOverlayGroup() override; 33 // virtual void changedVisibility() override; 34 // virtual void changedName() override; 35 // virtual void positionChanged() override; 36 // virtual void sizeChanged() override; 37 38 // void setPickup(Pickup* pickup); 28 39 29 void initializeMaterial(const std::string& s, float x, float y); 40 30 void hideMe(Pickupable* p, bool repaint); 41 31 42 private: 43 // void createHUDChilds(); 44 // void positionHUDChilds(); 45 // void destroyHUDChilds(); 46 // void updateWeaponModeList(); 47 // void updateSize(); 48 // void updatePosition(); 49 50 32 private: 51 33 WeakPtr<Pawn> owner_; 52 34 WeakPtr<Pickup> pickup_; -
code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.cc
r11325 r11336 62 62 } 63 63 64 void HUDPickupSystem::updatePickupList(std::vector<Pickupable*> picks )64 void HUDPickupSystem::updatePickupList(std::vector<Pickupable*> picks, std::map<Pickupable*, uint32_t> indexes_) 65 65 { 66 int i=0; 67 const float offsetX = 0.335f; 68 float offsetY = 0.77f; 69 const float x = 0.1f; 70 71 orxout() << "size: " << picks.size() << endl; 66 int i =0; 67 const float offsetX = 0.345f; 68 float offsetY = 0.82f; 69 const float x = 0.102f; 72 70 73 71 if(picks.size()>0) 74 72 { 75 76 73 for(Pickupable* p : picks) 77 74 { 78 // orxout() << "actual pick is: " << p << endl; 79 if(i%5==0) 75 i = indexes_.find(p)->second; 76 offsetY = 0.82f; 77 78 if(i>=5) 80 79 { 81 offsetY+=0.0 4f;82 i =0;80 offsetY+=0.075f; 81 i-=5; 83 82 } 84 83 if(this->picks.count(p)==0) … … 86 85 HUDPickupItem* item = new HUDPickupItem(this->getContext()); 87 86 item->initializeMaterial(this->getIcon(((Pickup*)p)->getRepresentationName()), offsetX+i*x, offsetY); 88 orxout() << ((Pickup*)p)->getRepresentationName() << endl;89 87 90 88 item->setOverlayGroup(this->getOverlayGroup()); 91 89 this->picks[p] = item; 92 90 } 93 94 ++i;95 91 } 96 92 } … … 105 101 assert(pickup); 106 102 HUDPickupItem* item = this->picks.find(pickup)->second; 107 orxout( ) << "removePickup: pickup= " << pickup << " item= " << item << endl;103 orxout(internal_info, context::pickups) << "removePickup: pickup= " << pickup << " item= " << item << endl; 108 104 assert(item); 109 // item->setOverlayGroup(nullptr);110 105 item->hideMe(pickup, repaint); 111 106 assert(overlayElement_); 112 // overlayElement_->_update();113 107 assert(this->background_); 114 // this->background_->_update();115 108 this->picks.erase(pickup); 116 109 } … … 124 117 { 125 118 if(repName.find("invisible", 0)!=std::string::npos) return "Eye"; 126 else if(repName.find("tri", 0)!=std::string::npos) return "Asteri x";119 else if(repName.find("tri", 0)!=std::string::npos) return "Asterisk"; 127 120 else if(repName.find("health", 0)!=std::string::npos || repName.find("Health", 0)!=std::string::npos) return "Cross"; 128 121 else if(repName.find("shield", 0)!=std::string::npos) return "Shield"; … … 132 125 else if(repName.find("speed", 0)!=std::string::npos) return "3arrowsup"; 133 126 else if(repName.find("drone", 0)!=std::string::npos) return "Damage"; 134 // else if(repName.find("xxxxxxx", 0)!=std::string::npos) return "Splash";135 127 else return "Unknown"; 136 128 } -
code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.h
r11325 r11336 56 56 virtual ~HUDPickupSystem(); 57 57 58 // virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 59 // virtual void changedOwner() override; 60 // virtual void changedOverlayGroup() override; 61 // virtual void changedVisibility() override; 62 // virtual void changedName() override; 63 // virtual void positionChanged() override; 64 // virtual void sizeChanged() override; 65 void updatePickupList(std::vector<Pickupable*> picks); 58 void updatePickupList(std::vector<Pickupable*> picks, std::map<Pickupable*, uint32_t> indexes_); 66 59 void createPickupList(); 67 60 void removePickup(Pickupable* pickup); 68 61 69 bool repaint=true; 62 bool repaint=true; //if we shouldnt repaint, set this to false 70 63 71 64 private:
Note: See TracChangeset
for help on using the changeset viewer.