Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 20, 2011, 4:53:43 PM (14 years ago)
Author:
bknecht
Message:

The boost bar is now flashing red when the boost is cooling down. However the solution in OrxonoxOverlay is a bit questionable and could probably be solved less hacky…

Location:
code/branches/hudimprovements/src/modules/overlays/hud
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hudimprovements/src/modules/overlays/hud/HUDBar.cc

    r7801 r7932  
    2626 *      Fabian 'x3n' Landau
    2727 *      Reto Grieder
     28 *      Benjamin Knecht
    2829 *
    2930 */
  • code/branches/hudimprovements/src/modules/overlays/hud/HUDBar.h

    r7401 r7932  
    2626 *      Fabian 'x3n' Landau
    2727 *      Reto Grieder
     28 *      Benjamin Knecht
    2829 *
    2930 */
  • code/branches/hudimprovements/src/modules/overlays/hud/HUDBoostBar.cc

    r7923 r7932  
    4343
    4444        this->owner_ = 0;
     45        this->flashInterval_ = 0.25f;
     46        this->flashDt_ = 0.0f;
    4547    }
    4648
     
    5557        if (this->owner_)
    5658        {
    57             this->show();
     59            if (this->owner_->isBoostCoolingDown())
     60            {
     61                this->setBackgroundColour(ColourValue(0.7f, 0.2f, 0.2f));
     62                if (this->flashDt_ <= 0.0f)
     63                {
     64                    this->flashDt_ = this->flashInterval_;
     65                    this->setVisible(!this->isVisible());
     66                }
     67                else
     68                    this->flashDt_ -= dt;
     69            }
     70            else
     71            {
     72                this->flashDt_ = 0.0f;
     73                this->show();
     74                this->setBackgroundColour(ColourValue(0.2f, 0.7f, 0.2f));
     75            }
     76
    5877            float value = this->owner_->getBoostPower() / this->owner_->getInitialBoostPower();
    5978            this->setValue(value);
  • code/branches/hudimprovements/src/modules/overlays/hud/HUDBoostBar.h

    r7920 r7932  
    4747
    4848    private:
    49         SpaceShip* owner_;
     49        SpaceShip*  owner_;
     50        float       flashInterval_;
     51        float       flashDt_;
    5052    };
    5153}
Note: See TracChangeset for help on using the changeset viewer.