summaryrefslogtreecommitdiff
path: root/tracker/AdminServer/GamePanelInfo.h
blob: c52dd60535258f73a7783f8ea0fd07c48c5b7d34 (plain) (blame)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================

#ifndef GAMEPANELINFO_H
#define GAMEPANELINFO_H
#ifdef _WIN32
#pragma once
#endif

//#include <string.h>

#include <KeyValues.h>

#include <vgui_controls/Frame.h>
#include <vgui_controls/PHandle.h>
#include <vgui_controls/ListPanel.h>
#include <vgui_controls/AnimatingImagePanel.h>
#include <vgui_controls/Image.h>
#include <vgui_controls/PropertyPage.h>

#undef PropertySheet

#include <vgui_controls/PropertySheet.h>

#include "BanContextMenu.h"
#include "chatpanel.h"
#include "rawlogpanel.h"
#include "serverconfigpanel.h"
#include "playerpanel.h"
#include "banpanel.h"
#include "graphpanel.h"
#include "serverinfopanel.h"

#define PASSWORD_LEN 64
#define MOD_LEN 64

#include "imanageserver.h" // IManageServer interface


class CBudgetPanelContainer;

//-----------------------------------------------------------------------------
// Purpose: Dialog for displaying information about a game server
//-----------------------------------------------------------------------------
class CGamePanelInfo : public vgui::Frame, public IManageServer
{
	DECLARE_CLASS_SIMPLE( CGamePanelInfo, vgui::Frame ); 
public:
	CGamePanelInfo(vgui::Panel *parent, const char *name, const char *mod);
	~CGamePanelInfo();

	// IManageServer interface extras
	void ShowPage() { Activate(); }
	void AddToConsole(const char *msg);
	void SetAsRemoteServer(bool remote);

protected:
	// message handlers
	void OnStop();
	MESSAGE_FUNC( OnHelp, "Help" );
	void OnMasterRequestRestart();
	void OnMasterOutOfDate( const char *msg);
	MESSAGE_FUNC( OnRestartServer, "RestartServer" );
	MESSAGE_FUNC( OnUpdateTitle, "UpdateTitle" );
	void SetNewTitle(bool connectionFailed, const char *additional_text); // sets the windows title

	// vgui overrides
	virtual void OnTick();
	virtual void OnClose();
	virtual void PerformLayout();
	virtual void ActivateBuildMode();
	virtual void OnCommand(const char *command);

private:
	// methods
	vgui::ComboBox *m_pViewCombo;
	vgui::AnimatingImagePanel *m_pAnimImagePanel;
	
	// GUI pabels
	// main property sheet
	vgui::PropertySheet *m_pDetailsSheet;

	// panels in the sheet
	CPlayerPanel *m_pPlayerListPanel;
	CBanPanel *m_pBanListPanel;
	CRawLogPanel *m_pServerLogPanel;
	CChatPanel *m_pServerChatPanel;
	CServerConfigPanel *m_pServerConfigPanel;
	CGraphPanel *m_pGraphsPanel;
	CServerInfoPanel *m_pServerInfoPanel;
	CBudgetPanelContainer *m_pBudgetPanel;

	// state
	bool m_bRemoteServer;
	bool m_bShuttingDown;

	vgui::DHANDLE<vgui::QueryBox> m_hRestartQueryBox;
	vgui::DHANDLE<vgui::QueryBox> m_hOutOfDateQueryBox;
};

#endif // GAMEPANELINFO_H