- Timestamp:
- May 26, 2016, 4:53:34 PM (9 years ago)
- Location:
- code/branches/presentationFS16
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentationFS16
- Property svn:mergeinfo changed
/code/branches/sagerjFS16 (added) merged: 11138,11142,11153,11164,11166,11170,11174-11175,11185,11189,11205
- Property svn:mergeinfo changed
-
code/branches/presentationFS16/src/orxonox/worldentities/ControllableEntity.cc
r11071 r11208 49 49 RegisterClass(ControllableEntity); 50 50 51 registerMemberNetworkFunction( ControllableEntity, fire);51 registerMemberNetworkFunction( ControllableEntity, push ); 52 52 registerMemberNetworkFunction( ControllableEntity, setTargetInternal ); 53 53 … … 299 299 } 300 300 301 void ControllableEntity:: fire(unsigned int firemode)301 void ControllableEntity::push(unsigned int firemode) 302 302 { 303 303 if(GameMode::isMaster()) 304 304 { 305 this-> fired(firemode);305 this->pushed(firemode); 306 306 } 307 307 else 308 308 { 309 callMemberNetworkFunction(&ControllableEntity::fire, this->getObjectID(), 0, firemode); 309 callMemberNetworkFunction(&ControllableEntity::push, this->getObjectID(), 0, firemode); 310 } 311 } 312 313 void ControllableEntity::release(unsigned int firemode) 314 { 315 if(GameMode::isMaster()) 316 { 317 this->released(firemode); 318 } 319 else 320 { 321 callMemberNetworkFunction(&ControllableEntity::release, this->getObjectID(), 0, firemode); 310 322 } 311 323 } -
code/branches/presentationFS16/src/orxonox/worldentities/ControllableEntity.h
r11071 r11208 96 96 { this->rotateRoll(Vector2(value, 0)); } 97 97 98 void fire(unsigned int firemode); 99 virtual void fired(unsigned int firemode) {} 98 void push(unsigned int firemode); 99 void release(unsigned int firemode); 100 virtual void pushed(unsigned int firemode) {} 101 virtual void released(unsigned int firemode) {} 100 102 virtual void reload() {} 101 103 -
code/branches/presentationFS16/src/orxonox/worldentities/pawns/Pawn.cc
r11176 r11208 432 432 */ 433 433 434 void Pawn::fired(unsigned int firemode) 435 { 436 if (this->weaponSystem_) 437 this->weaponSystem_->fire(firemode); 434 void Pawn::pushed(unsigned int firemode) 435 { 436 if (this->weaponSystem_) 437 this->weaponSystem_->push(firemode); 438 } 439 440 void Pawn::released(unsigned int firemode) 441 { 442 if (this->weaponSystem_) 443 this->weaponSystem_->release(firemode); 438 444 } 439 445 -
code/branches/presentationFS16/src/orxonox/worldentities/pawns/Pawn.h
r11176 r11208 157 157 virtual void kill(); 158 158 159 virtual void fired(unsigned int firemode) override; 159 virtual void pushed(unsigned int firemode) override; 160 virtual void released(unsigned int firemode) override; 160 161 virtual void postSpawn(); 161 162 -
code/branches/presentationFS16/src/orxonox/worldentities/pawns/Spectator.cc
r11071 r11208 42 42 namespace orxonox 43 43 { 44 extern const std::string __CC_ fire_name;44 extern const std::string __CC_push_name; 45 45 extern const std::string __CC_suicide_name; 46 46 … … 162 162 163 163 // change keybind mode of fire command to OnPress to avoid firing after respawn 164 ModifyConsoleCommand(__CC_ fire_name).keybindMode(KeybindMode::OnPress);164 ModifyConsoleCommand(__CC_push_name).keybindMode(KeybindMode::OnPress); 165 165 166 166 // disable suicide … … 177 177 // change fire command to a helper function and change keybind mode to OnPress 178 178 // as soon as the player releases and presses the button again, the helper function will be called which changes the keybind mode back to OnHold 179 ModifyConsoleCommand(__CC_ fire_name).pushFunction(&Spectator::resetFireCommand).keybindMode(KeybindMode::OnPress);179 ModifyConsoleCommand(__CC_push_name).pushFunction(&Spectator::resetFireCommand).keybindMode(KeybindMode::OnPress); 180 180 181 181 // enable suicide … … 188 188 void Spectator::resetFireCommand(unsigned int firemode) 189 189 { 190 ModifyConsoleCommand(__CC_ fire_name).popFunction().keybindMode(KeybindMode::OnHold); // pop this helper function and change keybind mode191 192 CommandExecutor::execute(__CC_ fire_name + " " + multi_cast<std::string>(firemode)); // call the fire command again, this time with the real function190 ModifyConsoleCommand(__CC_push_name).popFunction().keybindMode(KeybindMode::OnHold); // pop this helper function and change keybind mode 191 192 CommandExecutor::execute(__CC_push_name + " " + multi_cast<std::string>(firemode)); // call the fire command again, this time with the real function 193 193 } 194 194 … … 229 229 } 230 230 231 void Spectator:: fired(unsigned int firemode)231 void Spectator::pushed(unsigned int firemode) 232 232 { 233 233 if (this->getPlayer()) -
code/branches/presentationFS16/src/orxonox/worldentities/pawns/Spectator.h
r9667 r11208 54 54 virtual void rotateRoll(const Vector2& value); 55 55 56 virtual void fired(unsigned int firemode);56 virtual void pushed(unsigned int firemode); 57 57 virtual void greet(); 58 58 virtual void mouseLook() {}
Note: See TracChangeset
for help on using the changeset viewer.