aboutsummaryrefslogtreecommitdiff
path: root/mp/src/public/editor_sendcommand.h
blob: 3c944eb9b3ef3174f43ed8d04b1ba9ddca5916c2 (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Defines an interface to the map editor for the execution of
//			editor shell commands from another application. Commands allow the
//			creation and deletion of entities, AI nodes, and AI node connections.
//
// $NoKeywords: $
//=============================================================================//

#ifndef EDITOR_SENDCOMMAND_H
#define EDITOR_SENDCOMMAND_H
#pragma once

class QAngle;

//
// Result codes from Worldcraft_SendCommand.
//
enum EditorSendResult_t
{
	Editor_OK = 0,			// Success.
	Editor_NotRunning,		// Unable to establish a communications channel with the editor.
	Editor_BadCommand,		// The editor did not accept the command.
};


//
// Wrappers around specific commands for convenience.
//
EditorSendResult_t Editor_BeginSession(const char *pszMapName, int nMapVersion, bool bShowUI = false);
EditorSendResult_t Editor_EndSession(bool bShowUI);
EditorSendResult_t Editor_CheckVersion(const char *pszMapName, int nMapVersion, bool bShowUI = false);

EditorSendResult_t Editor_CreateEntity(const char *pszEntity, float x, float y, float z, bool bShowUI = false);
EditorSendResult_t Editor_DeleteEntity(const char *pszEntity, float x, float y, float z, bool bShowUI = false);
EditorSendResult_t Editor_SetKeyValue(const char *pszEntity, float x, float y, float z, const char *pKey, const char *pValue, bool bShowUI = false);
EditorSendResult_t Editor_RotateEntity(const char *pszEntity, float x, float y, float z, const QAngle &incrementalRotation, bool bShowUI = false);

EditorSendResult_t Editor_CreateNode(const char *pszNodeClass, int nID, float x, float y,  float z, bool bShowUI = false);
EditorSendResult_t Editor_DeleteNode(int nID, bool bShowUI = false);

EditorSendResult_t Editor_CreateNodeLink(int nStartID, int nEndID, bool bShowUI = false);
EditorSendResult_t Editor_DeleteNodeLink(int nStartID, int nEndID, bool bShowUI = false);


//
// Actually does the work. All the above commands route through this.
//
EditorSendResult_t Editor_SendCommand(const char *pszCommand, bool bShowUI);


#endif // EDITOR_SENDCOMMAND_H