Subversion Repositories WoWGM

Rev

Rev 29 | Rev 32 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 29 Rev 31
Line 3... Line 3...
3
 
3
 
4
 
4
 
5
#include <Engine/Base/RCString.hpp>
5
#include <Engine/Base/RCString.hpp>
6
#include <Engine/Event/EvtApi.h>
6
#include <Engine/Event/EvtApi.h>
7
 
7
 
8
enum COLOR_T
8
enum COLOR_T {
9
{
-
 
10
	DEFAULT_COLOR		= 0x0,
9
	DEFAULT_COLOR     = 0x0,
11
	INPUT_COLOR			= 0x1,
10
	INPUT_COLOR       = 0x1,
12
	ECHO_COLOR			= 0x2,
11
	ECHO_COLOR        = 0x2,
13
	ERROR_COLOR			= 0x3,
12
	ERROR_COLOR       = 0x3,
14
	WARNING_COLOR		= 0x4,
13
	WARNING_COLOR     = 0x4,
15
	GLOBAL_COLOR		= 0x5,
14
	GLOBAL_COLOR      = 0x5,
16
	ADMIN_COLOR			= 0x6,
15
	ADMIN_COLOR       = 0x6,
17
	HIGHLIGHT_COLOR		= 0x7,
16
	HIGHLIGHT_COLOR   = 0x7,
18
	BACKGROUND_COLOR	= 0x8,
17
	BACKGROUND_COLOR  = 0x8,
19
	NUM_COLORTYPES		= 0x9
18
	NUM_COLORTYPES    = 0x9
20
};
19
};
21
 
20
 
22
enum CATEGORY
21
enum CATEGORY {
23
{
-
 
24
	DEBUG		= 0x0,
22
	DEBUG     = 0x0,
25
	GRAPHICS	= 0x1,
23
	GRAPHICS  = 0x1,
26
	CONSOLE		= 0x2,
24
	CONSOLE   = 0x2,
27
	COMBAT		= 0x3,
25
	COMBAT    = 0x3,
28
	GAME		= 0x4,
26
	GAME      = 0x4,
29
	DEFAULT		= 0x5,
27
	DEFAULT   = 0x5,
30
	NET			= 0x6,
28
	NET       = 0x6,
31
	SOUND		= 0x7,
29
	SOUND     = 0x7,
32
	GM			= 0x8,
30
	GM        = 0x8,
33
	NONE		= 0x9,
31
	NONE      = 0x9,
34
	LAST		= 0xA
32
	LAST      = 0xA
35
};
33
};
36
 
34
 
37
#define NOHELP 0
35
#define NOHELP 0
38
 
36
 
39
enum EXECMODE
37
enum EXECMODE {
40
{
-
 
41
	EM_PROMPTOVERWRITE	= 0x0,
38
	EM_PROMPTOVERWRITE  = 0x0,
42
	EM_RECORDING		= 0x1,
39
	EM_RECORDING        = 0x1,
43
	EM_APPEND			= 0x2,
40
	EM_APPEND           = 0x2,
44
	EM_WRITEFILE		= 0x3,
41
	EM_WRITEFILE        = 0x3,
45
	EM_NOTACTIVE		= 0x4,
42
	EM_NOTACTIVE        = 0x4,
46
	EM_NUM_EXECMODES	= 0x5
43
	EM_NUM_EXECMODES    = 0x5
47
};
44
};
48
 
45
 
49
 
46
 
50
/****************************************************************************
47
/****************************************************************************
51
*
48
*
52
*  Global variables
49
*   Global variables
53
*
50
*
54
***/
51
***/
55
 
52
 
56
extern EXECMODE&	g_ExecCreateMode;
53
extern EXECMODE& g_ExecCreateMode;
-
 
54
 
57
extern char*		g_ExecBuffer;
55
extern char* g_ExecBuffer;
58
 
56
 
59
 
57
 
60
/****************************************************************************
58
/****************************************************************************
61
*
59
*
62
*  CVAR FLAGS
60
*   CVar flags
63
*
61
*
64
***/
62
***/
65
 
63
 
66
#define LATCH		0x2
64
#define LATCH     0x2
67
#define READONLY	0x4
65
#define READONLY  0x4
68
 
66
 
69
 
67
 
70
/****************************************************************************
68
/****************************************************************************
71
*
69
*
72
*  CVar struct
70
*   CVar struct
73
*
71
*
74
***/
72
***/
75
 
73
 
76
struct CVar {
74
struct CVar {
77
 
75
 
78
	// TODO: TSHashObject
76
  //TODO: Encapsulate the following fields as TSHashObject
79
	unsigned int	m_hashval;
77
	unsigned int  m_hashval;
80
	void*			m_linktoslot[2];
78
	void*         m_linktoslot[2];
81
	void*			m_linktofull[2];
79
	void*         m_linktofull[2];
82
	char*			m_key;
80
	char*         m_key;
83
 
-
 
-
 
81
  //////////////////////////////////////////////////////////////////////////
84
 
82
 
85
	CATEGORY		m_category;
83
	CATEGORY      m_category;
86
	unsigned int	m_flags;
84
	unsigned int  m_flags;
87
	RCString		m_stringValue;
85
	RCString      m_stringValue;
88
	float			m_floatValue;
86
	float         m_floatValue;
89
	int				m_intValue;
87
	int           m_intValue;
90
	int				m_modified;
88
	int           m_modified;
91
	RCString		m_defaultValue;
89
	RCString      m_defaultValue;
92
	RCString		m_resetValue;
90
	RCString      m_resetValue;
93
	RCString		m_latchedValue;
91
	RCString      m_latchedValue;
94
	RCString		m_helpText;
92
	RCString      m_helpText;
95
	bool			(*m_callback)(CVar *,LPCSTR,LPCSTR,void *);
93
	bool          (*m_callback)(CVar *,LPCSTR,LPCSTR,void *);
96
	void*			m_arg;
94
	void*         m_arg;
97
 
-
 
98
 
95
 
99
	//=======================================================================
96
	//=======================================================================
100
	static CVar* Register (LPCSTR		name,
97
	static CVar* Register (LPCSTR   name,
101
						   LPCSTR		help,
98
                         LPCSTR   help,
102
						   unsigned int	flags,
99
                         DWORD    flags,
103
						   LPCSTR		value,
100
                         LPCSTR   value,
104
						   bool			(*fcn)(CVar *,LPCSTR,LPCSTR,void *),
101
                         bool     (*fcn)(CVar *,LPCSTR,LPCSTR,void *),
105
						   CATEGORY		category,
102
                         CATEGORY category,
106
						   bool			setCommand,
103
                         bool     setCommand,
107
						   void*		arg,
104
                         void*    arg,
108
						   bool			a9);	// TODO
105
                         bool     a9);	// TODO
109
};
106
};
110
 
107
 
111
 
108
 
112
/****************************************************************************
109
/****************************************************************************
113
*
110
*
114
*  External functions
111
*   External functions
115
*
112
*
116
***/
113
***/
117
 
114
 
118
//===========================================================================
115
//===========================================================================
119
extern void ConsoleAccessSetEnabled (BOOL enable);
116
extern void ConsoleAccessSetEnabled (BOOL enable);
Line 141... Line 138...
141
 
138
 
142
//===========================================================================
139
//===========================================================================
143
extern void ConsoleCommandInitialize ();
140
extern void ConsoleCommandInitialize ();
144
 
141
 
145
//===========================================================================
142
//===========================================================================
146
extern BOOL ConsoleCommandRegister (LPCSTR		command,
143
extern BOOL ConsoleCommandRegister (LPCSTR    command,
147
									BOOL		(*handler)(LPCSTR,LPCSTR),
144
                                    BOOL      (*handler)(LPCSTR,LPCSTR),
148
									CATEGORY	category,
145
                                    CATEGORY  category,
149
									LPCSTR		helpText);
146
                                    LPCSTR    helpText);
150
 
147
 
151
//===========================================================================
148
//===========================================================================
152
extern void ConsoleCommandUnregister (LPCSTR command);
149
extern void ConsoleCommandUnregister (LPCSTR command);
153
 
150
 
154
//===========================================================================
151
//===========================================================================