[Orxonox-commit 4235] r8906 - in code/branches/hud/src: modules/overlays/hud orxonox/infos orxonox/interfaces

mspaling at orxonox.net mspaling at orxonox.net
Wed Oct 26 16:10:31 CEST 2011


Author: mspaling
Date: 2011-10-26 16:10:30 +0200 (Wed, 26 Oct 2011)
New Revision: 8906

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.h
Log:
names added in hud

Modified: code/branches/hud/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/branches/hud/src/modules/overlays/hud/HUDNavigation.cc	2011-10-26 13:51:06 UTC (rev 8905)
+++ code/branches/hud/src/modules/overlays/hud/HUDNavigation.cc	2011-10-26 14:10:30 UTC (rev 8906)
@@ -172,9 +172,13 @@
 
             // Get Distance to HumanController and save it in the TextAreaOverlayElement.
             int dist = listIt->second;
-            it->second.text_->setCaption ( multi_cast<std::string> ( dist ) );
-            float textLength = multi_cast<std::string> ( dist ).size() * it->second.text_->getCharHeight() * 0.3f;
 
+            //it->second.text_->setCaption ( multi_cast<std::string> ( dist ) ); //display distance next to cursor
+            //float textLength = multi_cast<std::string> ( dist ).size() * it->second.text_->getCharHeight() * 0.3f;
+            
+            it->second.text_->setCaption(it->first->getRVName()); //display name next to cursor
+            float textLength = it->first->getRVName().size() * it->second.text_->getCharHeight() * 0.3f;
+
             // Transform to screen coordinates
             Vector3 pos = camTransform * it->first->getRVWorldPosition();
 
@@ -190,9 +194,6 @@
             }
             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(it->first->getRVName()); //only for test purposes
 
             if ( outOfView )
             {

Modified: code/branches/hud/src/orxonox/infos/PlayerInfo.cc
===================================================================
--- code/branches/hud/src/orxonox/infos/PlayerInfo.cc	2011-10-26 13:51:06 UTC (rev 8905)
+++ code/branches/hud/src/orxonox/infos/PlayerInfo.cc	2011-10-26 14:10:30 UTC (rev 8906)
@@ -170,6 +170,11 @@
         }
 
         this->changedControllableEntity();
+		SpaceShip* spaceship = dynamic_cast<SpaceShip*>(entity);
+        if (spaceship != NULL)
+        {
+            spaceship->setRVName(this->getName());
+        }
     }
 
     void PlayerInfo::startTemporaryControl(ControllableEntity* entity)
@@ -189,12 +194,6 @@
             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.h
===================================================================
--- code/branches/hud/src/orxonox/interfaces/RadarViewable.h	2011-10-26 13:51:06 UTC (rev 8905)
+++ code/branches/hud/src/orxonox/interfaces/RadarViewable.h	2011-10-26 14:10:30 UTC (rev 8906)
@@ -68,7 +68,6 @@
 					this->settingsChanged();
 				}
 			}
-
 		std::string getRVName() const
 			{ return this->RVName; }
 




More information about the Orxonox-commit mailing list