Changeset 2428 for code/branches/objecthierarchy2/src/orxonox/objects/infos
- Timestamp:
- Dec 13, 2008, 10:54:26 PM (16 years ago)
- Location:
- code/branches/objecthierarchy2/src/orxonox/objects/infos
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy2/src/orxonox/objects/infos/CMakeLists.txt
r2362 r2428 4 4 PlayerInfo.cc 5 5 HumanPlayer.cc 6 GametypeInfo.cc 6 7 ) 7 8 -
code/branches/objecthierarchy2/src/orxonox/objects/infos/HumanPlayer.cc
r2171 r2428 37 37 #include "objects/controllers/HumanController.h" 38 38 #include "objects/gametypes/Gametype.h" 39 #include "overlays/OverlayGroup.h" 39 40 40 41 namespace orxonox … … 63 64 { 64 65 SetConfigValue(nick_, "Player").callback(this, &HumanPlayer::configvaluecallback_changednick); 66 SetConfigValue(hudtemplate_, "defaultHUD").callback(this, &HumanPlayer::configvaluecallback_changedHUDTemplate); 65 67 } 66 68 … … 69 71 REGISTERSTRING(this->synchronize_nick_, direction::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_changednick)); 70 72 71 REGISTERDATA(this->clientID_, direction::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_clientIDchanged));73 REGISTERDATA(this->clientID_, direction::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_clientIDchanged)); 72 74 REGISTERDATA(this->server_initialized_, direction::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_server_initialized)); 73 75 REGISTERDATA(this->client_initialized_, direction::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_client_initialized)); … … 83 85 this->setName(this->nick_); 84 86 } 87 } 88 89 void HumanPlayer::configvaluecallback_changedHUDTemplate() 90 { 91 this->changedController(); 85 92 } 86 93 … … 138 145 this->networkcallback_clientIDchanged(); 139 146 } 147 148 void HumanPlayer::changedController() 149 { 150 if (this->getController()) 151 { 152 this->getController()->setHUDTemplate(this->hudtemplate_); 153 154 if (this->getController() && this->getController()->getHUD()) 155 this->getController()->getHUD()->setOwner(this->getControllableEntity()); 156 } 157 } 140 158 } -
code/branches/objecthierarchy2/src/orxonox/objects/infos/HumanPlayer.h
r2362 r2428 51 51 void setClientID(unsigned int clientID); 52 52 53 virtual void changedController(); 54 53 55 protected: 54 56 void configvaluecallback_changednick(); 57 void configvaluecallback_changedHUDTemplate(); 55 58 void networkcallback_changednick(); 56 59 void networkcallback_clientIDchanged(); … … 60 63 std::string nick_; 61 64 std::string synchronize_nick_; 65 std::string hudtemplate_; 62 66 bool server_initialized_; 63 67 bool client_initialized_; -
code/branches/objecthierarchy2/src/orxonox/objects/infos/PlayerInfo.cc
r2369 r2428 112 112 if (this->controllableEntity_) 113 113 this->controller_->setControllableEntity(this->controllableEntity_); 114 this->changedController(); 114 115 } 115 116 116 117 void PlayerInfo::startControl(ControllableEntity* entity) 117 118 { 119 if (entity == this->controllableEntity_) 120 return; 121 118 122 if (this->controllableEntity_) 119 123 this->stopControl(this->controllableEntity_); -
code/branches/objecthierarchy2/src/orxonox/objects/infos/PlayerInfo.h
r2362 r2428 71 71 { return this->controllableEntity_; } 72 72 73 inline Controller* getController() const 74 { return this->controller_; } 75 virtual void changedController() {} 76 73 77 protected: 74 78 void createController();
Note: See TracChangeset
for help on using the changeset viewer.