Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10122


Ignore:
Timestamp:
Nov 12, 2014, 4:08:14 PM (9 years ago)
Author:
aejonas
Message:

health bar is now under the spaceship while moving

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

Legend:

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

    r10110 r10122  
    8282        this->setNavMarkerSize(0.03f);
    8383        this->setAimMarkerSize(0.02f);
     84        this->setHealthMarkerSize(0.08f);
    8485
    8586        this->setDetectionLimit(10000.0f);
     
    116117        XMLPortParam(HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode);
    117118        XMLPortParam(HUDNavigation, "aimMarkerSize", setAimMarkerSize, getAimMarkerSize, xmlelement, mode);
     119        XMLPortParam(HUDNavigation, "healthMarkerSize", setHealthMarkerSize, getHealthMarkerSize, xmlelement, mode);
     120
    118121    }
    119122
     
    206209        for (std::list<std::pair<RadarViewable*, unsigned int> >::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++markerCount, ++listIt)
    207210        {
     211
    208212            std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.find(listIt->first);
    209213            closeEnough = listIt->second < this->detectionLimit_;
     
    273277                    }
    274278                }
     279
     280
    275281
    276282
     
    358364                    // Object is in view
    359365
    360                     // Change material only if outOfView changed
     366
     367
     368
     369
     370
     371                        // Change material only if outOfView changed
    361372                    if (it->second.wasOutOfView_)
    362373                    {
     
    367378
    368379                        //manipulation bzw versuch !!! Jonas
    369                         it->second.health_->setMaterialName(TextureGenerator::getMaterialName("bar2b.png", it->first->getRadarObjectColour()));
     380                        it->second.health_->setMaterialName(TextureGenerator::getMaterialName("bar2.png", it->first->getRadarObjectColour()));
     381                        it->second.health_->setDimensions(this->healthMarkerSize_ * this->getActualSize().x, this->healthMarkerSize_ * this->getActualSize().y);
    370382
    371383                        it->second.wasOutOfView_ = false;
    372384                    }
    373385
     386
     387                    //i need to find the place where the amount of health is saved!!!
     388                    //this->selectedTarget_->getWorldEntity()->
     389
     390
    374391                    // Position health (versuch !!!!)
     392                    it->second.health_->setUV(0.0f, 0.0f, 1.0f, 1.0f);
    375393                    it->second.health_->setLeft((pos.x + 1.0f - it->second.panel_->getWidth()) * 0.5f);
    376394                    it->second.health_->setTop((-pos.y + 1.0f - it->second.panel_->getHeight()) * 0.5f);
     
    431449
    432450            {
    433                 it->second.health_->hide()
     451                it->second.health_->hide();
    434452                it->second.panel_->hide();
    435453                it->second.text_->hide();
     
    487505                        .createOverlayElement("Panel", "HUDNavigation_healthMarker_" + getUniqueNumberString()));
    488506                //panel->setMaterialName("Orxonox/NavTDC");
    489                 health->setMaterialName(TextureGenerator::getMaterialName("bar2b.png", object->getRadarObjectColour()));
     507                health->setMaterialName(TextureGenerator::getMaterialName("bar2.png", object->getRadarObjectColour()));
    490508                health->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);
    491509                //panel->setColour(object->getRadarObjectColour());
     
    519537
    520538        ObjectInfo tempStruct =
    521         {   health, panel, target, text, false, false, false, false};
     539        {   health, panel, target, text, false, false, false};
    522540        this->activeObjectList_[object] = tempStruct;
    523541
  • code/branches/hudHS14/src/modules/overlays/hud/HUDNavigation.h

    r10110 r10122  
    7878            {
    7979
    80                 //manipulation bzw versuch !!! Jonas
     80                //manipulation bzw versuch !!! health additional
    8181                Ogre::PanelOverlayElement* health_;
    82 
    8382                Ogre::PanelOverlayElement* panel_;
    8483                Ogre::PanelOverlayElement* target_;
     
    9291
    9392            // XMLPort accessors
     93            inline void setHealthMarkerSize(float size)
     94                        {
     95                            this->healthMarkerSize_ = size;
     96                            this->sizeChanged();
     97                        }
     98            inline float getHealthMarkerSize() const
     99                                { return healthMarkerSize_; }
     100
    94101            inline void setNavMarkerSize(float size)
    95102            {
     
    104111                this->sizeChanged();
    105112            }
     113
    106114            inline float getAimMarkerSize() const
    107115                { return aimMarkerSize_; }
     
    125133            std::list<std::pair<RadarViewable*, unsigned int> > sortedObjectList_;
    126134
     135            float healthMarkerSize_;
    127136            float navMarkerSize_;
    128137            float aimMarkerSize_;
Note: See TracChangeset for help on using the changeset viewer.