AEEditorEvents.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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. #pragma once
  23. #include <Atomic/Core/Object.h>
  24. using namespace Atomic;
  25. namespace AtomicEditor
  26. {
  27. static const unsigned FINDTEXT_FLAG_NONE = 0x0;
  28. static const unsigned FINDTEXT_FLAG_CASESENSITIVE = 0x1;
  29. static const unsigned FINDTEXT_FLAG_WHOLEWORD = 0x2;
  30. static const unsigned FINDTEXT_FLAG_WRAP = 0x4;
  31. static const unsigned FINDTEXT_FLAG_NEXT = 0x8;
  32. static const unsigned FINDTEXT_FLAG_PREV = 0x10;
  33. // emitted when the play button has been pressed in the editor, but the player has not yet started
  34. ATOMIC_EVENT(E_EDITORPLAYREQUEST, EditorPlayRequest)
  35. {
  36. ATOMIC_PARAM(P_MODE, Mode); // uint (AEPlayerMode)
  37. }
  38. // Called when the active resource editor has changed
  39. ATOMIC_EVENT(E_EDITORRESOURCEEDITORCHANGED, EditorResourceEditorChanged)
  40. {
  41. ATOMIC_PARAM(P_RESOURCEEDITOR, ResourceEditor); // ResourceEditor*
  42. }
  43. // emitted once play has started
  44. ATOMIC_EVENT(E_EDITORPLAYERSTARTED, EditorPlayerStarted)
  45. {
  46. ATOMIC_PARAM(P_MODE, Mode); // uint (AEPlayerMode)
  47. }
  48. // emitted once player has paused
  49. ATOMIC_EVENT(E_EDITORPLAYERPAUSED, EditorPlayerPaused)
  50. {
  51. }
  52. // emitted once paused player has resumed
  53. ATOMIC_EVENT(E_EDITORPLAYERRESUMED, EditorPlayerResumed)
  54. {
  55. }
  56. // emitted once play has stopped
  57. ATOMIC_EVENT(E_EDITORPLAYERSTOPPED, EditorPlayerStopped)
  58. {
  59. }
  60. // NOT CURRENTLY WIRED
  61. ATOMIC_EVENT(E_EDITORBUILD, EditorBuild)
  62. {
  63. ATOMIC_PARAM(P_PLATFORM, Platform); // string
  64. ATOMIC_PARAM(P_BUILDPATH, BuildPath); // string
  65. }
  66. // TODO: consolidate all errors to use this message
  67. static const unsigned EDITOR_MODALERROR = 0x1;
  68. static const unsigned EDITOR_MODALINFO = 0x2;
  69. // emitted to display a modal message in the editor
  70. ATOMIC_EVENT(E_EDITORMODAL, EditorModal)
  71. {
  72. ATOMIC_PARAM(P_TYPE, Type); // uint (Type can be EDITOR_MODALERROR, EDITOR_MODAL_INFOT)
  73. ATOMIC_PARAM(P_TITLE, Title); // string (for modal errors, title text)
  74. ATOMIC_PARAM(P_MESSAGE, Message); // string (for modal errors, error text)
  75. }
  76. // emitted when a Scene editor gains focus. Could be null.
  77. ATOMIC_EVENT(E_EDITORACTIVESCENEEDITORCHANGE, EditorActiveSceneEditorChange)
  78. {
  79. ATOMIC_PARAM(P_SCENEEDITOR, SceneEditor); // SceneEditor3D pointer
  80. }
  81. // NOTE: This is not triggered by anything
  82. ATOMIC_EVENT(E_EDITORSCENECLOSED, EditorSceneClosed)
  83. {
  84. ATOMIC_PARAM(P_SCENE, Scene); // Scene pointer
  85. }
  86. // emitted when a subprocess logs information to the console
  87. ATOMIC_EVENT(E_SUBPROCESSOUTPUT, SubprocessOutput)
  88. {
  89. ATOMIC_PARAM(P_TEXT, Text); // string
  90. }
  91. // emitted when a subprocess has completed
  92. ATOMIC_EVENT(E_SUBPROCESSCOMPLETE, SubprocessComplete)
  93. {
  94. ATOMIC_PARAM(P_PROCESSKEY, ProcessKey); // unsigned
  95. ATOMIC_PARAM(P_RETCODE, RetCode); // int (return code of process)
  96. }
  97. // Command called to load a new project
  98. ATOMIC_EVENT(E_EDITORLOADPROJECT, EditorLoadProject)
  99. {
  100. ATOMIC_PARAM(P_PATH, Path); // string
  101. }
  102. // emitted once a content folder has been refreshed
  103. ATOMIC_EVENT(E_CONTENTFOLDERCHANGED, ContentFolderChanged)
  104. {
  105. ATOMIC_PARAM(P_PATH, Path); // string
  106. }
  107. // emitted when the editor has been requested to close the current project.
  108. ATOMIC_EVENT(E_EDITORCLOSEPROJECT, EditorCloseProject)
  109. {
  110. }
  111. // emitted once a project has completed closing
  112. ATOMIC_EVENT(E_EDITORPROJECTCLOSED, EditorProjectClosed)
  113. {
  114. }
  115. // command to save all the open editors
  116. ATOMIC_EVENT(E_EDITORSAVEALLRESOURCES, EditorSaveAllResources)
  117. {
  118. }
  119. // command to save a specific resource
  120. ATOMIC_EVENT(E_EDITORSAVERESOURCE, EditorSaveResource)
  121. {
  122. ATOMIC_PARAM(P_PATH, Path); // string full path of the current resource
  123. }
  124. // emitted once the resource has been saved
  125. ATOMIC_EVENT(E_EDITORSAVERESOURCENOTIFICATION, EditorSaveResourceNotification)
  126. {
  127. ATOMIC_PARAM(P_PATH, Path); // string
  128. }
  129. // emitted when a resource gains focus
  130. ATOMIC_EVENT(E_EDITOREDITRESOURCE, EditorEditResource)
  131. {
  132. ATOMIC_PARAM(P_PATH, Path); // string
  133. ATOMIC_PARAM(P_LINENUMBER, LineNumber); // int optional
  134. }
  135. // command to delete a resource
  136. ATOMIC_EVENT(E_EDITORDELETERESOURCE, EditorDeleteResource)
  137. {
  138. ATOMIC_PARAM(P_PATH, Path); // string
  139. }
  140. // emitted once the resource has been deleted
  141. ATOMIC_EVENT(E_EDITORDELETERESOURCENOTIFICATION, EditorDeleteResourceNotification)
  142. {
  143. ATOMIC_PARAM(P_PATH, Path); // string
  144. }
  145. // emitted when a resource has been renamed
  146. ATOMIC_EVENT(E_EDITORRENAMERESOURCENOTIFICATION, EditorRenameResourceNotification)
  147. {
  148. ATOMIC_PARAM(P_PATH, Path); // string (full path of the old resource)
  149. ATOMIC_PARAM(P_NEWPATH, NewPath); // string (full path of the new resource)
  150. ATOMIC_PARAM(P_NEWNAME, NewName); // string (new name of resource)
  151. ATOMIC_PARAM(P_ASSET, Asset); // ToolCore.Asset pointer
  152. }
  153. // emitted when user preferences have been changed
  154. ATOMIC_EVENT(E_USERPREFERENCESCHANGEDNOTIFICATION, UserPreferencesChangedNotification)
  155. {
  156. ATOMIC_PARAM(P_PROJECTPREFERENCES, ProjectPreferences); // string (JSON object)
  157. ATOMIC_PARAM(P_APPLICATIONPREFERENCES, ApplicationPreferences); // string (JSON object)
  158. }
  159. // emitted when an item is selected in a scene
  160. ATOMIC_EVENT(E_INSPECTORPROJECTREFERENCE, InspectorProjectReference)
  161. {
  162. ATOMIC_PARAM(P_PATH, Path); // string (Full path of the resource to edit)
  163. }
  164. // emitted when a component attribute has been changed
  165. ATOMIC_EVENT(E_ATTRIBUTEEDITRESOURCECHANGED, AttributeEditResourceChanged)
  166. {
  167. ATOMIC_PARAM(P_ATTRINFOEDIT, AttrInfoEdit); // AttrbuteInfoEdit window
  168. ATOMIC_PARAM(P_RESOURCE, Resource); // Resource pointer
  169. }
  170. // emitted when the built in player logs something
  171. ATOMIC_EVENT(E_EDITORPLAYERLOG, EditorPlayerLog)
  172. {
  173. ATOMIC_PARAM(P_MESSAGE, Message); // string
  174. ATOMIC_PARAM(P_LEVEL, Level); // int
  175. }
  176. // emitted right before a project is unloaded
  177. ATOMIC_EVENT(E_PROJECTUNLOADEDNOTIFICATION, ProjectUnloadedNotification)
  178. {
  179. }
  180. // command to load a new project
  181. ATOMIC_EVENT(E_REQUESTPROJECTLOAD, RequestProjectLoad)
  182. {
  183. ATOMIC_PARAM(P_PATH, Path); // string (Full path to the .atomic file)
  184. }
  185. // emitted once a project has been loaded
  186. ATOMIC_EVENT(E_LOADPROJECTNOTIFICATION,LoadProjectNotification)
  187. {
  188. ATOMIC_PARAM(P_PATH, Path); // string (Full path to the .atomic file)
  189. }
  190. }