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…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.