Orxonox  0.0.5 Codename: Arcturus
HUDWeaponMode.h
Go to the documentation of this file.
1 
2 /*
3  * ORXONOX - the hottest 3D action shooter ever to exist
4  * > www.orxonox.net <
5  *
6  *
7  * License notice:
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22  *
23  * Author:
24  * Fabien Vultier
25  * Co-authors:
26  * ...
27  *
28  */
29 
30 #ifndef _HUDWeaponMode_H__
31 #define _HUDWeaponMode_H__
32 
34 
35 #include <map>
36 #include <vector>
37 #include <string>
38 
40 #include "overlays/OverlayText.h"
43 #include "overlays/OverlayGroup.h"
46 #include "weaponsystem/Munition.h"
47 
48 namespace orxonox
49 {
51  {
52  public:
53  HUDWeaponMode(Context* context);
54  virtual ~HUDWeaponMode();
55 
56  virtual void tick(float dt) override;
57  virtual void changedOwner() override;
58  virtual void changedOverlayGroup() override;
59  virtual void changedVisibility() override;
60  virtual void changedName() override;
61  virtual void positionChanged() override;
62  virtual void sizeChanged() override;
63 
64  void setWeaponMode(WeaponMode* weaponMode);
65 
66  inline void setWeaponModeHUDActualSize(Vector2 vector)
67  { weaponModeHUDActualSize_ = vector;
68  this->updateSize();
69  }
70  inline Vector2 getWeaponModeHUDActualSize() const
71  { return weaponModeHUDActualSize_; }
72  inline void setWeaponIndex(int index)
73  { weaponIndex_ = index;
74  this->updatePosition();
75  }
76  inline void setWeaponModeIndex(int index)
77  { weaponModeIndex_ = index;
78  this->updatePosition();
79  }
80  inline void setPositionOffset(Vector2 positionOffset)
81  {
82  this->positionOffset_ = positionOffset;
83  this->updatePosition();
84  }
85 
86  private:
87  void updateSize();
88  void updatePosition();
89  void positionHUDChilds();
90 
93 
94  Ogre::PanelOverlayElement* overlayElementIcon_;
95  Ogre::PanelOverlayElement* overlayElementReplenish_;
96  Ogre::PanelOverlayElement* overlayElementMunition_;
97  Ogre::PanelOverlayElement* overlayElementState_;
98 
100 
103 
108  };
109 }
110 
111 #endif /* _HUDWeaponMode_H__ */
Ogre::PanelOverlayElement * overlayElementIcon_
Definition: HUDWeaponMode.h:94
void setWeaponModeIndex(int index)
Definition: HUDWeaponMode.h:76
Declaration of the Tickable interface.
StrongPtr< OverlayText > textOverlayLeft_
Definition: HUDWeaponMode.h:101
::std::string string
Definition: gtest-port.h:756
A strong pointer which wraps a pointer to an object and keeps this object alive as long as the strong...
Definition: CorePrereqs.h:227
Vector2 getWeaponModeHUDActualSize() const
Definition: HUDWeaponMode.h:70
Implementation of the ReplenishingMunition class.
WeakPtr wraps a pointer to an object, which becomes nullptr if the object is deleted.
Definition: CorePrereqs.h:236
Vector2 positionOffset_
Definition: HUDWeaponMode.h:105
Ogre::PanelOverlayElement * overlayElementMunition_
Definition: HUDWeaponMode.h:96
void setPositionOffset(Vector2 positionOffset)
Definition: HUDWeaponMode.h:80
Ogre::PanelOverlayElement * overlayElementReplenish_
Definition: HUDWeaponMode.h:95
StrongPtr< OverlayText > textOverlayRight_
Definition: HUDWeaponMode.h:102
A WeaponMode defines how a Weapon is used.
Definition: WeaponMode.h:49
void setWeaponModeHUDActualSize(Vector2 vector)
Definition: HUDWeaponMode.h:66
Declaration of the OverlayGroup class.
WeakPtr< Pawn > owner_
Definition: HUDWeaponMode.h:91
WeakPtr< WeaponMode > weaponMode_
Definition: HUDWeaponMode.h:92
#define _OverlaysExport
Definition: OverlaysPrereqs.h:60
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Shared library macros, enums, constants and forward declarations for the overlays module ...
int weaponIndex_
Definition: HUDWeaponMode.h:106
Definition: Context.h:45
Vector2 weaponModeHUDActualSize_
Definition: HUDWeaponMode.h:104
Base class to display content directly onto the screen.
Definition: OrxonoxOverlay.h:72
Declaration of the OrxonoxOverlay class.
void setWeaponIndex(int index)
Definition: HUDWeaponMode.h:72
std::string materialNameState_
Definition: HUDWeaponMode.h:99
The Tickable interface provides a tick(dt) function, that gets called every frame.
Definition: Tickable.h:52
Ogre::PanelOverlayElement * overlayElementState_
Definition: HUDWeaponMode.h:97
Definition: HUDWeaponMode.h:50
int weaponModeIndex_
Definition: HUDWeaponMode.h:107