Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 27, 2010, 3:58:24 PM (14 years ago)
Author:
sfluecki
Message:

Final changes in HUDNavigation. marker are now working and are limitable by setting markerLimit in HUDNavigation.h -mission accomplished-

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3/src/modules/overlays/hud/HUDNavigation.h

    r6942 r6971  
    3535#include <string>
    3636
     37
    3738#include "util/OgreForwardRefs.h"
    3839#include "tools/interfaces/Tickable.h"
     
    4243namespace orxonox
    4344{
    44     class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable, public RadarListener
     45class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable, public RadarListener
     46{
     47public:
     48    HUDNavigation ( BaseObject* creator );
     49    virtual ~HUDNavigation();
     50
     51    virtual void XMLPort ( Element& xmlElement, XMLPort::Mode mode );
     52    virtual void tick ( float dt );
     53
     54    virtual void addObject ( RadarViewable* object );
     55    virtual void removeObject ( RadarViewable* viewable );
     56    virtual void objectChanged ( RadarViewable* viewable ) {}
     57
     58    virtual void changedOwner();
     59    virtual void sizeChanged();
     60    virtual void angleChanged() { }
     61    virtual void positionChanged() { }
     62    virtual void radarTick ( float dt ) {}
     63
     64    inline float getRadarSensitivity() const
     65    { return 1.0f; }
     66
     67private:
     68    struct ObjectInfo
    4569    {
    46     public:
    47         HUDNavigation(BaseObject* creator);
    48         virtual ~HUDNavigation();
     70        Ogre::PanelOverlayElement* panel_;
     71        Ogre::TextAreaOverlayElement* text_;
     72        bool outOfView_;
     73        bool wasOutOfView_;
    4974
    50         virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
    51         virtual void tick(float dt);
     75    };
    5276
    53         virtual void addObject(RadarViewable* object);
    54         virtual void removeObject(RadarViewable* viewable);
    55         virtual void objectChanged(RadarViewable* viewable) {}
     77    // XMLPort accessors
     78    void setNavMarkerSize ( float size )
     79    { navMarkerSize_ = size; this->sizeChanged(); }
     80    float getNavMarkerSize() const
     81    { return navMarkerSize_; }
    5682
    57         virtual void changedOwner();
    58         virtual void sizeChanged();
    59         virtual void angleChanged() { }
    60         virtual void positionChanged() { }
    61         virtual void radarTick(float dt) {}
     83    void setTextSize ( float size );
     84    float getTextSize() const;
    6285
    63         inline float getRadarSensitivity() const
    64             { return 1.0f; }
     86    void setFont ( const std::string& font );
     87    const std::string& getFont() const;
    6588
    66     private:
    67         struct ObjectInfo
    68         {
    69             Ogre::PanelOverlayElement* panel_;
    70             Ogre::TextAreaOverlayElement* text_;
    71             bool outOfView_;
    72             bool wasOutOfView_;
    73         };
     89    typedef std::map<RadarViewable*, ObjectInfo > ObjectMap;
     90    ObjectMap activeObjectList_;
    7491
    75         // XMLPort accessors
    76         void setNavMarkerSize(float size)
    77             { navMarkerSize_ = size; this->sizeChanged(); }
    78         float getNavMarkerSize() const
    79             { return navMarkerSize_; }
     92    typedef std::list < std::pair<RadarViewable*, unsigned int > > sortedList;
     93    sortedList sortedObjectList_;
    8094
    81         void setTextSize(float size);
    82         float getTextSize() const;
    8395
    84         void setFont(const std::string& font);
    85         const std::string& getFont() const;
     96    float navMarkerSize_;
     97    std::string fontName_;
     98    float textSize_;
    8699
    87         typedef std::map<RadarViewable*, ObjectInfo > ObjectMap;
    88         ObjectMap activeObjectList_;
     100    static const unsigned int markerLimit_ = 5; //TODO: is it possible to set this over the console and/or the IG-Setting
    89101
    90         float navMarkerSize_;
    91         std::string fontName_;
    92         float textSize_;
    93     };
     102
     103};
    94104}
    95105
Note: See TracChangeset for help on using the changeset viewer.