Emergency 20 Dokumentation  4.2.0
CreditsWindow.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 
17 #include <Rocket/Core/EventListener.h>
18 
19 
20 //[-------------------------------------------------------]
21 //[ Forward declarations ]
22 //[-------------------------------------------------------]
23 namespace qsf
24 {
25  class VideoPlayer;
26 }
27 
28 
29 //[-------------------------------------------------------]
30 //[ Namespace ]
31 //[-------------------------------------------------------]
32 namespace em5
33 {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Classes ]
38  //[-------------------------------------------------------]
43  class CreditsWindow : public MainMenuWindowBase, public Rocket::Core::EventListener
44  {
45 
46 
47  //[-------------------------------------------------------]
48  //[ Public methods ]
49  //[-------------------------------------------------------]
50  public:
51  explicit CreditsWindow(qsf::GuiContext& guiContext);
52  virtual ~CreditsWindow();
53  void showEndScreen(const std::string& endScreenFilename);
54 
55 
56  //[-------------------------------------------------------]
57  //[ Public virtual Rocket::Core::EventListener methods ]
58  //[-------------------------------------------------------]
59  public:
60  virtual void ProcessEvent(Rocket::Core::Event& event) override;
61 
62 
63  //[-------------------------------------------------------]
64  //[ Public virtual qsf::GuiDocument methods ]
65  //[-------------------------------------------------------]
66  public:
67  virtual void processEvent(const std::string& eventKey, Rocket::Core::Event& event) override;
68 
69 
70  //[-------------------------------------------------------]
71  //[ Protected virtual em5::MainMenuWindowBase methods ]
72  //[-------------------------------------------------------]
73  protected:
74  virtual void onGoingBack() override;
75 
76 
77  //[-------------------------------------------------------]
78  //[ Protected virtual em5::GuiHotReloadSupport methods ]
79  //[-------------------------------------------------------]
80  protected:
81  virtual void onReloadGui() override;
82  virtual bool onDocumentPreShow() override;
83  virtual void onDocumentPreHide() override;
84 
85 
86  //[-------------------------------------------------------]
87  //[ Private methods ]
88  //[-------------------------------------------------------]
89  private:
90  void setupGui();
91  void hideEndScreen(const qsf::JobArguments& jobArguments);
92  void moveText(float offset) const;
93  void updateJob(const qsf::JobArguments& jobArguments);
94  void onVideoPlaybackFinished();
95 
96 
97  //[-------------------------------------------------------]
98  //[ Private definitions ]
99  //[-------------------------------------------------------]
100  private:
101  enum class FadeState
102  {
103  NO_FADING,
104  FADE_IN,
105  FADE_OUT
106  };
107 
108 
109  //[-------------------------------------------------------]
110  //[ Private data ]
111  //[-------------------------------------------------------]
112  private:
113  qsf::JobProxy mJobProxy;
114  std::string mEndScreenFilename;
115  qsf::JobProxy mEndScreenJobProxy;
116  qsf::VideoPlayer* mVideoPlayer;
117  float mMusicMixerChannel;
118  float mVideoMixerChannel;
119  Rocket::Core::Element* mBackgroundImageElement;
120  FadeState mFadeState;
121  float mFadeFactor;
122 
123 
124  };
125 
126 
127 //[-------------------------------------------------------]
128 //[ Namespace ]
129 //[-------------------------------------------------------]
130 } // em5
Definition: ActionPriority.h:13
CreditsWindow(qsf::GuiContext &guiContext)
Job proxy class.
Definition: JobProxy.h:51
virtual bool onDocumentPreShow() override
virtual void onGoingBack() override
virtual void ProcessEvent(Rocket::Core::Event &event) override
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
Base window for main menu windows.
Definition: MainMenuWindowBase.h:40
Ingame Graphical User Interface (GUI) context class.
Definition: GuiContext.h:62
Self-contained video player.
Definition: VideoPlayer.h:55
virtual void onDocumentPreHide() override
virtual void onReloadGui() override
Gets called when the GUI should be reloaded.
virtual ~CreditsWindow()
void showEndScreen(const std::string &endScreenFilename)
Credits window.
Definition: CreditsWindow.h:43
virtual void processEvent(const std::string &eventKey, Rocket::Core::Event &event) override