Changeset 6753 for code/trunk/src
- Timestamp:
- Apr 19, 2010, 11:14:32 AM (15 years ago)
- Location:
- code/trunk/src
- Files:
-
- 3 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: -
code/trunk/src/orxonox/overlays/OrxonoxOverlay.h
r6417 r6753 42 42 #include "util/OgreForwardRefs.h" 43 43 #include "core/BaseObject.h" 44 #include "core/Super.h" 44 45 #include "core/WindowEventListener.h" 45 46
Note: See TracChangeset
for help on using the changeset viewer.