Emergency 20 Dokumentation  4.2.0
DebugEventFunctionWindow.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 #include <qsf/gui/GuiDocument.h>
15 #include <qsf/job/JobProxy.h>
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23  class FreeplayEvent;
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 DebugEventFunctionWindow(qsf::GuiContext& guiContext);
50 
51  bool updateAndCheckButton(const qsf::NamedIdentifier& buttonName, FreeplayEvent& freeplayEvent);
52 
53 
54  //[-------------------------------------------------------]
55  //[ Public virtual methods ]
56  //[-------------------------------------------------------]
57  public:
58  virtual void processEvent(const std::string& eventKey, Rocket::Core::Event& event) override;
59 
60 
61  //[-------------------------------------------------------]
62  //[ Private methods ]
63  //[-------------------------------------------------------]
64  private:
65  Rocket::Core::Element* addButton(const std::string& buttonName, const std::string& freeplayEventName, const std::string& rocketEventName);
66  void updateJob(const qsf::JobArguments& jobArguments);
67 
68 
69  //[-------------------------------------------------------]
70  //[ Private data ]
71  //[-------------------------------------------------------]
72  private:
73  struct Button
74  {
76  Rocket::Core::Element* mElement = nullptr;
77  qsf::NamedIdentifier mRocketEventName;
78  bool mWasPressed = false;
79  qsf::Time mTimeSinceLastUpdate;
80  };
81  typedef std::map<uint32, Button> ButtonList;
82 
83  struct EventData
84  {
85  uint32 mFreeplayEventId;
86  ButtonList mButtons;
87  EventData(uint32 freeplayEventId) : mFreeplayEventId(freeplayEventId) {}
88  };
89  std::map<uint32, EventData> mEvents;
90 
91  qsf::JobProxy mUpdateJobProxy;
92 
93 
94  };
95 
96 
97 //[-------------------------------------------------------]
98 //[ Namespace ]
99 //[-------------------------------------------------------]
100 } // em5
Definition: ActionPriority.h:13
Job proxy class.
Definition: JobProxy.h:51
In-game debug window for triggering specific actions for the running event.
Definition: DebugEventFunctionWindow.h:41
unsigned int uint32
Definition: PlatformTypes.h:181
Graphical User Interface (GUI) document base class.
Definition: GuiDocument.h:51
virtual void processEvent(const std::string &eventKey, 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
Ingame Graphical User Interface (GUI) context class.
Definition: GuiContext.h:62
bool updateAndCheckButton(const qsf::NamedIdentifier &buttonName, FreeplayEvent &freeplayEvent)
Class combining strings with their hashes.
Definition: NamedIdentifier.h:34
Abstract EMERGENCY 5 freeplay event base class.
Definition: FreeplayEvent.h:66
DebugEventFunctionWindow(qsf::GuiContext &guiContext)
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32