- Timestamp:
- Mar 22, 2009, 9:59:34 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/miniprojects/src/orxonox/objects/infos/HumanPlayer.cc
r2806 r2819 54 54 55 55 this->humanHud_ = 0; 56 this->gametypeHud_ = 0; 56 57 57 58 this->setConfigValues(); … … 61 62 HumanPlayer::~HumanPlayer() 62 63 { 63 if (this->BaseObject::isInitialized() && this->humanHud_) 64 delete this->humanHud_; 64 if (this->BaseObject::isInitialized()) 65 { 66 if (this->humanHud_) 67 delete this->humanHud_; 68 69 if (this->gametypeHud_) 70 delete this->gametypeHud_; 71 } 65 72 } 66 73 … … 115 122 116 123 this->createController(); 124 this->updateHumanHUD(); 117 125 } 118 126 } … … 150 158 } 151 159 160 void HumanPlayer::changedGametype() 161 { 162 PlayerInfo::changedGametype(); 163 164 if (this->isInitialized() && this->isLocalPlayer()) 165 if (this->getGametype()->getHUDTemplate() != "") 166 this->setGametypeHUDTemplate(this->getGametype()->getHUDTemplate()); 167 } 168 152 169 void HumanPlayer::changedControllableEntity() 153 170 { … … 156 173 if (this->humanHud_) 157 174 this->humanHud_->setOwner(this->getControllableEntity()); 175 176 if (this->gametypeHud_) 177 this->gametypeHud_->setOwner(this->getControllableEntity()); 158 178 } 159 179 … … 166 186 } 167 187 168 if (this-> humanHudTemplate_ != "")188 if (this->isLocalPlayer() && this->humanHudTemplate_ != "") 169 189 { 170 190 this->humanHud_ = new OverlayGroup(this); … … 173 193 } 174 194 } 195 196 void HumanPlayer::updateGametypeHUD() 197 { 198 if (this->gametypeHud_) 199 { 200 delete this->gametypeHud_; 201 this->gametypeHud_ = 0; 202 } 203 204 if (this->isLocalPlayer() && this->gametypeHudTemplate_ != "") 205 { 206 this->gametypeHud_ = new OverlayGroup(this); 207 this->gametypeHud_->addTemplate(this->gametypeHudTemplate_); 208 this->gametypeHud_->setOwner(this->getControllableEntity()); 209 } 210 } 175 211 }
Note: See TracChangeset
for help on using the changeset viewer.