summaryrefslogtreecommitdiff
path: root/gameui/CDKeyEntryDialog.h
blob: 120082662250d898ac4af279885f55e940b09182 (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================//

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

#include "vgui_controls/Frame.h"

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
class CCDKeyEntryDialog : public vgui::Frame
{
	DECLARE_CLASS_SIMPLE( CCDKeyEntryDialog, vgui::Frame );

public:
	CCDKeyEntryDialog(vgui::Panel *parent, bool inConnect = false);
	~CCDKeyEntryDialog();

	virtual void Activate();

	static bool IsValidWeakCDKeyInRegistry();

private:
	enum { MAX_CDKEY_ERRORS = 5 };

	virtual void OnCommand(const char *command);
	virtual void OnClose();
	virtual void OnThink();

	MESSAGE_FUNC_PTR( OnTextChanged, "TextChanged", panel );
	bool IsEnteredKeyValid();

	vgui::Button *m_pOK;
	vgui::Button *m_pQuitGame;
	vgui::TextEntry *m_pEntry1;
	vgui::TextEntry *m_pEntry2;
	vgui::TextEntry *m_pEntry3;
	vgui::TextEntry *m_pEntry4;
	vgui::TextEntry *m_pEntry5;

	vgui::DHANDLE<vgui::MessageBox> m_hErrorBox;

	bool m_bEnteredValidCDKey;

	bool m_bInConnect;
	int m_iErrCount; 
};


#endif // CDKEYENTRYDIALOG_H