Changeset 5980 for code/trunk/src/orxonox
- Timestamp:
- Oct 21, 2009, 4:06:50 PM (15 years ago)
- Location:
- code/trunk/src/orxonox/overlays
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
r5781 r5980 48 48 #include "core/ConsoleCommand.h" 49 49 50 #include "OverlayGroup.h" 51 50 52 namespace orxonox 51 53 { … … 165 167 void OrxonoxOverlay::changedVisibility() 166 168 { 169 SUPER( OrxonoxOverlay, changedVisibility ); 170 167 171 if (!this->overlay_) 168 172 return; 169 173 170 if (this->isVisible()) 174 // only set to visible if corresponding OverlayGroup is also visible 175 if (this->isVisible() && (!this->getOverlayGroup() || this->getOverlayGroup()->isVisible()) ) 171 176 this->overlay_->show(); 172 177 else -
code/trunk/src/orxonox/overlays/OrxonoxOverlay.h
r5929 r5980 179 179 inline OverlayGroup* getOverlayGroup() const 180 180 { return this->group_; } 181 virtual void changedOverlayGroup() {} 181 virtual void changedOverlayGroup() 182 { this->changedVisibility(); } 182 183 183 184 protected: -
code/trunk/src/orxonox/overlays/OverlayGroup.cc
r5929 r5980 105 105 { 106 106 hudElements_.insert(element); 107 element->set Visible(this->isVisible());107 element->setOverlayGroup( this ); 108 108 if (this->owner_) 109 109 element->setOwner(this->owner_); … … 142 142 void OverlayGroup::changedVisibility() 143 143 { 144 for (std::set<OrxonoxOverlay*>::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 145 (*it)->setVisible(this->isVisible()); 144 SUPER( OverlayGroup, changedVisibility ); 145 146 for (std::set<OrxonoxOverlay*>::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 147 (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed 146 148 } 147 149
Note: See TracChangeset
for help on using the changeset viewer.