Emergency 20 Dokumentation  4.2.0
SelectionWindowCommandable.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
13 #include "em5/Export.h"
14 
15 #include <qsf/gui/GuiDocument.h>
17 #include <qsf/job/JobProxy.h>
18 
19 
20 //[-------------------------------------------------------]
21 //[ Forward declarations ]
22 //[-------------------------------------------------------]
23 namespace qsf
24 {
25  class Entity;
26 }
27 namespace em5
28 {
29  class GameComponent;
30  class ProgressBar;
31 }
32 
33 
34 //[-------------------------------------------------------]
35 //[ Namespace ]
36 //[-------------------------------------------------------]
37 namespace em5
38 {
39 
40 
41  //[-------------------------------------------------------]
42  //[ Classes ]
43  //[-------------------------------------------------------]
49  {
50 
51 
52  //[-------------------------------------------------------]
53  //[ Public methods ]
54  //[-------------------------------------------------------]
55  public:
56  explicit SelectionWindowCommandable(qsf::GuiContext& guiContext);
57  virtual ~SelectionWindowCommandable();
58  bool isCommandBarVisible() const;
59  void setCommandBarVisible(bool visible);
60  bool areSkillsVisible() const;
61  void setSkillsVisible(bool visible);
62 
63 
64  //[-------------------------------------------------------]
65  //[ Public virtual qsf::GuiDocument methods ]
66  //[-------------------------------------------------------]
67  public:
68  virtual void processEvent(const std::string& eventKey, Rocket::Core::Event& event) override;
69 
70 
71  //[-------------------------------------------------------]
72  //[ Private virtual qsf::GuiDocument methods ]
73  //[-------------------------------------------------------]
74  private:
75  virtual bool onPreShow() override;
76  virtual void onPreHide() override;
77 
78 
79  //[-------------------------------------------------------]
80  //[ Private methods ]
81  //[-------------------------------------------------------]
82  private:
83  void setupGui();
84  void onReloadGui();
85  void onSelectionChange(const qsf::MessageParameters& parameters = qsf::MessageParameters());
86 
87  void updateInformationRegular();
88  void updateCommandBarButtonVisibility() const;
89  void updateCommandBarVisibility(bool visible = true) const;
90  void updateSkillsVisibility();
91  void updateEnergyInformation();
92  void updateCareInformation();
93  void updateEquipmentInformation();
94  void updateCommandBarState(qsf::Entity& selectedEntity);
95  void refreshCameraFollowButton(const qsf::MessageParameters& parameters);
96 
97 
98  //[-------------------------------------------------------]
99  //[ Private definitions ]
100  //[-------------------------------------------------------]
101  private:
102  static const char HEALTHBAR_COLOR_NORMAL[];
103  static const char HEALTHBAR_COLOR_INJURED[];
104 
105 
106  //[-------------------------------------------------------]
107  //[ Private data ]
108  //[-------------------------------------------------------]
109  private:
110  bool mCommandBarVisible;
111  bool mCommandBarToggleState;
112  bool mSkillsVisible;
113  ProgressBar* mProgressBar;
114  GameComponent* mGameComponent;
115 
116  qsf::MessageProxy mMessageProxy;
117  qsf::MessageProxy mFollowCameraEntityChangedProxy;
118  qsf::JobProxy mUpdateJobProxy;
119 
120 
121  };
122 
123 
124 //[-------------------------------------------------------]
125 //[ Namespace ]
126 //[-------------------------------------------------------]
127 } // em5
Definition: ActionPriority.h:13
Job proxy class.
Definition: JobProxy.h:51
Entity class.
Definition: Entity.h:46
Message parameters class.
Definition: MessageParameters.h:34
Progress bar class.
Definition: ProgressBar.h:42
Graphical User Interface (GUI) document base class.
Definition: GuiDocument.h:51
#define EM5_API_EXPORT
Definition: Export.h:28
Message listener proxy class.
Definition: MessageProxy.h:47
EMERGENCY 5 in-game selection window.
Definition: SelectionWindowCommandable.h:48
Definition: PickupPersonByParamedicAction.h:21
Ingame Graphical User Interface (GUI) context class.
Definition: GuiContext.h:62
EMERGENCY 5 game component class. Holds information for the map properties.
Definition: GameComponent.h:32