- Timestamp:
- Mar 16, 2009, 2:11:14 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/miniprojects/src/orxonox/objects/infos/PlayerInfo.cc
r2662 r2789 35 35 #include "network/ClientInformation.h" 36 36 #include "objects/gametypes/Gametype.h" 37 #include "overlays/OverlayGroup.h" 37 38 38 39 namespace orxonox … … 50 51 this->controllableEntity_ = 0; 51 52 this->controllableEntityID_ = CLIENTID_UNKNOWN; 53 this->gametypeHud_ = 0; 52 54 53 55 this->registerVariables(); … … 68 70 if (this->getGametype()) 69 71 this->getGametype()->playerLeft(this); 72 73 if (this->BaseObject::isInitialized() && this->gametypeHud_) 74 delete this->gametypeHud_; 70 75 } 71 76 } … … 104 109 else 105 110 this->getGametype()->playerEntered(this); 111 112 if (this->isLocalPlayer() && this->isHumanPlayer()) 113 if (this->getGametype()->getHUDTemplate() != "") 114 this->setGametypeHUDTemplate(this->getGametype()->getHUDTemplate()); 106 115 } 107 116 } … … 141 150 if (this->controller_) 142 151 this->controller_->setControllableEntity(entity); 152 153 this->changedControllableEntity(); 143 154 } 144 155 … … 155 166 if (callback) 156 167 entity->removePlayer(); 168 169 this->changedControllableEntity(); 157 170 } 158 171 } … … 172 185 } 173 186 } 187 188 void PlayerInfo::changedControllableEntity() 189 { 190 if (this->gametypeHud_) 191 this->gametypeHud_->setOwner(this->getControllableEntity()); 192 } 193 194 void PlayerInfo::updateGametypeHUD() 195 { 196 if (this->gametypeHud_) 197 { 198 delete this->gametypeHud_; 199 this->gametypeHud_ = 0; 200 } 201 202 if (this->isLocalPlayer() && this->isHumanPlayer() && this->gametypeHudTemplate_ != "") 203 { 204 this->gametypeHud_ = new OverlayGroup(this); 205 this->gametypeHud_->addTemplate(this->gametypeHudTemplate_); 206 this->gametypeHud_->setOwner(this->getControllableEntity()); 207 } 208 } 174 209 }
Note: See TracChangeset
for help on using the changeset viewer.