Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/hud/src/modules/overlays/hud/HUDNavigation.h @ 8955

Last change on this file since 8955 was 8955, checked in by mspaling, 13 years ago

worked on EnemyHealthBar

  • Property svn:eol-style set to native
File size: 3.0 KB
RevLine 
[1505]1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
[1454]4 *
[1505]5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
[1454]22 *   Author:
23 *      Felix Schulthess
24 *   Co-authors:
[1590]25 *      Reto Grieder
[8920]26 *      Matthias Spalinger
[1454]27 *
28 */
[1393]29
[1601]30#ifndef _HUDNavigation_H__
31#define _HUDNavigation_H__
[1393]32
[5693]33#include "overlays/OverlaysPrereqs.h"
[1410]34
[7163]35#include <map>
36#include <string>
37
38
[3196]39#include "util/OgreForwardRefs.h"
[5693]40#include "tools/interfaces/Tickable.h"
[7163]41#include "interfaces/RadarListener.h"
[1601]42#include "overlays/OrxonoxOverlay.h"
[1393]43
44namespace orxonox
45{
[7163]46class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable, public RadarListener
47{
48public:
49    HUDNavigation ( BaseObject* creator );
50    virtual ~HUDNavigation();
51
52    void setConfigValues();
53
[7401]54    virtual void XMLPort ( Element& xmlelement, XMLPort::Mode mode );
[7163]55    virtual void tick ( float dt );
56
57    virtual void addObject ( RadarViewable* object );
58    virtual void removeObject ( RadarViewable* viewable );
59    virtual void objectChanged ( RadarViewable* viewable );
60
61    virtual void changedOwner();
62    virtual void sizeChanged();
63    virtual void angleChanged() { }
64    virtual void positionChanged() { }
65    virtual void radarTick ( float dt ) {}
66
67    inline float getRadarSensitivity() const
68    { return 1.0f; }
69
[8955]70    unsigned int getMarkerLimit() { return this->markerLimit_; }
71
[7163]72private:
73    struct ObjectInfo
[1393]74    {
[7163]75        Ogre::PanelOverlayElement* panel_;
76        Ogre::TextAreaOverlayElement* text_;
77        bool outOfView_;
78        bool wasOutOfView_;
[1393]79
[7163]80    };
[1590]81
[7163]82    bool showObject( RadarViewable* rv );
[1604]83
[7163]84    // XMLPort accessors
85    void setNavMarkerSize ( float size )
86    { navMarkerSize_ = size; this->sizeChanged(); }
87    float getNavMarkerSize() const
88    { return navMarkerSize_; }
[1615]89
[8955]90
[7163]91    void setTextSize ( float size );
92    float getTextSize() const;
[1615]93
[7163]94    void setFont ( const std::string& font );
95    const std::string& getFont() const;
[1615]96
[7163]97    typedef std::map<RadarViewable*, ObjectInfo > ObjectMap;
98    ObjectMap activeObjectList_;
[1590]99
[7163]100    typedef std::list < std::pair<RadarViewable*, unsigned int > > sortedList;
101    sortedList sortedObjectList_;
[1615]102
[8920]103    float getArrowSizeX(int dist);   
104    float getArrowSizeY(int dist);
[7163]105
106    float navMarkerSize_;
107    std::string fontName_;
108    float textSize_;
[8920]109    bool showDistance;
[7163]110
[8955]111    unsigned int markerLimit_;;
[7163]112
113
114};
[1393]115}
116
[1601]117#endif /* _HUDNavigation_H__ */
Note: See TracBrowser for help on using the repository browser.