- Timestamp:
- Nov 6, 2017, 4:35:06 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/CampaignMap_HS17/src/modules/overlays/hud/StoryModeHUD.h
r11527 r11544 28 28 */ 29 29 30 #ifndef _ HUDNavigation_H__31 #define _ HUDNavigation_H__30 #ifndef _StoryModeHUD_H__ 31 #define _StoryModeHUD_H__ 32 32 33 33 #include "overlays/OverlaysPrereqs.h" … … 38 38 #include "util/OgreForwardRefs.h" 39 39 #include "tools/interfaces/Tickable.h" 40 #include "interfaces/RadarListener.h"41 40 #include "overlays/OrxonoxOverlay.h" 42 41 43 42 namespace orxonox 44 43 { 45 class _OverlaysExport StoryModeHUD : public OrxonoxOverlay, public Tickable , public RadarListener44 class _OverlaysExport StoryModeHUD : public OrxonoxOverlay, public Tickable 46 45 { 47 46 public: 48 HUDNavigation(Context* context); 49 virtual ~HUDNavigation(); 50 51 void setConfigValues(); 47 StoryModeHUD(Context* context); 48 virtual ~StoryModeHUD(); 52 49 53 50 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 54 51 virtual void tick(float dt) override; 55 52 56 // RadarListener interface57 virtual void addObject(RadarViewable* object) override;58 virtual void removeObject(RadarViewable* viewable) override;59 virtual void objectChanged(RadarViewable* viewable) override;60 61 virtual void changedOwner() override;62 virtual void sizeChanged() override;63 virtual void angleChanged() override { }64 virtual void positionChanged() override { }65 virtual void radarTick(float dt) override {}66 67 virtual inline float getRadarSensitivity() const override68 { return 1.0f; }69 70 inline unsigned int getMarkerLimit() const71 { return this->markerLimit_; }72 73 static void selectClosestTarget();74 static void selectNextTarget();75 53 76 54 private: 77 struct ObjectInfo 78 { 79 80 81 82 Ogre::PanelOverlayElement* health_; 83 Ogre::PanelOverlayElement* healthLevel_; 84 Ogre::PanelOverlayElement* panel_; 85 Ogre::PanelOverlayElement* target_; 86 Ogre::TextAreaOverlayElement* text_; 87 bool outOfView_; 88 bool wasOutOfView_; 89 bool selected_; 90 }; 91 92 bool showObject(RadarViewable* rv); 93 94 // XMLPort accessors 95 inline void setHealthMarkerSize(float size) 96 { 97 this->healthMarkerSize_ = size; 98 this->sizeChanged(); 99 } 100 inline float getHealthMarkerSize() const 101 { return healthMarkerSize_; } 102 103 inline void setHealthLevelMarkerSize(float size) 104 { 105 this->healthLevelMarkerSize_ = size; 106 this->sizeChanged(); 107 } 108 inline float getHealthLevelMarkerSize() const 109 { return healthLevelMarkerSize_; } 110 111 inline void setNavMarkerSize(float size) 112 { 113 this->navMarkerSize_ = size; 114 this->sizeChanged(); 115 } 116 inline float getNavMarkerSize() const 117 { return navMarkerSize_; } 118 inline void setAimMarkerSize(float size) 119 { 120 this->aimMarkerSize_ = size; 121 this->sizeChanged(); 122 } 123 124 inline float getAimMarkerSize() const 125 { return aimMarkerSize_; } 126 inline void setDetectionLimit(float limit) 127 { this->detectionLimit_ = limit; } 128 inline float getDetectionLimit() const 129 { return this->detectionLimit_; } 130 55 Ogre::TextAreaOverlayElement* text_; 56 131 57 void setTextSize(float size); 132 58 float getTextSize() const; … … 135 61 const std::string& getFont() const; 136 62 137 float getArrowSizeX(int dist) const; 138 float getArrowSizeY(int dist) const; 139 140 Vector3 toAimPosition(RadarViewable* target) const; 141 142 std::map<RadarViewable*, ObjectInfo> activeObjectList_; 143 std::list<std::pair<RadarViewable*, unsigned int>> sortedObjectList_; 144 145 float healthMarkerSize_; 146 float healthLevelMarkerSize_; 147 float navMarkerSize_; 148 float aimMarkerSize_; 63 149 64 std::string fontName_; 150 65 float textSize_; 151 bool showDistance_; 152 153 RadarViewable* selectedTarget_; 154 155 bool closestTarget_; 156 bool nextTarget_; 157 158 static HUDNavigation* localHUD_s; //!< This is used as a filter. Only the local HUD should be influenced by the static Console Command functions. 159 160 161 float currentMunitionSpeed_; 162 163 unsigned int markerLimit_; 164 float detectionLimit_; //!< Objects that are more far away than detectionLimit_ are not displayed on the HUD. 10000.0f is the default value. 66 165 67 }; 166 68 } 167 69 168 #endif /* _ HUDNavigation_H__ */70 #endif /* _StoryModeHUD_H__ */
Note: See TracChangeset
for help on using the changeset viewer.