Emergency 20 Dokumentation  4.2.0
SelectionWindowMulti.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 //[-------------------------------------------------------]
14 
15 #include <qsf/gui/GuiDocument.h>
17 #include <qsf/job/JobProxy.h>
18 
19 
20 //[-------------------------------------------------------]
21 //[ Forward declarations ]
22 //[-------------------------------------------------------]
23 namespace em5
24 {
25  class GameComponent;
26  class CommandableComponent;
27 }
28 namespace qsf
29 {
30  class Entity;
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 SelectionWindowMulti(qsf::GuiContext& guiContext);
57 
58 
59  //[-------------------------------------------------------]
60  //[ Public virtual qsf::GuiDocument methods ]
61  //[-------------------------------------------------------]
62  public:
63  virtual void processEvent(const std::string& eventKey, Rocket::Core::Event& event) override;
64 
65 
66  //[-------------------------------------------------------]
67  //[ Private virtual qsf::GuiDocument methods ]
68  //[-------------------------------------------------------]
69  private:
70  virtual bool onPreShow() override;
71  virtual void onPreHide() override;
72 
73 
74  //[-------------------------------------------------------]
75  //[ Private methods ]
76  //[-------------------------------------------------------]
77  private:
82  void onSelectionChange(const qsf::MessageParameters& parameters = qsf::MessageParameters());
83 
88  void onHealthUpdate();
89 
94  bool isUnitFromLocalPlayer(const CommandableComponent& commandableComponent);
95 
100  void onLeftMouseButton(Rocket::Core::Element* element);
101 
106  void onRightMouseButton(Rocket::Core::Element* element);
107 
112  SelectionManager::IdSet getAllSameUnits(qsf::Entity& entity);
113 
118  void showPage(uint32 page);
119 
120  void updateCommandBarButtonVisibility();
121  void updateCommandBarVisibility();
122 
127  void refreshCameraFollowButton(const qsf::MessageParameters& parameters);
128 
129 
130  //[-------------------------------------------------------]
131  //[ Private definitions ]
132  //[-------------------------------------------------------]
133  private:
134  static const char HEALTHBAR_COLOR_NORMAL[];
135  static const char HEALTHBAR_COLOR_INJURED[];
136 
137 
138  //[-------------------------------------------------------]
139  //[ Private data ]
140  //[-------------------------------------------------------]
141  private:
142  bool mCommandToggleState;
143  GameComponent* mGameComponent;
144  qsf::MessageProxy mMessageProxy;
145  qsf::MessageProxy mFollowCameraEntityChangedProxy;
146  qsf::JobProxy mUpdateJobProxy;
147  uint32 mCurrentPage;
148  uint32 mMaxPage;
149  Rocket::Core::Element* mSelectionBoxes;
150  std::vector<Rocket::Core::Element*> mSelectedUnits;
151  boost::signals2::connection mNumberOfActiveButtonsChangedSignalConnection;
152 
153 
154  };
155 
156 
157 //[-------------------------------------------------------]
158 //[ Namespace ]
159 //[-------------------------------------------------------]
160 } // 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
unsigned int uint32
Definition: PlatformTypes.h:181
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
boost::container::flat_set< uint64 > IdSet
Definition: SelectionManagerTemplate.h:52
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
EMERGENCY 5 in-game selection window.
Definition: SelectionWindowMulti.h:48
Commandable component class.
Definition: CommandableComponent.h:46