Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
2.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Defines an interface to the map editor for the execution of
  4. // editor shell commands from another application. Commands allow the
  5. // creation and deletion of entities, AI nodes, and AI node connections.
  6. //
  7. // $NoKeywords: $
  8. //=============================================================================//
  9. #ifndef EDITOR_SENDCOMMAND_H
  10. #define EDITOR_SENDCOMMAND_H
  11. #pragma once
  12. class QAngle;
  13. //
  14. // Result codes from Worldcraft_SendCommand.
  15. //
  16. enum EditorSendResult_t
  17. {
  18. Editor_OK = 0, // Success.
  19. Editor_NotRunning, // Unable to establish a communications channel with the editor.
  20. Editor_BadCommand, // The editor did not accept the command.
  21. };
  22. //
  23. // Wrappers around specific commands for convenience.
  24. //
  25. EditorSendResult_t Editor_BeginSession(const char *pszMapName, int nMapVersion, bool bShowUI = false);
  26. EditorSendResult_t Editor_EndSession(bool bShowUI);
  27. EditorSendResult_t Editor_CheckVersion(const char *pszMapName, int nMapVersion, bool bShowUI = false);
  28. EditorSendResult_t Editor_CreateEntity(const char *pszEntity, float x, float y, float z, bool bShowUI = false);
  29. EditorSendResult_t Editor_DeleteEntity(const char *pszEntity, float x, float y, float z, bool bShowUI = false);
  30. EditorSendResult_t Editor_SetKeyValue(const char *pszEntity, float x, float y, float z, const char *pKey, const char *pValue, bool bShowUI = false);
  31. EditorSendResult_t Editor_RotateEntity(const char *pszEntity, float x, float y, float z, const QAngle &incrementalRotation, bool bShowUI = false);
  32. EditorSendResult_t Editor_CreateNode(const char *pszNodeClass, int nID, float x, float y, float z, bool bShowUI = false);
  33. EditorSendResult_t Editor_DeleteNode(int nID, bool bShowUI = false);
  34. EditorSendResult_t Editor_CreateNodeLink(int nStartID, int nEndID, bool bShowUI = false);
  35. EditorSendResult_t Editor_DeleteNodeLink(int nStartID, int nEndID, bool bShowUI = false);
  36. //
  37. // Actually does the work. All the above commands route through this.
  38. //
  39. EditorSendResult_t Editor_SendCommand(const char *pszCommand, bool bShowUI);
  40. #endif // EDITOR_SENDCOMMAND_H