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