Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10240


Ignore:
Timestamp:
Feb 1, 2015, 8:52:31 PM (5 years ago)
Author:
landauf
Message:

replaced tabs with spaces. no changes in code.

Location:
code/branches/hudHS14/src/modules/overlays/hud
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hudHS14/src/modules/overlays/hud/HUDNavigation.cc

    r10239 r10240  
    306306                    if (!it->second.wasOutOfView_)
    307307                    {
    308                         it->second.health_->hide();
    309                         it->second.healthLevel_->hide();
    310                         it->second.panel_->setMaterialName(TextureGenerator::getMaterialName("arrows.png", it->first->getRadarObjectColour()));
     308                        it->second.health_->hide();
     309                        it->second.healthLevel_->hide();
     310                        it->second.panel_->setMaterialName(TextureGenerator::getMaterialName("arrows.png", it->first->getRadarObjectColour()));
    311311                        it->second.wasOutOfView_ = true;
    312312                        it->second.target_->hide();
     
    370370
    371371
    372                         //calculate the health of the actual selected radarViewable (relativHealthScale: while (0) is no health left, (1) is the initial health)
     372                    //calculate the health of the actual selected radarViewable (relativHealthScale: while (0) is no health left, (1) is the initial health)
    373373                    Pawn* pawnPtr = (Pawn*) (it->first->getWorldEntity());
    374374                    float health = pawnPtr->getHealth();
     
    384384
    385385                    if(initHealth < 200)
    386                         HealthLevel = 1;
     386                        HealthLevel = 1;
    387387                    if(200 <= initHealth && initHealth < 500)
    388                         HealthLevel = 2;
     388                        HealthLevel = 2;
    389389                    if(500 <= initHealth && initHealth < 1000)
    390                         HealthLevel = 3;
     390                        HealthLevel = 3;
    391391                    if(1000 <= initHealth && initHealth < 2500)
    392                         HealthLevel = 4;
     392                        HealthLevel = 4;
    393393                    if(2500 <= initHealth)
    394                         HealthLevel = 5;
    395 
    396 
    397 
    398                         // Change material only if outOfView changed
     394                        HealthLevel = 5;
     395
     396
     397
     398                    // Change material only if outOfView changed
    399399                    if (it->second.wasOutOfView_)
    400400                    {
     
    413413                        // spaceship is still intact there should be at least one part of the bar left.
    414414                        if(1<=discreteHealthScale){
    415                                 it->second.health_->setTiling((float)discreteHealthScale , 1 ,0);
    416                                 it->second.health_->setDimensions(this->healthMarkerSize_ * this->getActualSize().x *0.1f*discreteHealthScale, 0.75f*this->healthMarkerSize_ * this->getActualSize().y);
     415                            it->second.health_->setTiling((float)discreteHealthScale , 1 ,0);
     416                            it->second.health_->setDimensions(this->healthMarkerSize_ * this->getActualSize().x *0.1f*discreteHealthScale, 0.75f*this->healthMarkerSize_ * this->getActualSize().y);
    417417                        }
    418418
     
    510510
    511511            {
    512                 it->second.health_->hide();
     512                it->second.health_->hide();
    513513                it->second.healthLevel_->hide();
    514                 it->second.panel_->hide();
     514                it->second.panel_->hide();
    515515                it->second.text_->hide();
    516516                it->second.target_->hide();
     
    535535        for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end(); ++it)
    536536        {
    537                 if (it->second.health_ != NULL)
    538                     it->second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);
    539                 if (it->second.healthLevel_ != NULL)
    540                         it->second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale);
     537            if (it->second.health_ != NULL)
     538                it->second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);
     539            if (it->second.healthLevel_ != NULL)
     540                it->second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale);
    541541            if (it->second.panel_ != NULL)
    542542                it->second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);
     
    627627        {
    628628            // Detach overlays
    629                 this->background_->removeChild(it->second.health_->getName());
    630                 this->background_->removeChild(it->second.healthLevel_->getName());
     629            this->background_->removeChild(it->second.health_->getName());
     630            this->background_->removeChild(it->second.healthLevel_->getName());
    631631            this->background_->removeChild(it->second.panel_->getName());
    632632            this->background_->removeChild(it->second.target_->getName());
  • code/branches/hudHS14/src/modules/overlays/hud/HUDNavigation.h

    r10163 r10240  
    8080
    8181
    82                 Ogre::PanelOverlayElement* health_;
    83                 Ogre::PanelOverlayElement* healthLevel_;
    84                 Ogre::PanelOverlayElement* panel_;
     82                Ogre::PanelOverlayElement* health_;
     83                Ogre::PanelOverlayElement* healthLevel_;
     84                Ogre::PanelOverlayElement* panel_;
    8585                Ogre::PanelOverlayElement* target_;
    8686                Ogre::TextAreaOverlayElement* text_;
     
    9999                        }
    100100            inline float getHealthMarkerSize() const
    101                                 { return healthMarkerSize_; }
     101                            { return healthMarkerSize_; }
    102102
    103103            inline void setHealthLevelMarkerSize(float size)
     
    107107                                    }
    108108                        inline float getHealthLevelMarkerSize() const
    109                                         { return healthLevelMarkerSize_; }
     109                                        { return healthLevelMarkerSize_; }
    110110
    111111            inline void setNavMarkerSize(float size)
Note: See TracChangeset for help on using the changeset viewer.