[11185] | 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: |
---|
[11189] | 24 | * Johannes Sager |
---|
[11185] | 25 | * Co-authors: |
---|
| 26 | * ... |
---|
| 27 | * |
---|
| 28 | */ |
---|
| 29 | |
---|
[11189] | 30 | #ifndef _HUDChargeBar_H__ |
---|
| 31 | #define _HUDChargeBar_H__ |
---|
[11185] | 32 | |
---|
| 33 | #include "overlays/OverlaysPrereqs.h" |
---|
| 34 | #include "util/Math.h" |
---|
| 35 | #include "tools/interfaces/Tickable.h" |
---|
| 36 | #include "overlays/OverlayText.h" |
---|
| 37 | #include "HUDBar.h" |
---|
[11189] | 38 | |
---|
[11185] | 39 | #include "weaponsystem/WeaponSystem.h" |
---|
| 40 | #include "weaponsystem/WeaponPack.h" |
---|
| 41 | #include "weaponsystem/WeaponMode.h" |
---|
| 42 | #include "weaponsystem/Weapon.h" |
---|
| 43 | |
---|
| 44 | namespace orxonox |
---|
| 45 | { |
---|
[11189] | 46 | /** |
---|
| 47 | @brief |
---|
| 48 | The HUDChargeBar displays the amount of charges of its owner (a @ref Pawn). |
---|
| 49 | The length of the bar is given by the ratio of the current charges and the maximal charges of the @ref Pawn. |
---|
| 50 | */ |
---|
| 51 | |
---|
[11185] | 52 | class _OverlaysExport HUDChargeBar : public HUDBar, public Tickable |
---|
| 53 | { |
---|
| 54 | public: |
---|
| 55 | HUDChargeBar(Context* context); |
---|
| 56 | virtual ~HUDChargeBar(); |
---|
| 57 | |
---|
| 58 | virtual void tick(float dt) override; |
---|
| 59 | virtual void changedOwner() override; |
---|
| 60 | |
---|
| 61 | inline void setHealthBarOwner(Pawn* owner) |
---|
| 62 | { this->owner_ = owner; } |
---|
[11189] | 63 | |
---|
[11185] | 64 | private: |
---|
[11189] | 65 | WeaponMode* correspondingMode_; // pointer on the chargeable weaponmode (=nullptr if no chargeable weapons equipped) |
---|
[11185] | 66 | WeakPtr<Pawn> owner_; |
---|
| 67 | }; |
---|
| 68 | } |
---|
| 69 | #endif /* _HUDChargeBar_H__ */ |
---|