diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /public/editor_sendcommand.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'public/editor_sendcommand.h')
| -rw-r--r-- | public/editor_sendcommand.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/public/editor_sendcommand.h b/public/editor_sendcommand.h new file mode 100644 index 0000000..3c944eb --- /dev/null +++ b/public/editor_sendcommand.h @@ -0,0 +1,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 |