Debian Codegraph @

plugins/dm.gameconnection/GameConnectionPanel.h

raw
1 #pragma once
2
3 #include "wxutil/XmlResourceBasedWidget.h"
4
5 #include <sigc++/connection.h>
6
7 #include "wxutil/DockablePanel.h"
8
9 class wxCheckBox;
10 class wxButton;
11
12 //wxActivityIndicator was added in 3.1.0
13 //so we have to use something else
14 #define HAVE_ACTIVITYINDICATOR wxUSE_ACTIVITYINDICATOR
15
16 #if HAVE_ACTIVITYINDICATOR
17 class wxActivityIndicator;
18 typedef wxActivityIndicator ActivityIndicatorOrImage;
19 #else
20 class wxStaticBitmap;
21 typedef wxStaticBitmap ActivityIndicatorOrImage;
22 #endif
23
24 namespace gameconn { class GameConnection; }
25
26 namespace ui
27 {
28
29 /**
30 * stgatilov: A panel displaying the status of game connection system,
31 * allowing to control its modes and actions.
32 */
33 class GameConnectionPanel :
34 public wxutil::DockablePanel,
35 private wxutil::XmlResourceBasedWidget
36 {
37 wxCheckBox* _connectedCheckbox = nullptr;
38 wxButton* _restartGameButton = nullptr;
39 wxCheckBox* _dmapCheckbox = nullptr;
40 wxButton* _cameraLoadFromGameButton = nullptr;
41 wxCheckBox* _cameraSendToGameCheckbox = nullptr;
42 wxButton* _mapFileReloadNowButton = nullptr;
43 wxCheckBox* _mapFileReloadOnSaveCheckbox = nullptr;
44 wxButton* _hotReloadUpdateNowButton = nullptr;
45 wxCheckBox* _hotReloadUpdateOnChangeCheckbox = nullptr;
46 wxButton* _respawnSelectedButton = nullptr;
47 wxButton* _pauseGameButton = nullptr;
48 ActivityIndicatorOrImage* _connectedActivityIndicator = nullptr;
49
50 sigc::connection _updateOnStatusChangeSignal;
51
52 public:
53 GameConnectionPanel(wxWindow* parent);
54 ~GameConnectionPanel() override;
55
56 // Makes all GUI inactive / active depending on whether connection is alive.
57 void updateConnectedStatus();
58
59 protected:
60 void onPanelActivated() override;
61 void onPanelDeactivated() override;
62
63 private:
64 void connectListeners();
65 void disconnectListeners();
66
67 gameconn::GameConnection& Impl();
68 };
69
70 } // namespace