Emergency 20 Dokumentation  4.2.0
BuyUpgradeWindow.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 
18 
19 //[-------------------------------------------------------]
20 //[ Namespace ]
21 //[-------------------------------------------------------]
22 namespace em5
23 {
24 
25 
26  //[-------------------------------------------------------]
27  //[ Classes ]
28  //[-------------------------------------------------------]
34  {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Public methods ]
39  //[-------------------------------------------------------]
40  public:
41  explicit BuyUpgradeWindow(qsf::GuiContext& guiContext);
42 
51 
52 
53  //[-------------------------------------------------------]
54  //[ Public virtual qsf::GuiDocument methods ]
55  //[-------------------------------------------------------]
56  public:
57  virtual void processEvent(const std::string& eventKey, Rocket::Core::Event& event) override;
58 
59 
60  //[-------------------------------------------------------]
61  //[ Private virtual qsf::GuiDocument methods ]
62  //[-------------------------------------------------------]
63  private:
64  virtual bool onPreShow() override;
65  virtual void onPreHide() override;
66 
67 
68  //[-------------------------------------------------------]
69  //[ Private methods ]
70  //[-------------------------------------------------------]
71  private:
72  void setupWindow();
73  void setupGui();
74  void onReloadGui();
75  void disconnectSignals();
76 
77 
78  //[-------------------------------------------------------]
79  //[ Private data ]
80  //[-------------------------------------------------------]
81  private:
82  qsf::MessageProxy mMessageProxy;
83 
84  // TODO(sw) This is an fix for the crash when going from the game to the main menu and initiate then a gui hot reloading -> The connection to the menubar was still there but the menubar instance was destroyed
85  // Proper fix see QSF Bug "H301 GUI | "qsf::GuiDocument" | We need to guarantee that for each e.g. "onPostShow()" there's a "onPostHide()""
86  boost::signals2::connection mReloadGuiConnection;
87 
88 
89  };
90 
91 
92 //[-------------------------------------------------------]
93 //[ Namespace ]
94 //[-------------------------------------------------------]
95 } // em5
Definition: ActionPriority.h:13
Graphical User Interface (GUI) document base class.
Definition: GuiDocument.h:51
#define EM5_API_EXPORT
Definition: Export.h:28
Message listener proxy class.
Definition: MessageProxy.h:47
EMERGENCY 5 buy upgrade window.
Definition: BuyUpgradeWindow.h:33
Ingame Graphical User Interface (GUI) context class.
Definition: GuiContext.h:62