Changeset 6753 for code/trunk/src/modules
- Timestamp:
- Apr 19, 2010, 11:14:32 AM (15 years ago)
- Location:
- code/trunk/src/modules/overlays
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/overlays/GUIOverlay.cc
r6417 r6753 64 64 65 65 //Setting player now. 66 if( this->getOwner() ) 67 GUIManager::getInstance().setPlayer(this->guiName_, (orxonox_cast<ControllableEntity*>(this->getOwner()))->getPlayer()); 66 if (this->getOwner()) 67 { 68 ControllableEntity* entity = orxonox_cast<ControllableEntity*>(this->getOwner()); 69 if (entity) 70 GUIManager::getInstance().setPlayer(this->guiName_, entity->getPlayer()); 71 } 68 72 69 73 if (this->isVisible()) … … 87 91 { 88 92 this->guiName_ = name; 89 GUIManager::getInstance().setPlayer(name, orxonox_cast<PlayerInfo*>(this->getOwner())); //Set Player is going to be NULL, so it needs to be set in changedVisibility() as well. 93 if (this->getOwner()) 94 { 95 ControllableEntity* entity = orxonox_cast<ControllableEntity*>(this->getOwner()); 96 if (entity) 97 GUIManager::getInstance().setPlayer(name, entity->getPlayer()); //Set Player is going to be NULL, so it needs to be set in changedVisibility() as well. 98 } 99 } 100 101 void GUIOverlay::changedOwner() 102 { 103 SUPER(GUIOverlay, changedOwner); 104 if (!this->getGUIName().empty()) 105 this->setGUIName(this->getGUIName()); 90 106 } 91 107 } -
code/trunk/src/modules/overlays/GUIOverlay.h
r5781 r6753 50 50 51 51 virtual void changedVisibility(); 52 virtual void changedOwner(); 52 53 53 54 private:
Note: See TracChangeset
for help on using the changeset viewer.