EditorEvents.ts 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. //
  2. // Copyright (c) 2014-2016 THUNDERBEAST GAMES LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to deal
  6. // in the Software without restriction, including without limitation the rights
  7. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. // copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. // THE SOFTWARE.
  21. //
  22. // TODO: migrate these interfaces out to the d.ts and migrate the static strings to some common location
  23. export const ModalError = "ModalError";
  24. export interface ModalErrorEvent {
  25. title: string;
  26. message: string;
  27. }
  28. export const PlayerStartRequest = "EditorPlayRequest";
  29. export const PlayerStarted = "EditorPlayerStarted";
  30. export const PlayerStopped = "EditorPlayerStopped";
  31. export const PlayerPaused = "EditorPlayerPaused";
  32. export const PlayerResumed = "EditorPlayerResumed";
  33. export const PlayerLog = "EditorPlayerLog";
  34. export interface PlayerLogEvent {
  35. message: string;
  36. level: number;
  37. }
  38. export const ActiveSceneEditorChange = "EditorActiveSceneEditorChange";
  39. export interface ActiveSceneEditorChangeEvent {
  40. sceneEditor: Editor.SceneEditor3D;
  41. }
  42. export const SceneClosed = "EditorSceneClosed";
  43. export interface SceneClosedEvent {
  44. scene: Atomic.Scene;
  45. }
  46. export const ContentFolderChanged = "ContentFolderChanged";
  47. export interface ContentFolderChangedEvent {
  48. path: string;
  49. }
  50. export const CloseProject = "EditorCloseProject";
  51. export const ProjectClosed = "EditorProjectClosed";
  52. export const ProjectUnloadedNotification = "ProjectUnloadedNotification";
  53. export const LoadProject = "EditorLoadProject";
  54. export const LoadProjectNotification = "EditorLoadProjectNotification";
  55. export interface LoadProjectEvent {
  56. // The full path to the .atomic file
  57. path: string;
  58. }
  59. export const SaveAllResources = "EditorSaveAllResources";
  60. export const SaveResource = "EditorSaveResource";
  61. /**
  62. * Called once the resource has been saved
  63. * @type {String}
  64. */
  65. export const SaveResourceNotification = "EditorSaveResourceNotification";
  66. export interface SaveResourceEvent {
  67. // The full path to the resource to save / empty or undefined for current
  68. path: string;
  69. }
  70. export const EditorResourceClose = "EditorResourceClose";
  71. export interface EditorCloseResourceEvent {
  72. editor:Editor.ResourceEditor;
  73. navigateToAvailableResource:boolean;
  74. }
  75. export const EditResource = "EditorEditResource";
  76. export interface EditResourceEvent {
  77. // The full path to the resource to edit
  78. path: string;
  79. }
  80. export const DeleteResource = "EditorDeleteResource";
  81. /**
  82. * Called once the resource has been deleted
  83. * @type {String}
  84. */
  85. export const DeleteResourceNotification = "DeleteResourceNotification";
  86. export interface DeleteResourceEvent {
  87. // The full path to the resource to edit
  88. path: string;
  89. }
  90. export const RenameResource = "EditorRenameResource";
  91. /**
  92. * Called once the resource has been renamed
  93. * @type {String}
  94. */
  95. export const RenameResourceNotification = "RenameResourceNotification";
  96. export interface RenameResourceEvent {
  97. // The full path to the resource to edit
  98. path: string;
  99. newPath: string;
  100. newName: string;
  101. // the asset to delete
  102. asset: ToolCore.Asset;
  103. }
  104. export const SceneEditStateChange = "SceneEditStateChange";
  105. export interface SceneEditStateChangeEvent {
  106. serializable: Atomic.Serializable;
  107. }
  108. export const InspectorProjectReference = "InspectorProjectReference";
  109. export interface InspectorProjectReferenceEvent {
  110. // The full path to the resource to edit
  111. path: string;
  112. }
  113. export const RemoveCurrentAssetAssigned = "RemoveCurrentAssetAssigned";
  114. export interface RemoveCurrentAssetAssignedEvent {
  115. }
  116. export const UserPreferencesChangedNotification = "UserPreferencesChangedNotification";
  117. export const WebViewLoadEnd = "WebViewLoadEnd";
  118. export const WebMessage = "WebMessage";