- Timestamp:
- Sep 4, 2011, 3:15:41 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ai2/src/modules/overlays/hud/HUDNavigation.cc
r8706 r8874 63 63 { 64 64 SetConfigValue(markerLimit_, 3); 65 65 66 } 66 67 … … 77 78 setTextSize ( 0.05f ); 78 79 setNavMarkerSize ( 0.05f ); 80 setDetectionLimit( 10000.0f ); 79 81 } 80 82 … … 95 97 SUPER ( HUDNavigation, XMLPort, xmlelement, mode ); 96 98 97 XMLPortParam ( HUDNavigation, "font", setFont, getFont, xmlelement, mode ); 98 XMLPortParam ( HUDNavigation, "textSize", setTextSize, getTextSize, xmlelement, mode ); 99 XMLPortParam ( HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode ); 99 XMLPortParam ( HUDNavigation, "font", setFont, getFont, xmlelement, mode ); 100 XMLPortParam ( HUDNavigation, "textSize", setTextSize, getTextSize, xmlelement, mode ); 101 XMLPortParam ( HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode ); 102 XMLPortParam ( HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode ); 100 103 } 101 104 … … 161 164 162 165 unsigned int markerCount_ = 0; 163 166 bool closeEnough_ = false; //inly display objects that are close enough to be relevant for the player 164 167 // for (ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); ++it) 165 168 for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++markerCount_, ++listIt ) 166 169 { 167 170 ObjectMap::iterator it = activeObjectList_.find ( listIt->first ); 168 169 if ( markerCount_ < markerLimit_ ) 171 if( detectionLimit_ < 0 ) 172 closeEnough_ = true ; 173 else 174 closeEnough_ = listIt->second < detectionLimit_ ; 175 if ( markerCount_ < markerLimit_ && closeEnough_ ) // display on HUD íf statement is true 170 176 { 171 177 … … 277 283 it->second.text_->show(); 278 284 } 279 else 285 else // do not display on HUD 280 286 { 281 287 it->second.panel_->hide(); … … 309 315 void HUDNavigation::addObject ( RadarViewable* object ) 310 316 { 311 if( showObject(object) ==false )317 if( showObject(object) == false ) 312 318 return; 313 319 … … 396 402 return false; 397 403 assert( rv->getWorldEntity() ); 398 if ( rv->getWorldEntity()->isVisible() ==false || rv->getRadarVisibility()==false )404 if ( rv->getWorldEntity()->isVisible() == false || rv->getRadarVisibility() == false ) 399 405 return false; 400 406 return true;
Note: See TracChangeset
for help on using the changeset viewer.