Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 26, 2016, 4:53:34 PM (9 years ago)
Author:
fvultier
Message:

merged discharger, thats the last one

Location:
code/branches/presentationFS16
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentationFS16

  • code/branches/presentationFS16/src/orxonox/worldentities/pawns/Pawn.cc

    r11176 r11208  
    432432    */
    433433
    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);
    438444    }
    439445
  • code/branches/presentationFS16/src/orxonox/worldentities/pawns/Pawn.h

    r11176 r11208  
    157157            virtual void kill();
    158158
    159             virtual void fired(unsigned int firemode) override;
     159            virtual void pushed(unsigned int firemode) override;
     160            virtual void released(unsigned int firemode) override;
    160161            virtual void postSpawn();
    161162
  • code/branches/presentationFS16/src/orxonox/worldentities/pawns/Spectator.cc

    r11071 r11208  
    4242namespace orxonox
    4343{
    44     extern const std::string __CC_fire_name;
     44    extern const std::string __CC_push_name;
    4545    extern const std::string __CC_suicide_name;
    4646
     
    162162
    163163        // 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);
    165165
    166166        // disable suicide
     
    177177        // change fire command to a helper function and change keybind mode to OnPress
    178178        // 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);
    180180
    181181        // enable suicide
     
    188188    void Spectator::resetFireCommand(unsigned int firemode)
    189189    {
    190         ModifyConsoleCommand(__CC_fire_name).popFunction().keybindMode(KeybindMode::OnHold); // pop this helper function and change keybind mode
    191 
    192         CommandExecutor::execute(__CC_fire_name + " " + multi_cast<std::string>(firemode)); // call the fire command again, this time with the real function
     190        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
    193193    }
    194194
     
    229229    }
    230230
    231     void Spectator::fired(unsigned int firemode)
     231    void Spectator::pushed(unsigned int firemode)
    232232    {
    233233        if (this->getPlayer())
  • code/branches/presentationFS16/src/orxonox/worldentities/pawns/Spectator.h

    r9667 r11208  
    5454            virtual void rotateRoll(const Vector2& value);
    5555
    56             virtual void fired(unsigned int firemode);
     56            virtual void pushed(unsigned int firemode);
    5757            virtual void greet();
    5858            virtual void mouseLook() {}
Note: See TracChangeset for help on using the changeset viewer.