Emergency 20 Dokumentation  4.2.0
MedievalPreludeScreen.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/job/JobProxy.h>
16 #include <qsf/gui/GuiDocument.h>
18 
19 #include <boost/signals2.hpp>
20 
21 
22 //[-------------------------------------------------------]
23 //[ Forward declarations ]
24 //[-------------------------------------------------------]
25 namespace em5
26 {
27  class ProgressBar;
28 }
29 namespace qsf
30 {
31  class JobArguments;
32  class CameraComponent;
33 }
34 
35 
36 //[-------------------------------------------------------]
37 //[ Namespace ]
38 //[-------------------------------------------------------]
39 namespace em5
40 {
41 
42 
43  //[-------------------------------------------------------]
44  //[ Classes ]
45  //[-------------------------------------------------------]
51  {
52 
53 
54  //[-------------------------------------------------------]
55  //[ Public Boost signals ]
56  //[-------------------------------------------------------]
57  public:
58  boost::signals2::signal<void()> PlaybackFinished;
59 
60 
61  //[-------------------------------------------------------]
62  //[ Public methods ]
63  //[-------------------------------------------------------]
64  public:
69  explicit MedievalPreludeScreen(qsf::GuiContext& guiContext, int gameSessionConfiguration = GameSessionConfiguration::EMERGENCY_2016_CAMPAIGN);
70 
75  virtual ~MedievalPreludeScreen();
76 
77 
78  //[-------------------------------------------------------]
79  //[ Private virtual qsf::GuiDocument methods ]
80  //[-------------------------------------------------------]
81  private:
82  virtual bool onPreShow() override;
83  virtual void onPreHide() override;
84 
85 
86  //[-------------------------------------------------------]
87  //[ Public virtual qsf::InputListener methods ]
88  //[-------------------------------------------------------]
89  public:
90  virtual void eventReceived(const qsf::InputEvent& inputEvent, Response& response) override;
91 
92 
93  //[-------------------------------------------------------]
94  //[ Private methods ]
95  //[-------------------------------------------------------]
96  private:
97  void closeMedievalPreludeScreen();
98  void updateAnimation(const qsf::JobArguments& jobArguments);
99  void playAudioEffect();
100 
101 
102  //[-------------------------------------------------------]
103  //[ Private definitions ]
104  //[-------------------------------------------------------]
105  private:
106  enum State
107  {
108  STATE_INIT,
109  STATE_YEAR,
110  STATE_STORY,
111  STATE_TEXT,
112  STATE_FADE_TO_BLACK,
113  STATE_END
114  };
115 
116 
117  //[-------------------------------------------------------]
118  //[ Private data ]
119  //[-------------------------------------------------------]
120  private:
121  ProgressBar* mProgressBar;
122  qsf::CameraComponent* mCameraComponent;
123  float mPreviousFpsLimitation;
124  qsf::JobProxy mAnimationJobProxy;
125  State mState;
126  qsf::Time mTime;
127  Rocket::Core::Element* mElementAnnoDomini1327;
128  Rocket::Core::Element* mElementTheAgeOfPestilence;
129 
130 
131  };
132 
133 
134 //[-------------------------------------------------------]
135 //[ Namespace ]
136 //[-------------------------------------------------------]
137 } // em5
Definition: ActionPriority.h:13
Job proxy class.
Definition: JobProxy.h:51
virtual void eventReceived(const qsf::InputEvent &inputEvent, Response &response) override
Input listener class.
Definition: InputListener.h:43
Input event base class.
Definition: InputEvent.h:40
Progress bar class.
Definition: ProgressBar.h:42
Medieval prelude screen.
Definition: MedievalPreludeScreen.h:50
Graphical User Interface (GUI) document base class.
Definition: GuiDocument.h:51
Camera component class.
Definition: CameraComponent.h:50
MedievalPreludeScreen(qsf::GuiContext &guiContext, int gameSessionConfiguration=GameSessionConfiguration::EMERGENCY_2016_CAMPAIGN)
Constructor.
virtual ~MedievalPreludeScreen()
Destructor.
Job arguments class: holds data to be passed to the called job method by the job manager.
Definition: JobArguments.h:40
Definition: PickupPersonByParamedicAction.h:21
Ingame Graphical User Interface (GUI) context class.
Definition: GuiContext.h:62
boost::signals2::signal< void()> PlaybackFinished
This Boost signal is emitted when the prelude has been finished (or aborted premature) ...
Definition: MedievalPreludeScreen.h:58
Definition: InputListener.h:51
Definition: GameSessionConfiguration.h:55
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32