Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 24, 2015, 10:51:18 PM (9 years ago)
Author:
fvultier
Message:

There is now a HUD that shows the status of the weapon system: all weapons, weapon modes and their munition. Progress bars show the progress of replenishing munition.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponMode.cc

    r10650 r10688  
    7575        this->muzzleOrientation_ = Quaternion::IDENTITY;
    7676
     77        hudImageString_ = "WSHUD_WM_Unknown";
     78
    7779        if( GameMode::isMaster() )
    7880        {
     
    125127            this->bSoundAttached_ = true;
    126128        }
    127 
     129       
     130        // Fireing is only possible if this weapon mode is not reloading and there is enough munition
    128131        if (!this->bReloading_ && this->munition_ && this->munition_->takeMunition(this->munitionPerShot_, this))
    129132        {
     
    134137                if (this->munition_->reload(this))
    135138                {
     139                    // If true, the weapon reloads in parallel to the magazine reloading
    136140                    if (this->bParallelReload_)
     141                    {
     142                        // The time needed to reload is the maximum of the reload time of the weapon mode and the magazine.
    137143                        tempReloadtime = std::max(this->reloadTime_, this->munition_->getReloadTime());
     144                    }                       
    138145                    else
     146                    {
     147                        // The time needed to reload is the sum of the reload time of the weapon mode and the magazine.
    139148                        tempReloadtime = this->reloadTime_ + this->munition_->getReloadTime();
     149                    }                       
    140150                }
    141151            }
    142152
     153            // Mark this weapon mode as reloading and start the reload timer
    143154            this->bReloading_ = true;
    144155            this->reloadTimer_.setInterval(tempReloadtime);
     
    283294    }
    284295
    285     void WeaponMode::setDefaultSoundWithVolume(const std::string& soundPath, const float soundVolume){
    286         if (this->defSndWpnFire_) {
     296    void WeaponMode::setDefaultSoundWithVolume(const std::string& soundPath, const float soundVolume)
     297    {
     298        if (this->defSndWpnFire_)
     299        {
    287300            this->defSndWpnFire_->setSource(soundPath);
    288301            this->defSndWpnFire_->setVolume(soundVolume);
Note: See TracChangeset for help on using the changeset viewer.