Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2011, 12:35:33 AM (13 years ago)
Author:
jo
Message:

Repairing the radar.

File:
1 edited

Legend:

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

    r8988 r8993  
    7676
    7777    // Set default values
    78     setFont ( "Monofur" );
    79     setTextSize ( 0.05f );
    80     setNavMarkerSize ( 0.05f );
     78    this->setFont ( "Monofur" );
     79    this->setTextSize ( 0.05f );
     80    this->setNavMarkerSize ( 0.05f );
     81    this->setDetectionLimit( 10000.0f );
    8182}
    8283
     
    100101    XMLPortParam ( HUDNavigation, "textSize",      setTextSize,      getTextSize,      xmlelement, mode );
    101102    XMLPortParam ( HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode );
     103    XMLPortParam ( HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode );
    102104}
    103105
     
    175177
    176178    unsigned int markerCount_ = 0;
     179    bool closeEnough_ = false; //only display objects that are close enough to be relevant for the player
    177180
    178181//         for (ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); ++it)
     
    180183    {
    181184        ObjectMap::iterator it = activeObjectList_.find ( listIt->first );
    182 
    183         if ( markerCount_ < markerLimit_ )
     185        closeEnough_ = listIt->second < detectionLimit_ ;
     186        // display radarviewables on HUD if the marker limit and max-distance is not exceeded
     187        if ( markerCount_ < markerLimit_ && (closeEnough_ ||  detectionLimit_ < 0) )
    184188        {
    185189
     
    307311            it->second.text_->show();
    308312        }
    309         else
     313        else // do not display on HUD
    310314        {
    311315            it->second.panel_->hide();
Note: See TracChangeset for help on using the changeset viewer.