[Orxonox-commit 4225] r8896 - in code/branches/hud/src: modules/overlays/hud orxonox/infos orxonox/interfaces
mspaling at orxonox.net
mspaling at orxonox.net
Wed Oct 19 16:16:25 CEST 2011
Author: mspaling
Date: 2011-10-19 16:16:25 +0200 (Wed, 19 Oct 2011)
New Revision: 8896
Modified:
code/branches/hud/src/modules/overlays/hud/HUDNavigation.cc
code/branches/hud/src/orxonox/infos/PlayerInfo.cc
code/branches/hud/src/orxonox/interfaces/RadarViewable.cc
code/branches/hud/src/orxonox/interfaces/RadarViewable.h
Log:
Names for RadarViewablese added for later use in HUD
Modified: code/branches/hud/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/branches/hud/src/modules/overlays/hud/HUDNavigation.cc 2011-10-13 18:59:27 UTC (rev 8895)
+++ code/branches/hud/src/modules/overlays/hud/HUDNavigation.cc 2011-10-19 14:16:25 UTC (rev 8896)
@@ -191,7 +191,8 @@
else
outOfView = pos.x < -1.0 || pos.x > 1.0 || pos.y < -1.0 || pos.y > 1.0;
// Get Distance to HumanController and save it in the TextAreaOverlayElement.
- it->second.text_->setCaption ( multi_cast<std::string> ( dist ) );
+ //it->second.text_->setCaption ( multi_cast<std::string> ( dist ) );
+ it->second.text_->setCaption(it->first->getRVName());
if ( outOfView )
{
Modified: code/branches/hud/src/orxonox/infos/PlayerInfo.cc
===================================================================
--- code/branches/hud/src/orxonox/infos/PlayerInfo.cc 2011-10-13 18:59:27 UTC (rev 8895)
+++ code/branches/hud/src/orxonox/infos/PlayerInfo.cc 2011-10-19 14:16:25 UTC (rev 8896)
@@ -35,6 +35,7 @@
#include "gametypes/Gametype.h"
#include "worldentities/ControllableEntity.h"
#include "controllers/Controller.h"
+#include "worldentities/pawns/SpaceShip.h"
namespace orxonox
{
@@ -188,6 +189,12 @@
this->controller_->setControllableEntity(entity);
this->changedControllableEntity();
+
+ SpaceShip* spaceship = dynamic_cast<SpaceShip*>(entity);
+ if (spaceship != NULL)
+ {
+ spaceship->setRVName(this->getName());
+ }
}
void PlayerInfo::stopControl()
Modified: code/branches/hud/src/orxonox/interfaces/RadarViewable.cc
===================================================================
--- code/branches/hud/src/orxonox/interfaces/RadarViewable.cc 2011-10-13 18:59:27 UTC (rev 8895)
+++ code/branches/hud/src/orxonox/interfaces/RadarViewable.cc 2011-10-19 14:16:25 UTC (rev 8896)
@@ -50,6 +50,7 @@
, radarObjectShape_(Dot)
, radarObjectDescription_("staticObject")
, scale_(1.0f)
+ , RVName("")
{
RegisterRootObject(RadarViewable);
Modified: code/branches/hud/src/orxonox/interfaces/RadarViewable.h
===================================================================
--- code/branches/hud/src/orxonox/interfaces/RadarViewable.h 2011-10-13 18:59:27 UTC (rev 8895)
+++ code/branches/hud/src/orxonox/interfaces/RadarViewable.h 2011-10-19 14:16:25 UTC (rev 8896)
@@ -60,6 +60,18 @@
RadarViewable(BaseObject* creator, const WorldEntity* wePtr);
virtual ~RadarViewable();
+ virtual void setRVName(std::string name)
+ {
+ if (this->RVName != name)
+ {
+ this->RVName = name;
+ this->settingsChanged();
+ }
+ }
+
+ std::string getRVName() const
+ { return this->RVName; }
+
inline void setRadarObjectCamouflage(float camouflage)
{
if( this->radarObjectCamouflage_ != camouflage )
@@ -151,6 +163,7 @@
std::string radarObjectDescription_;
ColourValue radarObjectColour_;
float scale_;
+ std::string RVName;
};
}
More information about the Orxonox-commit
mailing list