| [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 |
|---|
| [1454] | 26 | * |
|---|
| 27 | */ |
|---|
| [1393] | 28 | |
|---|
| [1601] | 29 | #ifndef _HUDNavigation_H__ |
|---|
| 30 | #define _HUDNavigation_H__ |
|---|
| [1393] | 31 | |
|---|
| [5693] | 32 | #include "overlays/OverlaysPrereqs.h" |
|---|
| [1410] | 33 | |
|---|
| [6942] | 34 | #include <map> |
|---|
| 35 | #include <string> |
|---|
| 36 | |
|---|
| [3196] | 37 | #include "util/OgreForwardRefs.h" |
|---|
| [5693] | 38 | #include "tools/interfaces/Tickable.h" |
|---|
| [6942] | 39 | #include "interfaces/RadarListener.h" |
|---|
| [1601] | 40 | #include "overlays/OrxonoxOverlay.h" |
|---|
| [1393] | 41 | |
|---|
| 42 | namespace orxonox |
|---|
| 43 | { |
|---|
| [6942] | 44 | class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable, public RadarListener |
|---|
| [1393] | 45 | { |
|---|
| [1615] | 46 | public: |
|---|
| [2087] | 47 | HUDNavigation(BaseObject* creator); |
|---|
| [3196] | 48 | virtual ~HUDNavigation(); |
|---|
| [1393] | 49 | |
|---|
| [1747] | 50 | virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); |
|---|
| 51 | virtual void tick(float dt); |
|---|
| [1590] | 52 | |
|---|
| [6942] | 53 | virtual void addObject(RadarViewable* object); |
|---|
| 54 | virtual void removeObject(RadarViewable* viewable); |
|---|
| 55 | virtual void objectChanged(RadarViewable* viewable) {} |
|---|
| 56 | |
|---|
| 57 | virtual void changedOwner(); |
|---|
| 58 | virtual void sizeChanged(); |
|---|
| 59 | virtual void angleChanged() { } |
|---|
| 60 | virtual void positionChanged() { } |
|---|
| 61 | virtual void radarTick(float dt) {} |
|---|
| 62 | |
|---|
| 63 | inline float getRadarSensitivity() const |
|---|
| 64 | { return 1.0f; } |
|---|
| 65 | |
|---|
| [1615] | 66 | private: |
|---|
| [6942] | 67 | struct ObjectInfo |
|---|
| 68 | { |
|---|
| 69 | Ogre::PanelOverlayElement* panel_; |
|---|
| 70 | Ogre::TextAreaOverlayElement* text_; |
|---|
| 71 | bool outOfView_; |
|---|
| 72 | bool wasOutOfView_; |
|---|
| 73 | }; |
|---|
| [1604] | 74 | |
|---|
| 75 | // XMLPort accessors |
|---|
| [6942] | 76 | void setNavMarkerSize(float size) |
|---|
| 77 | { navMarkerSize_ = size; this->sizeChanged(); } |
|---|
| 78 | float getNavMarkerSize() const |
|---|
| 79 | { return navMarkerSize_; } |
|---|
| [1615] | 80 | |
|---|
| [1590] | 81 | void setTextSize(float size); |
|---|
| 82 | float getTextSize() const; |
|---|
| [1615] | 83 | |
|---|
| [1590] | 84 | void setFont(const std::string& font); |
|---|
| [1615] | 85 | const std::string& getFont() const; |
|---|
| [1590] | 86 | |
|---|
| [6942] | 87 | typedef std::map<RadarViewable*, ObjectInfo > ObjectMap; |
|---|
| 88 | ObjectMap activeObjectList_; |
|---|
| [1615] | 89 | |
|---|
| [6942] | 90 | float navMarkerSize_; |
|---|
| 91 | std::string fontName_; |
|---|
| 92 | float textSize_; |
|---|
| [1615] | 93 | }; |
|---|
| [1393] | 94 | } |
|---|
| 95 | |
|---|
| [1601] | 96 | #endif /* _HUDNavigation_H__ */ |
|---|