Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6444 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Jan 8, 2006, 10:45:03 PM (19 years ago)
Author:
bensch
Message:

trunk: sliders get updated, as they should be

Location:
trunk/src/world_entities
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/playable.cc

    r6443 r6444  
    5252
    5353  if (this->currentPlayer != NULL)
    54       this->currentPlayer->weaponConfigChanged();
     54    this->currentPlayer->weaponConfigChanged();
    5555}
    5656
     
    5959  this->weaponMan->removeWeapon(weapon);
    6060
     61  if (this->currentPlayer != NULL)
     62    this->currentPlayer->weaponConfigChanged();
     63}
     64
     65void Playable::nextWeaponConfig()
     66{
     67  this->weaponMan->nextWeaponConfig();
     68  if (this->currentPlayer != NULL)
     69    this->currentPlayer->weaponConfigChanged();
     70}
     71
     72void Playable::previousWeaponConfig()
     73{
     74  this->weaponMan->previousWeaponConfig();
    6175  if (this->currentPlayer != NULL)
    6276    this->currentPlayer->weaponConfigChanged();
     
    154168void  Playable::attachCamera()
    155169{
    156        State::getCamera()->setParentSoft(this);
    157        State::getCameraTarget()->setParentSoft(this);
     170  State::getCamera()->setParentSoft(this);
     171  State::getCameraTarget()->setParentSoft(this);
    158172
    159173}
     
    162176void  Playable::detachCamera()
    163177{
    164 
    165 
    166178}
  • trunk/src/world_entities/playable.h

    r6443 r6444  
    1111#include <list>
    1212
     13#include "world_entities/weapons/weapon_manager.h"
    1314
    1415class Weapon;
    15 class WeaponManager;
     16
    1617class Player;
    1718
     
    3132    void addWeapon(Weapon* weapon, int configID = -1, int slotID = -1);
    3233    void removeWeapon(Weapon* weapon);
     34    void nextWeaponConfig();
     35    void previousWeaponConfig();
    3336
    3437    inline WeaponManager* getWeaponManager() const { return this->weaponMan; };
  • trunk/src/world_entities/space_ships/space_ship.cc

    r6443 r6444  
    434434  else if( event.type == KeyMapper::PEV_NEXT_WEAPON && event.bPressed)
    435435  {
    436     this->getWeaponManager()->nextWeaponConfig();//if( !event.bPressed) this->bWeaponChange = !this->bWeaponChange;
     436    this->nextWeaponConfig();//if( !event.bPressed) this->bWeaponChange = !this->bWeaponChange;
    437437  }
    438438  else if ( event.type == KeyMapper::PEV_PREVIOUS_WEAPON && event.bPressed)
    439     this->getWeaponManager()->previousWeaponConfig();
     439    this->previousWeaponConfig();
    440440  else if( event.type == SDLK_w)
    441441    this->bUp = event.bPressed; //this->shiftCoor(0,.1,0);
  • trunk/src/world_entities/weapons/weapon.cc

    r6439 r6444  
    421421    if (likely(this->soundBuffers[WA_ACTIVATE] != NULL))
    422422      this->soundSource->play(this->soundBuffers[WA_ACTIVATE]);
     423    this->updateWidgets();
    423424    // activate
    424425    PRINTF(4)("Activating the Weapon %s\n", this->getName());
     
    482483    if (this->soundBuffers[WA_SHOOT] != NULL)
    483484      this->soundSource->play(this->soundBuffers[WA_SHOOT]);
     485    this->updateWidgets();
    484486    // fire
    485487    this->energyLoaded -= this->minCharge;
     
    526528    this->energy -= chargeSize;
    527529  }
     530
     531  this->updateWidgets();
    528532  this->reload();
    529533  this->enterState(WS_RELOADING);
  • trunk/src/world_entities/weapons/weapon_manager.h

    r6442 r6444  
    99 * @TODO 1. WeaponManager should also handle a List of availiableWeapons.
    1010 */
     11
     12#ifndef _WEAPON_MANAGER_H
     13#define _WEAPON_MANAGER_H
    1114
    1215#include "base_object.h"
     
    7073    void addWeapon(Weapon* weapon, int configID = -1, int slotID = -1);
    7174    void removeWeapon(Weapon* weapon, int configID = -1);
    72     Weapon* getWeapon(int slotID) const { return (slotID >= 0 && slotID < this->slotCount)? this->currentSlotConfig[slotID].currentWeapon: NULL; };
     75    Weapon* getWeapon(int slotID) const { return (slotID >= 0 && slotID < this->slotCount)? this->currentSlotConfig[slotID].nextWeapon: NULL; };
    7376
    7477    // FIXME ::
     
    109112    tAnimation<Crosshair>*  crossHairSizeAnim;                        //!< An animation for the crosshair (scaling)
    110113};
     114
     115
     116#endif /* _WEAPON_MANAGER_H */
Note: See TracChangeset for help on using the changeset viewer.