Emergency 20 Dokumentation  4.2.0
PreferencesGraphicWindow.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 <glm/glm.hpp>
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace qsf
22 {
23  class ParameterGroup;
24 }
25 
26 
27 //[-------------------------------------------------------]
28 //[ Namespace ]
29 //[-------------------------------------------------------]
30 namespace em5
31 {
32 
33 
34  //[-------------------------------------------------------]
35  //[ Classes ]
36  //[-------------------------------------------------------]
42  {
43 
44 
45  //[-------------------------------------------------------]
46  //[ Public methods ]
47  //[-------------------------------------------------------]
48  public:
49  explicit PreferencesGraphicWindow(qsf::GuiContext& guiContext);
50  void setBackButton(bool main);
51  void setInTutorial(bool tutorial);
52  void setCustomSelection();
53 
54 
55  //[-------------------------------------------------------]
56  //[ Public virtual qsf::GuiDocument methods ]
57  //[-------------------------------------------------------]
58  public:
59  virtual void processEvent(const std::string& eventKey, Rocket::Core::Event& event) override;
60 
61 
62  //[-------------------------------------------------------]
63  //[ Protected virtual em5::MainMenuWindowBase methods ]
64  //[-------------------------------------------------------]
65  protected:
66  virtual void onGoingBack() override;
67 
68 
69  //[-------------------------------------------------------]
70  //[ Protected virtual em5::GuiHotReloadSupport methods ]
71  //[-------------------------------------------------------]
72  protected:
73  virtual bool onDocumentPreShow() override;
74  virtual void onDocumentPreHide() override;
75 
76 
77  //[-------------------------------------------------------]
78  //[ Private methods ]
79  //[-------------------------------------------------------]
80  private:
81  void loadSettings();
82  void syncronizeFullscreenGui();
83  void settingChange(bool isYesButton);
84  void reset(bool isYesButton);
85  bool isAnythingCriticalChanged() const;
86  bool isCriticalNotDefaultSetting() const;
87  void restartApplication();
88 
98  void onSettingsGroupPropertyChanged(const qsf::ParameterGroup& parameterGroup, uint32 propertyId);
99 
100 
101  //[-------------------------------------------------------]
102  //[ Private definitions ]
103  //[-------------------------------------------------------]
104  private:
105  struct GraphicSettings
106  {
107  float brightness;
108  uint32 resolution;
109  uint32 fullscreen;
110  uint32 quality; // Overall quality
111  bool verticalSynchronization;
112  bool lagReduction;
113  };
114  typedef std::vector<glm::ivec2> SupportedResolutions;
115 
116 
117  //[-------------------------------------------------------]
118  //[ Private data ]
119  //[-------------------------------------------------------]
120  private:
121  SupportedResolutions mSupportedResolutions;
122  GraphicSettings mCurrentGraphicsSettings;
123  GraphicSettings mNewGraphicsSettings;
124  bool mInMainMenu;
125 
126 
127  };
128 
129 
130 //[-------------------------------------------------------]
131 //[ Namespace ]
132 //[-------------------------------------------------------]
133 } // em5
Definition: ActionPriority.h:13
void setInTutorial(bool tutorial)
Abstract parameter group class.
Definition: ParameterGroup.h:31
unsigned int uint32
Definition: PlatformTypes.h:181
Preferences window.
Definition: PreferencesGraphicWindow.h:41
PreferencesGraphicWindow(qsf::GuiContext &guiContext)
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
virtual void onDocumentPreHide() override
virtual void onGoingBack() override
virtual void processEvent(const std::string &eventKey, Rocket::Core::Event &event) override
virtual bool onDocumentPreShow() override