Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/fabienHS15/src/modules/overlays/hud/HUDWeaponMode.h @ 10721

Last change on this file since 10721 was 10721, checked in by fvultier, 9 years ago
File size: 3.3 KB
Line 
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
33#include "overlays/OverlaysPrereqs.h"
34
35#include <map>
36#include <vector>
37#include <string>
38
39#include <OgreOverlayManager.h>
40#include <OgreMaterialManager.h>
41#include <OgreTechnique.h>
42#include <OgrePass.h>
43#include <OgrePanelOverlayElement.h> 
44
45#include "overlays/OrxonoxOverlay.h"
46#include "overlays/OverlayText.h"
47#include "tools/interfaces/Tickable.h"
48#include "worldentities/pawns/Pawn.h"
49#include "overlays/OverlayGroup.h"
50#include "weaponsystem/ReplenishingMunition.h"
51
52namespace orxonox
53{
54    class _OverlaysExport HUDWeaponMode : public OrxonoxOverlay, public Tickable
55    {
56    public:
57        HUDWeaponMode(Context* context);
58        virtual ~HUDWeaponMode();
59
60        virtual void tick(float dt);
61        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
62        virtual void changedOwner();
63        virtual void changedOverlayGroup();
64        virtual void changedVisibility();
65        virtual void changedName();
66        virtual void positionChanged();
67        virtual void sizeChanged();
68
69        virtual void setWeaponMode(WeaponMode* weaponMode);
70
71        inline void setWeaponModeHUDActualSize(Vector2 vector)
72            { weaponModeHUDActualSize_ = vector;
73              this->updateSize();
74            }
75        inline Vector2 getWeaponModeHUDActualSize() const
76            { return weaponModeHUDActualSize_; }
77        inline void setWeaponIndex(int index)
78            { weaponIndex_ = index;
79              this->updatePosition();
80            }
81        inline void setWeaponModeIndex(int index)
82            { weaponModeIndex_ = index;
83              this->updatePosition();
84            }
85
86        virtual void positionHUDChilds();
87
88    private:
89        virtual void updateSize();
90        virtual void updatePosition();
91
92        WeakPtr<Pawn> owner_;
93        WeakPtr<WeaponMode> weaponMode_;
94
95        Ogre::PanelOverlayElement* overlayElementIcon_;
96        Ogre::PanelOverlayElement* overlayElementReplenish_;
97        Ogre::PanelOverlayElement* overlayElementMunition_;
98        Ogre::PanelOverlayElement* overlayElementState_;
99
100        std::string materialNameState_;
101
102        StrongPtr<OverlayText> textOverlayLeft_;
103        StrongPtr<OverlayText> textOverlayRight_;
104
105        Vector2 weaponModeHUDActualSize_;
106        int weaponIndex_;
107        int weaponModeIndex_;
108    };
109}
110
111#endif /* _HUDWeaponMode_H__ */
Note: See TracBrowser for help on using the repository browser.