Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/playability/src/util/hud.h @ 10230

Last change on this file since 10230 was 10230, checked in by muellmic, 17 years ago

interface changes

File size: 2.4 KB
Line 
1/*!
2 * @file hud.h
3 * @brief Definition of the ingame HUD.
4*/
5
6#ifndef _HUD_H
7#define _HUD_H
8
9#include "element_2d.h"
10#include "event_listener.h"
11#include "glgui_box.h"
12#include "elements/glgui_energywidgetvertical.h"
13
14
15// FORWARD DECLARATION
16class WeaponManager;
17namespace OrxGui {
18  class GLGuiWidget;
19  class GLGuiNotifier;
20  class GLGuiInputLine;
21  class GLGuiRadar;
22}
23
24//! A class that renders a HUD (Heads Up Display for User Information).
25class Hud : public Element2D, public EventListener
26{
27  ObjectListDeclaration(Hud);
28
29public:
30  Hud();
31  virtual ~Hud();
32
33
34  virtual void loadParams(const TiXmlElement* root);
35
36  void notifyUser(const std::string& message);
37
38
39  void setBackGround();
40  void setEnergyWidget(OrxGui::GLGuiWidget* widget);
41  void setShiledWidget(OrxGui::GLGuiWidget* widget);
42  void setArmorWidget(OrxGui::GLGuiWidget* widget);
43  inline OrxGui::GLGuiWidget* getEnergyWidget() {return this->energyWidget;};
44  inline OrxGui::GLGuiWidget* getShieldWidget() {return this->shieldWidget;};
45  inline OrxGui::GLGuiWidget* getArmorWidget() {return this->armorWidget;};
46
47  void setWeaponManager(WeaponManager* weaponMan, WeaponManager* weaponManSec = NULL);
48
49  void addWeaponWidget(OrxGui::GLGuiWidget* widget);
50  void removeWeaponWidget(OrxGui::GLGuiWidget* widget);
51
52  OrxGui::GLGuiRadar* radar() const { return _radar; };
53
54  void updateWeaponManager();
55
56  inline void setTravelZoneWidth(float width) 
57  {
58    if (width > 1) width = 1;
59    else if (width < 0) width = 0;
60
61    this->travelZoneWidth = width;
62  };
63
64  void draw() const;
65  virtual void process(const Event &event);
66
67
68  private:
69    void updateResolution();
70    //void createShipValuesBox();
71
72private:
73  unsigned int             resX;
74  unsigned int             resY;
75
76  float                    travelZoneWidth; //the percentage of the screen, the player has got for his movements. should always be a value between 0 and 1;
77
78  OrxGui::GLGuiWidget*     energyWidget;
79  OrxGui::GLGuiWidget*     shieldWidget;
80  OrxGui::GLGuiWidget*     armorWidget;
81
82  OrxGui::GLGuiNotifier*   notifier;
83  OrxGui::GLGuiInputLine*  inputLine;
84  OrxGui::GLGuiRadar*      _radar;
85
86  OrxGui::GLGuiWidget*     rightRect, leftRect;
87
88  WeaponManager*           weaponManager;
89  WeaponManager*           weaponManagerSecondary;
90
91  std::list<OrxGui::GLGuiEnergyWidgetVertical*> weaponsWidgetsPrim; //!< WeaponWidgets will be displayed one after another
92  std::list<OrxGui::GLGuiEnergyWidgetVertical*> weaponsWidgetsSec;
93};
94
95#endif /* _HUD_H */
Note: See TracBrowser for help on using the repository browser.