Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8896 for code/branches/hud/src


Ignore:
Timestamp:
Oct 19, 2011, 4:16:25 PM (13 years ago)
Author:
mspaling
Message:

Names for RadarViewablese added for later use in HUD

Location:
code/branches/hud/src
Files:
4 edited

Legend:

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

    r8858 r8896  
    192192                outOfView = pos.x < -1.0 || pos.x > 1.0 || pos.y < -1.0 || pos.y > 1.0;
    193193            // Get Distance to HumanController and save it in the TextAreaOverlayElement.
    194             it->second.text_->setCaption ( multi_cast<std::string> ( dist ) );
     194            //it->second.text_->setCaption ( multi_cast<std::string> ( dist ) );
     195                        it->second.text_->setCaption(it->first->getRVName());
    195196
    196197            if ( outOfView )
  • code/branches/hud/src/orxonox/infos/PlayerInfo.cc

    r8706 r8896  
    3636#include "worldentities/ControllableEntity.h"
    3737#include "controllers/Controller.h"
     38#include "worldentities/pawns/SpaceShip.h"
    3839
    3940namespace orxonox
     
    189190
    190191        this->changedControllableEntity();
     192
     193                SpaceShip* spaceship = dynamic_cast<SpaceShip*>(entity);
     194                if (spaceship != NULL)
     195                {
     196                        spaceship->setRVName(this->getName());
     197                }
    191198    }
    192199
  • code/branches/hud/src/orxonox/interfaces/RadarViewable.cc

    r8858 r8896  
    5151        , radarObjectDescription_("staticObject")
    5252        , scale_(1.0f)
     53                , RVName("")
    5354    {
    5455        RegisterRootObject(RadarViewable);
  • code/branches/hud/src/orxonox/interfaces/RadarViewable.h

    r8738 r8896  
    6060        RadarViewable(BaseObject* creator, const WorldEntity* wePtr);
    6161        virtual ~RadarViewable();
     62
     63                virtual void setRVName(std::string name)
     64                        {
     65                                if (this->RVName != name)
     66                                {
     67                                        this->RVName = name;
     68                                        this->settingsChanged();
     69                                }
     70                        }
     71
     72                std::string getRVName() const
     73                        { return this->RVName; }
    6274
    6375        inline void setRadarObjectCamouflage(float camouflage)
     
    152164        ColourValue radarObjectColour_;
    153165        float scale_;
     166                std::string RVName;
    154167    };
    155168}
Note: See TracChangeset for help on using the changeset viewer.