Emergency 20 Dokumentation  4.2.0
SelectionWindowVehicle.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 definitions ]
54  //[-------------------------------------------------------]
55  public:
56  struct Seat
57  {
59  std::string imageFilename;
60  std::string tooltip;
61  Seat() :
62  entityId(qsf::getUninitialized<uint64>()),
63  imageFilename("../asset/mini_icons_avatars/empty_slot.dds")
64  { }
65  };
66 
67  typedef std::vector<Seat> Seats;
68  typedef std::vector<Rocket::Core::Element*> RocketCoreElements;
69 
70 
71  //[-------------------------------------------------------]
72  //[ Public static methods ]
73  //[-------------------------------------------------------]
74  public:
75  static void updateSeats(const qsf::Entity& entity, Seats& passengerSeats, Seats& personnelSeats);
76 
77 
78  //[-------------------------------------------------------]
79  //[ Public methods ]
80  //[-------------------------------------------------------]
81  public:
82  explicit SelectionWindowVehicle(qsf::GuiContext& guiContext);
83  virtual ~SelectionWindowVehicle();
84  void disableAlarmDrive();
85 
86 
87  //[-------------------------------------------------------]
88  //[ Public virtual qsf::GuiDocument methods ]
89  //[-------------------------------------------------------]
90  public:
91  virtual void processEvent(const std::string& eventKey, Rocket::Core::Event& event) override;
92 
93 
94  //[-------------------------------------------------------]
95  //[ Private virtual qsf::GuiDocument methods ]
96  //[-------------------------------------------------------]
97  private:
98  virtual bool onPreShow() override;
99  virtual void onPreHide() override;
100 
101 
102  //[-------------------------------------------------------]
103  //[ Private methods ]
104  //[-------------------------------------------------------]
105  private:
106  void onSelectionChange(const qsf::MessageParameters& parameters = qsf::MessageParameters());
107  void updateCommandBarVisibility(bool visible = true) const;
108  void updateInformationRegular();
109  void updateEnergyInformation();
110  void updatePersonnelSeats();
111  void updateCommandBarButtonVisibility();
112  void updateCommandBarState(qsf::Entity& selectedEntity);
113  void refreshCameraFollowButton(const qsf::MessageParameters& parameters);
114 
115 
116  //[-------------------------------------------------------]
117  //[ Private definitions ]
118  //[-------------------------------------------------------]
119  private:
120  static const char HEALTHBAR_COLOR_NORMAL[];
121  static const char HEALTHBAR_COLOR_BURNING[];
122 
123 
124  //[-------------------------------------------------------]
125  //[ Private data ]
126  //[-------------------------------------------------------]
127  private:
128  bool mCommandToggleState;
129  ProgressBar* mProgressBar;
130  GameComponent* mGameComponent;
131 
132  qsf::MessageProxy mMessageProxy;
133  qsf::MessageProxy mFollowCameraEntityChangedProxy;
134  qsf::JobProxy mUpdateJobProxy;
135 
136  Rocket::Core::Element* mUnitSeatsContainer;
137  RocketCoreElements mUnitSeats;
138  Rocket::Core::Element* mPassengerSeatsContainer;
139  RocketCoreElements mPassengerSeats;
140  boost::signals2::connection mNumberOfActiveButtonsChangedSignalConnection;
141 
142 
143  };
144 
145 
146 //[-------------------------------------------------------]
147 //[ Namespace ]
148 //[-------------------------------------------------------]
149 } // 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
std::vector< Rocket::Core::Element * > RocketCoreElements
Definition: SelectionWindowVehicle.h:68
Message listener proxy class.
Definition: MessageProxy.h:47
uint64_t uint64
Definition: PlatformTypes.h:184
Seat()
Definition: SelectionWindowVehicle.h:61
std::vector< Seat > Seats
Definition: SelectionWindowVehicle.h:67
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
T getUninitialized()
Definition: GetUninitialized.h:38
std::string tooltip
Not localized text-ID.
Definition: SelectionWindowVehicle.h:60
uint64 entityId
Definition: SelectionWindowVehicle.h:58
Definition: SelectionWindowVehicle.h:56
std::string imageFilename
Definition: SelectionWindowVehicle.h:59
EMERGENCY 5 in-game selection window.
Definition: SelectionWindowVehicle.h:48