Emergency 20 Dokumentation  4.2.0
ModificationWindow.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 <qsf/gui/GuiDocument.h>
15 
16 
17 //[-------------------------------------------------------]
18 //[ Namespace ]
19 //[-------------------------------------------------------]
20 namespace em5
21 {
22 
23 
24  //[-------------------------------------------------------]
25  //[ Classes ]
26  //[-------------------------------------------------------]
32  {
33 
34 
35  //[-------------------------------------------------------]
36  //[ Public methods ]
37  //[-------------------------------------------------------]
38  public:
43  explicit ModificationWindow(qsf::GuiContext& guiContext);
44 
49  virtual ~ModificationWindow();
50 
51 
52  //[-------------------------------------------------------]
53  //[ Public virtual qsf::GuiDocument methods ]
54  //[-------------------------------------------------------]
55  public:
56  virtual void processEvent(const std::string& eventKey, Rocket::Core::Event& event) override;
57 
58 
59  //[-------------------------------------------------------]
60  //[ Public virtual qsf::InputListener methods ]
61  //[-------------------------------------------------------]
62  public:
63  virtual void eventReceived(const qsf::InputEvent& inputEvent, Response& response) 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:
78  void onRowSelection(Rocket::Core::Element* element);
79  void updateSelectionInfo(const std::string& title, const std::string& description, const std::string& imageName, bool showImage = true);
80  void setPreviewImage(const std::string& absolutePath);
81 
82  Rocket::Core::Element* getSelectedModElement() const;
83  std::string getSelectedModName() const;
84  void onDeleteModConfirm(bool buttonResult);
85  void onReplaceExistingProjectConfirm(bool buttonResult, const std::string& filename);
86 
87  void restoreOriginallyEnabledMods();
88 
89  void importMod(const std::string& filename, bool replaceExistingProject = false);
90 
91 
92  //[-------------------------------------------------------]
93  //[ Private data ]
94  //[-------------------------------------------------------]
95  private:
96  std::vector<uint32> mOriginallyEnabledModIds;
97  std::string mSelectedElement;
98 
99 
100  };
101 
102 
103 //[-------------------------------------------------------]
104 //[ Namespace ]
105 //[-------------------------------------------------------]
106 } // em5
Definition: ActionPriority.h:13
Input listener class.
Definition: InputListener.h:43
Input event base class.
Definition: InputEvent.h:40
Graphical User Interface (GUI) document base class.
Definition: GuiDocument.h:51
EMERGENCY 5 modification window GUI.
Definition: ModificationWindow.h:31
ModificationWindow(qsf::GuiContext &guiContext)
Constructor.
Ingame Graphical User Interface (GUI) context class.
Definition: GuiContext.h:62
virtual ~ModificationWindow()
Destructor.
Definition: InputListener.h:51
virtual void processEvent(const std::string &eventKey, Rocket::Core::Event &event) override
virtual void eventReceived(const qsf::InputEvent &inputEvent, Response &response) override