Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9484


Ignore:
Timestamp:
Dec 3, 2012, 3:57:02 PM (11 years ago)
Author:
mottetb
Message:

hallo

Location:
code/branches/spaceNavigation/src/modules/overlays/hud
Files:
2 edited

Legend:

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

    r9471 r9484  
    216216                }
    217217
    218 
    219218                // Selected object
    220219                if(this->closestTarget_) {
     
    223222                    {
    224223                        it->second.selected_ = true;
    225                     } else {
     224                        orxout() << "Closest object selected" << std::endl;
     225                    }
     226                    else if(it->second.selected_)
     227                    {
    226228                        it->second.selected_ = false;
    227                     }
    228                     closestTarget_ = false;
    229                     orxout() << "Closest object selected" << std::endl;
    230                 }
     229                        orxout() << "Previous object unselected" << std::endl;
     230                    }
     231
     232                }
     233                // select the next closest object
    231234                else if(this->nextTarget_)
    232235                {
    233                     // select the next closest object
    234236                    if(nextHasToBeSelected){
    235237                        it->second.selected_ = true;
    236238                        nextHasToBeSelected = false;
    237                         this->nextTarget_ = false;
     239                        orxout() << "Next object selected" << std::endl;
    238240                    }
    239241                    else if(it->second.selected_)
     
    241243                        nextHasToBeSelected = true;
    242244                        it->second.selected_ = false;
    243                     }
    244                     else if(markerCount + 1 >= markerLimit_)
    245                     {
    246                         // this object is the last one that is marked, then select the closest
    247                         this->activeObjectList_.find(this->sortedObjectList_.begin()->first)->second.selected_ = true;
    248                         nextHasToBeSelected = false;
    249                     }
     245                        orxout() << "Previous object unselected" << std::endl;
     246
     247                        listIt++;
     248
     249                        if (markerCount + 1 >= this->markerLimit_ ||
     250                                (listIt->second > this->detectionLimit_
     251                                && detectionLimit_ >= 0))
     252                        {
     253                            this->activeObjectList_.find(this->sortedObjectList_.begin()->first)->second.selected_ = true;
     254                            nextHasToBeSelected = false;
     255                        }
     256
     257                        listIt--;
     258                    }
     259
     260
    250261                }
    251262
     
    398409            }
    399410        }
     411
     412        this->closestTarget_ = false;
     413        this->nextTarget_ = false;
    400414    }
    401415
  • code/branches/spaceNavigation/src/modules/overlays/hud/HUDNavigation.h

    r9472 r9484  
    130130            bool nextTarget_;
    131131
    132             static const float LIGHTNING_GUN_SPEED_ = 700.0f;
    133             static const float HSW01_SPEED_ = 2500.0f;
    134132            static HUDNavigation* localHUD_s; //!< This is used as a filter. Only the local HUD should be influenced by the static Console Command functions.
    135133
Note: See TracChangeset for help on using the changeset viewer.