Browse Source

First cut at converting all event handling to the new event model

Shaddock Heath 9 years ago
parent
commit
d97ec9157d
61 changed files with 488 additions and 318 deletions
  1. 18 18
      Script/AtomicEditor/editor/Editor.ts
  2. 130 15
      Script/AtomicEditor/editor/EditorEvents.ts
  3. 2 2
      Script/AtomicEditor/editor/EditorLicense.ts
  4. 11 11
      Script/AtomicEditor/hostExtensions/HostExtensionServices.ts
  5. 10 2
      Script/AtomicEditor/hostExtensions/ServiceLocator.ts
  6. 2 2
      Script/AtomicEditor/hostExtensions/languageExtensions/CSharpLanguageExtension.ts
  7. 3 3
      Script/AtomicEditor/resources/ResourceOps.ts
  8. 3 3
      Script/AtomicEditor/ui/AnimationToolbar.ts
  9. 7 7
      Script/AtomicEditor/ui/EditorUI.ts
  10. 16 16
      Script/AtomicEditor/ui/MainToolbar.ts
  11. 1 1
      Script/AtomicEditor/ui/ScriptWidget.ts
  12. 7 7
      Script/AtomicEditor/ui/Shortcuts.ts
  13. 13 1
      Script/AtomicEditor/ui/UIEvents.ts
  14. 29 29
      Script/AtomicEditor/ui/frames/HierarchyFrame.ts
  15. 5 5
      Script/AtomicEditor/ui/frames/MainFrame.ts
  16. 11 11
      Script/AtomicEditor/ui/frames/ProjectFrame.ts
  17. 10 10
      Script/AtomicEditor/ui/frames/ResourceFrame.ts
  18. 2 2
      Script/AtomicEditor/ui/frames/WelcomeFrame.ts
  19. 1 1
      Script/AtomicEditor/ui/frames/inspector/ArrayEditWidget.ts
  20. 1 1
      Script/AtomicEditor/ui/frames/inspector/AssemblyInspector.ts
  21. 30 30
      Script/AtomicEditor/ui/frames/inspector/AttributeInfoEdit.ts
  22. 1 1
      Script/AtomicEditor/ui/frames/inspector/CSComponentClassSelector.ts
  23. 10 10
      Script/AtomicEditor/ui/frames/inspector/ColorChooser.ts
  24. 10 10
      Script/AtomicEditor/ui/frames/inspector/ComponentAttributeUI.ts
  25. 2 2
      Script/AtomicEditor/ui/frames/inspector/CreateComponentButton.ts
  26. 4 4
      Script/AtomicEditor/ui/frames/inspector/InspectorFrame.ts
  27. 1 1
      Script/AtomicEditor/ui/frames/inspector/InspectorWidget.ts
  28. 9 9
      Script/AtomicEditor/ui/frames/inspector/MaterialInspector.ts
  29. 3 3
      Script/AtomicEditor/ui/frames/inspector/ModelInspector.ts
  30. 1 1
      Script/AtomicEditor/ui/frames/inspector/PrefabInspector.ts
  31. 17 23
      Script/AtomicEditor/ui/frames/inspector/SelectionInspector.ts
  32. 5 5
      Script/AtomicEditor/ui/frames/inspector/SelectionPrefabWidget.ts
  33. 4 4
      Script/AtomicEditor/ui/frames/inspector/SelectionSectionCoreUI.ts
  34. 5 5
      Script/AtomicEditor/ui/frames/inspector/SerializableEditType.ts
  35. 1 1
      Script/AtomicEditor/ui/frames/inspector/TextureSelector.ts
  36. 7 7
      Script/AtomicEditor/ui/frames/menus/HierarchyFrameMenu.ts
  37. 5 5
      Script/AtomicEditor/ui/frames/menus/MainFrameMenu.ts
  38. 2 2
      Script/AtomicEditor/ui/frames/menus/ProjectFrameMenu.ts
  39. 2 2
      Script/AtomicEditor/ui/modal/MessageModal.ts
  40. 2 2
      Script/AtomicEditor/ui/modal/ModalOps.ts
  41. 3 3
      Script/AtomicEditor/ui/modal/ModalWindow.ts
  42. 1 1
      Script/AtomicEditor/ui/modal/ResourceSelection.ts
  43. 1 1
      Script/AtomicEditor/ui/modal/build/BuildComplete.ts
  44. 4 4
      Script/AtomicEditor/ui/modal/build/BuildOutput.ts
  45. 3 3
      Script/AtomicEditor/ui/modal/build/BuildSettingsWindow.ts
  46. 1 1
      Script/AtomicEditor/ui/modal/build/BuildWindow.ts
  47. 3 3
      Script/AtomicEditor/ui/modal/build/platforms/AndroidSettingsWidget.ts
  48. 1 1
      Script/AtomicEditor/ui/modal/build/platforms/IOSSettingsWidget.ts
  49. 1 1
      Script/AtomicEditor/ui/modal/build/platforms/WebSettingsWidget.ts
  50. 2 2
      Script/AtomicEditor/ui/modal/license/EULAWindow.ts
  51. 3 3
      Script/AtomicEditor/ui/playmode/PlayMode.ts
  52. 2 2
      Script/AtomicEditor/ui/playmode/PlayerOutput.ts
  53. 6 6
      Script/AtomicEditor/ui/resourceEditors/AbstractTextResourceEditorBuilder.ts
  54. 1 1
      Script/AtomicNET/AtomicNETService/Program.cs
  55. 14 5
      Script/AtomicWebViewEditor/clientExtensions/ClientExtensionServices.ts
  56. 8 2
      Script/AtomicWebViewEditor/clientExtensions/ServiceLocator.ts
  57. 4 2
      Script/TypeScript/AtomicWork.d.ts
  58. 7 1
      Script/TypeScript/EditorWork.d.ts
  59. 4 1
      Source/Atomic/UI/UIEvents.h
  60. 15 0
      Source/AtomicEditor/Editors/SceneEditor3D/SceneEditor3DEvents.h
  61. 1 1
      Source/ToolCore/JSBind/JSBTypeScript.cpp

+ 18 - 18
Script/AtomicEditor/editor/Editor.ts

@@ -61,14 +61,14 @@ class Editor extends Atomic.ScriptObject {
 
 
         Atomic.getResourceCache().autoReloadResources = true;
         Atomic.getResourceCache().autoReloadResources = true;
 
 
-        this.subscribeToEvent(EditorEvents.LoadProject, (data) => this.handleEditorLoadProject(data));
-        this.subscribeToEvent(EditorEvents.CloseProject, (data) => this.handleEditorCloseProject(data));
-        this.subscribeToEvent(EditorEvents.ProjectUnloadedNotification, (data) => {
+        this.subscribeToEvent(EditorEvents.LoadProjectEvent((data) => this.handleEditorLoadProject(data)));
+        this.subscribeToEvent(EditorEvents.CloseProjectEvent((data) => this.handleEditorCloseProject(data)));
+        this.subscribeToEvent(EditorEvents.ProjectUnloadedNotificationEvent((data) => {
             Atomic.graphics.windowTitle = "AtomicEditor";
             Atomic.graphics.windowTitle = "AtomicEditor";
             this.handleProjectUnloaded(data);
             this.handleProjectUnloaded(data);
-        });
+        }));
 
 
-        this.subscribeToEvent("IPCPlayerWindowChanged", (data) => {
+        this.subscribeToEvent(Atomic.ScriptEvent("IPCPlayerWindowChanged", /*AtomicApp.IPCPlayerWindowChangedEvent(*/ (data: AtomicApp.IPCPlayerWindowChangedEvent) => {
             var playerWindow = Preferences.getInstance().playerWindow;
             var playerWindow = Preferences.getInstance().playerWindow;
             //if player window is maximized, then we want keep the window size from the previous state
             //if player window is maximized, then we want keep the window size from the previous state
             if (data.maximized) {
             if (data.maximized) {
@@ -80,25 +80,25 @@ class Editor extends Atomic.ScriptObject {
                 playerWindow = {x: data.posX, y: data.posY, width: data.width, height: data.height, monitor: data.monitor, maximized: data.maximized};
                 playerWindow = {x: data.posX, y: data.posY, width: data.width, height: data.height, monitor: data.monitor, maximized: data.maximized};
             }
             }
             Preferences.getInstance().savePlayerWindowData(playerWindow);
             Preferences.getInstance().savePlayerWindowData(playerWindow);
-        });
+        }));
 
 
-        this.subscribeToEvent("ScreenMode", (data:Atomic.ScreenModeEvent) => this.saveWindowPreferences(data));
-        this.subscribeToEvent("WindowPos", (data:Atomic.ScreenModeEvent) => this.saveWindowPreferences(data));
+        this.subscribeToEvent(Atomic.ScreenModeEvent((data) => this.saveWindowPreferences()));
+        this.subscribeToEvent(Atomic.WindowPosEvent((data) => this.saveWindowPreferences()));
 
 
-        this.subscribeToEvent("ExitRequested", (data) => this.handleExitRequested(data));
+        this.subscribeToEvent(Atomic.ExitRequestedEvent((data) => this.handleExitRequested(data)));
 
 
-        this.subscribeToEvent("ProjectLoaded", (data) => {
+        this.subscribeToEvent(ToolCore.ProjectLoadedEvent((data) => {
             Atomic.graphics.windowTitle = "AtomicEditor - " + data.projectPath;
             Atomic.graphics.windowTitle = "AtomicEditor - " + data.projectPath;
             Preferences.getInstance().registerRecentProject(data.projectPath);
             Preferences.getInstance().registerRecentProject(data.projectPath);
-        });
+        }));
 
 
-        this.subscribeToEvent("EditorResourceCloseCanceled", (data) => {
+        this.subscribeToEvent(EditorEvents.EditorResourceCloseCanceledEvent((data) => {
             //if user canceled closing the resource, then user has changes that he doesn't want to lose
             //if user canceled closing the resource, then user has changes that he doesn't want to lose
             //so cancel exit/project close request and unsubscribe from event to avoid closing all the editors again
             //so cancel exit/project close request and unsubscribe from event to avoid closing all the editors again
             this.exitRequested = false;
             this.exitRequested = false;
             this.projectCloseRequested = false;
             this.projectCloseRequested = false;
             this.unsubscribeFromEvent(EditorEvents.EditorResourceClose);
             this.unsubscribeFromEvent(EditorEvents.EditorResourceClose);
-        });
+        }));
 
 
         this.parseArguments();
         this.parseArguments();
     }
     }
@@ -112,7 +112,7 @@ class Editor extends Atomic.ScriptObject {
         ui.setDefaultFont(uiData.fontName, uiData.fontSize);
         ui.setDefaultFont(uiData.fontName, uiData.fontSize);
     }
     }
 
 
-    saveWindowPreferences(data: Atomic.ScreenModeEvent): boolean {
+    saveWindowPreferences(): boolean {
         var graphics = Atomic.getGraphics();
         var graphics = Atomic.getGraphics();
         if (!graphics) return false;
         if (!graphics) return false;
 
 
@@ -192,7 +192,7 @@ class Editor extends Atomic.ScriptObject {
         var system = ToolCore.getToolSystem();
         var system = ToolCore.getToolSystem();
         if (system.project) {
         if (system.project) {
 
 
-            this.sendEvent(UIEvents.MessageModalEvent,
+            this.sendEvent(UIEvents.MessageModalEventName,
                 { type: "error", title: "Project already loaded", message: "Project already loaded" });
                 { type: "error", title: "Project already loaded", message: "Project already loaded" });
 
 
             return false;
             return false;
@@ -219,9 +219,9 @@ class Editor extends Atomic.ScriptObject {
           return;
           return;
         }
         }
         //wait when we close resource editor to check another resource editor for unsaved changes and close it
         //wait when we close resource editor to check another resource editor for unsaved changes and close it
-        this.subscribeToEvent(EditorEvents.EditorResourceClose, (data) => {
+        this.subscribeToEvent(EditorEvents.EditorResourceCloseEvent((data) => {
             this.closeAllResourceEditors();
             this.closeAllResourceEditors();
-        });
+        }));
         editor.requestClose();
         editor.requestClose();
     }
     }
 
 
@@ -232,7 +232,7 @@ class Editor extends Atomic.ScriptObject {
     }
     }
 
 
     closeProject() {
     closeProject() {
-        this.sendEvent("IPCPlayerExitRequest");
+        this.sendEvent("IPCPlayerExitRequest" /*AtomicApp.IPCPlayerExitRequestEventName*/);
         var system = ToolCore.getToolSystem();
         var system = ToolCore.getToolSystem();
 
 
         if (system.project) {
         if (system.project) {

+ 130 - 15
Script/AtomicEditor/editor/EditorEvents.ts

@@ -22,19 +22,42 @@
 
 
 // TODO: migrate these interfaces out to the d.ts and migrate the static strings to some common location
 // TODO: migrate these interfaces out to the d.ts and migrate the static strings to some common location
 export const ModalError = "ModalError";
 export const ModalError = "ModalError";
-export interface ModalErrorEvent {
+export function ModalErrorEvent(callback: Atomic.EventCallback<ModalErrorEvent>) {
+    return Atomic.ScriptEvent(ModalError, callback);
+}
+export interface ModalErrorEvent extends Atomic.EventMetaData {
 
 
   title: string;
   title: string;
   message: string;
   message: string;
 
 
 }
 }
 export const PlayerStartRequest = "EditorPlayRequest";
 export const PlayerStartRequest = "EditorPlayRequest";
+export function PlayerStartRequestEvent(callback: Atomic.EventCallback<null>) {
+    return Atomic.ScriptEvent(PlayerStartRequest, callback);
+}
 export const PlayerStarted = "EditorPlayerStarted";
 export const PlayerStarted = "EditorPlayerStarted";
+export function PlayerStartedEvent(callback: Atomic.EventCallback<null>) {
+    return Atomic.ScriptEvent(PlayerStarted, callback);
+}
+
 export const PlayerStopped = "EditorPlayerStopped";
 export const PlayerStopped = "EditorPlayerStopped";
+export function PlayerStoppedEvent(callback: Atomic.EventCallback<null>) {
+    return Atomic.ScriptEvent(PlayerStopped, callback);
+}
+
 export const PlayerPaused = "EditorPlayerPaused";
 export const PlayerPaused = "EditorPlayerPaused";
+export function PlayerPausedEvent(callback: Atomic.EventCallback<null>) {
+    return Atomic.ScriptEvent(PlayerPaused, callback);
+}
 export const PlayerResumed = "EditorPlayerResumed";
 export const PlayerResumed = "EditorPlayerResumed";
+export function PlayerResumedEvent(callback: Atomic.EventCallback<null>) {
+    return Atomic.ScriptEvent(PlayerPaused, callback);
+}
 export const PlayerLog = "EditorPlayerLog";
 export const PlayerLog = "EditorPlayerLog";
-export interface PlayerLogEvent {
+export function PlayerLogEvent(callback: Atomic.EventCallback<PlayerLogEvent>) {
+    return Atomic.ScriptEvent(PlayerLog, callback);
+}
+export interface PlayerLogEvent extends Atomic.EventMetaData {
 
 
   message: string;
   message: string;
   level: number;
   level: number;
@@ -43,7 +66,10 @@ export interface PlayerLogEvent {
 
 
 
 
 export const ActiveSceneEditorChange = "EditorActiveSceneEditorChange";
 export const ActiveSceneEditorChange = "EditorActiveSceneEditorChange";
-export interface ActiveSceneEditorChangeEvent {
+export function ActiveSceneEditorChangeEvent(callback: Atomic.EventCallback<ActiveSceneEditorChangeEvent>) {
+    return Atomic.ScriptEvent(ActiveSceneEditorChange, callback);
+}
+export interface ActiveSceneEditorChangeEvent extends Atomic.EventMetaData {
 
 
   sceneEditor: Editor.SceneEditor3D;
   sceneEditor: Editor.SceneEditor3D;
 
 
@@ -51,34 +77,63 @@ export interface ActiveSceneEditorChangeEvent {
 
 
 
 
 export const SceneClosed = "EditorSceneClosed";
 export const SceneClosed = "EditorSceneClosed";
-export interface SceneClosedEvent {
+export function SceneClosedEvent(callback: Atomic.EventCallback<SceneClosedEvent>) {
+    return Atomic.ScriptEvent(SceneClosed, callback);
+}
+export interface SceneClosedEvent extends Atomic.EventMetaData {
 
 
   scene: Atomic.Scene;
   scene: Atomic.Scene;
 
 
 }
 }
 
 
 export const ContentFolderChanged = "ContentFolderChanged";
 export const ContentFolderChanged = "ContentFolderChanged";
-export interface ContentFolderChangedEvent {
+export function ContentFolderChangedEvent(callback: Atomic.EventCallback<ContentFolderChangedEvent>) {
+    return Atomic.ScriptEvent(ContentFolderChanged, callback);
+}
+export interface ContentFolderChangedEvent extends Atomic.EventMetaData {
 
 
   path: string;
   path: string;
 
 
 }
 }
 
 
 export const CloseProject = "EditorCloseProject";
 export const CloseProject = "EditorCloseProject";
+export function CloseProjectEvent(callback: Atomic.EventCallback<null>) {
+    return Atomic.ScriptEvent(CloseProject, callback);
+}
 export const ProjectClosed = "EditorProjectClosed";
 export const ProjectClosed = "EditorProjectClosed";
+export function ProjectClosedEvent(callback: Atomic.EventCallback<null>) {
+    return Atomic.ScriptEvent(ProjectClosed, callback);
+}
 export const ProjectUnloadedNotification = "ProjectUnloadedNotification";
 export const ProjectUnloadedNotification = "ProjectUnloadedNotification";
+export function ProjectUnloadedNotificationEvent(callback: Atomic.EventCallback<null>){
+    return Atomic.ScriptEvent(ProjectUnloadedNotification, callback);
+}
 
 
 export const RequestProjectLoad = "RequestProjectLoad";
 export const RequestProjectLoad = "RequestProjectLoad";
-export interface RequestProjectLoadEvent {
+export function RequestProjectLoadEvent(callback: Atomic.EventCallback<RequestProjectLoadEvent>) {
+    return Atomic.ScriptEvent(RequestProjectLoad, callback);
+}
+export interface RequestProjectLoadEvent extends Atomic.EventMetaData {
 
 
   // The full path to the .atomic file
   // The full path to the .atomic file
   path: string;
   path: string;
 
 
 }
 }
 
 
+export const ProjectLoaded = "ProjectLoaded";
+export function ProjectLoadedEvent(callback: Atomic.EventCallback<null>) {
+    return Atomic.ScriptEvent(ProjectLoaded, callback);
+}
+
 export const LoadProject = "EditorLoadProject";
 export const LoadProject = "EditorLoadProject";
+export function LoadProjectEvent(callback: Atomic.EventCallback<LoadProjectEvent>) {
+    return Atomic.ScriptEvent(LoadProject, callback);
+}
 export const LoadProjectNotification = "EditorLoadProjectNotification";
 export const LoadProjectNotification = "EditorLoadProjectNotification";
-export interface LoadProjectEvent {
+export function LoadProjectNotificationEvent(callback: Atomic.EventCallback<LoadProjectEvent>) {
+    return Atomic.ScriptEvent(LoadProjectNotification, callback);
+}
+export interface LoadProjectEvent extends Atomic.EventMetaData {
 
 
   // The full path to the .atomic file
   // The full path to the .atomic file
   path: string;
   path: string;
@@ -86,22 +141,39 @@ export interface LoadProjectEvent {
 }
 }
 
 
 export const SaveAllResources = "EditorSaveAllResources";
 export const SaveAllResources = "EditorSaveAllResources";
+export function SaveAllResourcesEvent(callback: Atomic.EventCallback<null>) {
+    return Atomic.ScriptEvent(SaveAllResources, callback);
+}
 
 
 export const SaveResource = "EditorSaveResource";
 export const SaveResource = "EditorSaveResource";
+export function SaveResourceEvent(callback: Atomic.EventCallback<SaveResourceEvent>) {
+    return Atomic.ScriptEvent(SaveResource, callback);
+}
 /**
 /**
  * Called once the resource has been saved
  * Called once the resource has been saved
  * @type {String}
  * @type {String}
  */
  */
 export const SaveResourceNotification = "EditorSaveResourceNotification";
 export const SaveResourceNotification = "EditorSaveResourceNotification";
-export interface SaveResourceEvent {
+export function SaveResourceNotificationEvent(callback: Atomic.EventCallback<SaveResourceEvent>) {
+    return Atomic.ScriptEvent(SaveResourceNotification, callback);
+}
+export interface SaveResourceEvent extends Atomic.EventMetaData {
 
 
   // The full path to the resource to save / empty or undefined for current
   // The full path to the resource to save / empty or undefined for current
   path: string;
   path: string;
 
 
 }
 }
 
 
+export const EditorResourceCloseCanceled = "EditorResourceCloseCanceled";
+export function EditorResourceCloseCanceledEvent(callback: Atomic.EventCallback<null>) {
+    return Atomic.ScriptEvent(EditorResourceCloseCanceled, callback);
+}
+
 export const EditorResourceClose = "EditorResourceClose";
 export const EditorResourceClose = "EditorResourceClose";
-export interface EditorCloseResourceEvent {
+export function EditorResourceCloseEvent(callback: Atomic.EventCallback<EditorCloseResourceEvent>) {
+    return Atomic.ScriptEvent(EditorResourceClose, callback);
+}
+export interface EditorCloseResourceEvent extends Atomic.EventMetaData {
 
 
   editor:Editor.ResourceEditor;
   editor:Editor.ResourceEditor;
   navigateToAvailableResource:boolean;
   navigateToAvailableResource:boolean;
@@ -109,7 +181,10 @@ export interface EditorCloseResourceEvent {
 }
 }
 
 
 export const EditResource = "EditorEditResource";
 export const EditResource = "EditorEditResource";
-export interface EditResourceEvent {
+export function EditResourceEvent(callback: Atomic.EventCallback<EditResourceEvent>) {
+    return Atomic.ScriptEvent(EditResource, callback);
+}
+export interface EditResourceEvent extends Atomic.EventMetaData {
 
 
   // The full path to the resource to edit
   // The full path to the resource to edit
   path: string;
   path: string;
@@ -122,7 +197,10 @@ export const DeleteResource = "EditorDeleteResource";
  * @type {String}
  * @type {String}
  */
  */
 export const DeleteResourceNotification = "DeleteResourceNotification";
 export const DeleteResourceNotification = "DeleteResourceNotification";
-export interface DeleteResourceEvent {
+export function DeleteResourceNotificationEvent(callback: Atomic.EventCallback<DeleteResourceEvent>) {
+    return Atomic.ScriptEvent(DeleteResourceNotification, callback);
+}
+export interface DeleteResourceEvent extends Atomic.EventMetaData {
 
 
   // The full path to the resource to edit
   // The full path to the resource to edit
   path: string;
   path: string;
@@ -135,7 +213,10 @@ export const RenameResource = "EditorRenameResource";
  * @type {String}
  * @type {String}
  */
  */
 export const RenameResourceNotification = "RenameResourceNotification";
 export const RenameResourceNotification = "RenameResourceNotification";
-export interface RenameResourceEvent {
+export function RenameResourceNotificationEvent(callback: Atomic.EventCallback<RenameResourceEvent>) {
+    return Atomic.ScriptEvent(RenameResourceNotification, callback);
+}
+export interface RenameResourceEvent extends Atomic.EventMetaData {
 
 
   // The full path to the resource to edit
   // The full path to the resource to edit
   path: string;
   path: string;
@@ -154,7 +235,10 @@ export interface SceneEditStateChangeEvent {
 }
 }
 
 
 export const InspectorProjectReference = "InspectorProjectReference";
 export const InspectorProjectReference = "InspectorProjectReference";
-export interface InspectorProjectReferenceEvent {
+export function InspectorProjectReferenceEvent(callback : Atomic.EventCallback<InspectorProjectReferenceEvent>) {
+    return Atomic.ScriptEvent(InspectorProjectReference, callback);
+}
+export interface InspectorProjectReferenceEvent extends Atomic.EventMetaData {
 
 
     // The full path to the resource to edit
     // The full path to the resource to edit
     path: string;
     path: string;
@@ -162,7 +246,10 @@ export interface InspectorProjectReferenceEvent {
 }
 }
 
 
 export const UserPreferencesChangedNotification  = "UserPreferencesChangedNotification";
 export const UserPreferencesChangedNotification  = "UserPreferencesChangedNotification";
-export interface UserPreferencesChangedEvent {
+export function UserPreferencesChangedNotificationEvent(callback : Atomic.EventCallback<UserPreferencesChangedEvent>) {
+    return Atomic.ScriptEvent(UserPreferencesChangedNotification, callback);
+}
+export interface UserPreferencesChangedEvent extends Atomic.EventMetaData {
     /**
     /**
      * JSON string of the project preferences
      * JSON string of the project preferences
      */
      */
@@ -175,12 +262,40 @@ export interface UserPreferencesChangedEvent {
 }
 }
 
 
 export const WebViewLoadEnd = "WebViewLoadEnd";
 export const WebViewLoadEnd = "WebViewLoadEnd";
+export function WebViewLoadEndEvent(callback : Atomic.EventCallback<null>) {
+    return Atomic.ScriptEvent(WebViewLoadEnd, callback);
+}
 export const WebMessage = "WebMessage";
 export const WebMessage = "WebMessage";
+export function WebMessageEvent(callback: Atomic.EventCallback<WebMessageEvent>) {
+    return Atomic.ScriptEvent(WebMessage, callback);
+}
+export interface WebMessageEvent extends Atomic.EventMetaData {
+    /**
+     * Could be either a JSON formatted object or a simple string
+     * @type {string}
+     */
+    request: string;
+}
 
 
 // interface to pass modal error messages from core modules
 // interface to pass modal error messages from core modules
 export const EditorModal = "EditorModal";
 export const EditorModal = "EditorModal";
-export interface EditorModalEvent {
+export function EditorModalEvent(callback: Atomic.EventCallback<EditorModalEvent>) {
+    return Atomic.ScriptEvent(EditorModal, callback);
+}
+export interface EditorModalEvent extends Atomic.EventMetaData {
     uiType: number;     // EDITOR_ERROR_MODAL, etc)
     uiType: number;     // EDITOR_ERROR_MODAL, etc)
     title: string;      // for modal errors, title text
     title: string;      // for modal errors, title text
     message: string;    // for modal errors, error text
     message: string;    // for modal errors, error text
 }
 }
+
+export const AttributeEditResourceChangedEventName = "AttributeEditResourceChanged";
+export function AttributeEditResourceChangedEvent(callback: Atomic.EventCallback<AttributeEditResourceChangedEvent>) {
+    return Atomic.ScriptEvent(AttributeEditResourceChangedEventName, callback);
+}
+
+export interface AttributeEditResourceChangedEvent extends Atomic.EventMetaData {
+
+    //attrInfoEdit: AttributeInfoEdit;
+    resource: Atomic.Resource;
+
+}

+ 2 - 2
Script/AtomicEditor/editor/EditorLicense.ts

@@ -29,8 +29,8 @@ class EditorLicense extends Atomic.ScriptObject {
 
 
         super();
         super();
 
 
-        this.subscribeToEvent("LicenseEulaRequired", (eventData) => this.handleLicenseEulaRequired(eventData));
-        this.subscribeToEvent("LicenseEulaAccepted", (eventData) => this.handleLicenseEulaAccepted(eventData));
+        this.subscribeToEvent(ToolCore.LicenseEulaRequiredEvent((eventData) => this.handleLicenseEulaRequired(eventData)));
+        this.subscribeToEvent(ToolCore.LicenseEulaAcceptedEvent((eventData) => this.handleLicenseEulaAccepted(eventData)));
 
 
     }
     }
 
 

+ 11 - 11
Script/AtomicEditor/hostExtensions/HostExtensionServices.ts

@@ -71,9 +71,9 @@ export class ProjectServicesProvider extends ServicesProvider<Editor.HostExtensi
      * @param  {Atomic.UIWidget} topLevelWindow The top level window that will be receiving these events
      * @param  {Atomic.UIWidget} topLevelWindow The top level window that will be receiving these events
      */
      */
     subscribeToEvents(eventDispatcher: Editor.Extensions.EventDispatcher) {
     subscribeToEvents(eventDispatcher: Editor.Extensions.EventDispatcher) {
-        eventDispatcher.subscribeToEvent(EditorEvents.LoadProjectNotification, (ev) => this.projectLoaded(ev));
-        eventDispatcher.subscribeToEvent(EditorEvents.CloseProject, (ev) => this.projectUnloaded(ev));
-        eventDispatcher.subscribeToEvent(EditorEvents.PlayerStartRequest, () => this.playerStarted());
+        eventDispatcher.subscribeToEvent(EditorEvents.LoadProjectNotificationEvent((ev) => this.projectLoaded(ev)));
+        eventDispatcher.subscribeToEvent(EditorEvents.CloseProjectEvent((ev) => this.projectUnloaded(ev)));
+        eventDispatcher.subscribeToEvent(EditorEvents.PlayerStartRequestEvent(() => this.playerStarted()));
     }
     }
 
 
     /**
     /**
@@ -177,10 +177,10 @@ export class ResourceServicesProvider extends ServicesProvider<Editor.HostExtens
      * @param  {Atomic.UIWidget} topLevelWindow The top level window that will be receiving these events
      * @param  {Atomic.UIWidget} topLevelWindow The top level window that will be receiving these events
      */
      */
     subscribeToEvents(eventDispatcher: Editor.Extensions.EventDispatcher) {
     subscribeToEvents(eventDispatcher: Editor.Extensions.EventDispatcher) {
-        eventDispatcher.subscribeToEvent(EditorEvents.SaveResourceNotification, (ev) => this.saveResource(ev));
-        eventDispatcher.subscribeToEvent(EditorEvents.DeleteResourceNotification, (ev) => this.deleteResource(ev));
-        eventDispatcher.subscribeToEvent(EditorEvents.RenameResourceNotification, (ev) => this.renameResource(ev));
-        eventDispatcher.subscribeToEvent(EditorEvents.EditResource, (ev) => this.editResource(ev));
+        eventDispatcher.subscribeToEvent(EditorEvents.SaveResourceNotificationEvent((ev) => this.saveResource(ev)));
+        eventDispatcher.subscribeToEvent(EditorEvents.DeleteResourceNotificationEvent((ev) => this.deleteResource(ev)));
+        eventDispatcher.subscribeToEvent(EditorEvents.RenameResourceNotificationEvent((ev) => this.renameResource(ev)));
+        eventDispatcher.subscribeToEvent(EditorEvents.EditResourceEvent((ev) => this.editResource(ev)));
 
 
     }
     }
 
 
@@ -277,8 +277,8 @@ export class SceneServicesProvider extends ServicesProvider<Editor.HostExtension
      * @param  {Atomic.UIWidget} topLevelWindow The top level window that will be receiving these events
      * @param  {Atomic.UIWidget} topLevelWindow The top level window that will be receiving these events
      */
      */
     subscribeToEvents(eventDispatcher: Editor.Extensions.EventDispatcher) {
     subscribeToEvents(eventDispatcher: Editor.Extensions.EventDispatcher) {
-        eventDispatcher.subscribeToEvent(EditorEvents.ActiveSceneEditorChange, (ev) => this.activeSceneEditorChange(ev));
-        eventDispatcher.subscribeToEvent(EditorEvents.SceneClosed, (ev) => this.sceneClosed(ev));
+        eventDispatcher.subscribeToEvent(EditorEvents.ActiveSceneEditorChangeEvent((ev) => this.activeSceneEditorChange(ev)));
+        eventDispatcher.subscribeToEvent(EditorEvents.SceneClosedEvent((ev) => this.sceneClosed(ev)));
     }
     }
 
 
     /**
     /**
@@ -567,7 +567,7 @@ export class UIServicesProvider extends ServicesProvider<Editor.HostExtensions.U
      * Hooks into web messages coming in from web views
      * Hooks into web messages coming in from web views
      * @param  {[String|Object]} data
      * @param  {[String|Object]} data
      */
      */
-    handleWebMessage(data) {
+    handleWebMessage(data: EditorEvents.WebMessageEvent) {
         let messageType;
         let messageType;
         let messageObject;
         let messageObject;
 
 
@@ -598,6 +598,6 @@ export class UIServicesProvider extends ServicesProvider<Editor.HostExtensions.U
      */
      */
     subscribeToEvents(eventDispatcher: Editor.Extensions.EventDispatcher) {
     subscribeToEvents(eventDispatcher: Editor.Extensions.EventDispatcher) {
         // Placeholder for when UI events published by the editor need to be listened for
         // Placeholder for when UI events published by the editor need to be listened for
-        eventDispatcher.subscribeToEvent(EditorEvents.WebMessage, (ev) => this.handleWebMessage(ev));
+        eventDispatcher.subscribeToEvent(EditorEvents.WebMessageEvent((ev) => this.handleWebMessage(ev)));
     }
     }
 }
 }

+ 10 - 2
Script/AtomicEditor/hostExtensions/ServiceLocator.ts

@@ -81,10 +81,18 @@ export class ServiceLocatorType implements Editor.HostExtensions.HostServiceLoca
      * Subscribe to an event and provide a callback.  This can be used by services to subscribe to custom events
      * Subscribe to an event and provide a callback.  This can be used by services to subscribe to custom events
      * @param  {string} eventType
      * @param  {string} eventType
      * @param  {any} callback
      * @param  {any} callback
+     * or
+     * @param {Atomic.EventMetaData} wrappedEvent A Atomic pre-wrapped event object
      */
      */
-    subscribeToEvent(eventType: string, callback: (data: any) => void) {
+    subscribeToEvent(eventType: string, callback: (data: any) => void);
+    subscribeToEvent(wrappedEvent: Atomic.EventMetaData);
+    subscribeToEvent(eventTypeOrWrapped: any, callback?: any) {
         if (this.eventDispatcher) {
         if (this.eventDispatcher) {
-            this.eventDispatcher.subscribeToEvent(eventType, callback);
+            if (callback) {
+                this.eventDispatcher.subscribeToEvent(eventTypeOrWrapped, callback);
+            } else {
+                this.eventDispatcher.subscribeToEvent(eventTypeOrWrapped);
+            }
         }
         }
     }
     }
 }
 }

+ 2 - 2
Script/AtomicEditor/hostExtensions/languageExtensions/CSharpLanguageExtension.ts

@@ -162,7 +162,7 @@ export default class CSharpLanguageExtension implements Editor.HostExtensions.Re
             this.isNETProject = true;
             this.isNETProject = true;
             this.configureNETProjectMenu();
             this.configureNETProjectMenu();
 
 
-            this.eventObject.subscribeToEvent("NETBuildResult", (eventData:ToolCore.NETBuildResultEvent) => {
+            this.eventObject.subscribeToEvent(ToolCore.NETBuildResultEvent((eventData:ToolCore.NETBuildResultEvent) => {
 
 
                 if (!eventData.success) {
                 if (!eventData.success) {
 
 
@@ -182,7 +182,7 @@ export default class CSharpLanguageExtension implements Editor.HostExtensions.Re
 
 
                 }
                 }
 
 
-            });
+            }));
         }
         }
     }
     }
 
 

+ 3 - 3
Script/AtomicEditor/resources/ResourceOps.ts

@@ -30,13 +30,13 @@ class ResourceOps extends Atomic.ScriptObject {
 
 
         super();
         super();
 
 
-        this.subscribeToEvent("AssetImportError", (ev: ToolCore.AssetImportErrorEvent) => {
+        this.subscribeToEvent(ToolCore.AssetImportErrorEvent((ev: ToolCore.AssetImportErrorEvent) => {
 
 
             resourceOps.sendEvent(EditorEvents.ModalError, { title: "Asset Import Error", message: ev.error });
             resourceOps.sendEvent(EditorEvents.ModalError, { title: "Asset Import Error", message: ev.error });
 
 
-        });
+        }));
 
 
-        this.subscribeToEvent(EditorEvents.RequestProjectLoad, (ev: EditorEvents.RequestProjectLoadEvent) => { this.handleRequestProjectLoad(ev); });
+        this.subscribeToEvent(EditorEvents.RequestProjectLoadEvent((ev: EditorEvents.RequestProjectLoadEvent) => { this.handleRequestProjectLoad(ev); }));
 
 
     }
     }
 
 

+ 3 - 3
Script/AtomicEditor/ui/AnimationToolbar.ts

@@ -38,9 +38,9 @@ class AnimationToolbar extends Atomic.UIWidget {
         this.leftAnimContainer = <Atomic.UILayout>this.getWidget("leftanimcontainer");
         this.leftAnimContainer = <Atomic.UILayout>this.getWidget("leftanimcontainer");
         this.rightAnimContainer = <Atomic.UILayout>this.getWidget("rightanimcontainer");
         this.rightAnimContainer = <Atomic.UILayout>this.getWidget("rightanimcontainer");
 
 
-        this.subscribeToEvent(this, "WidgetEvent", (ev) => this.handleWidgetEvent(ev));
-        this.subscribeToEvent(EditorEvents.ActiveSceneEditorChange, (data) => this.handleActiveSceneEditorChanged(data));
-        this.subscribeToEvent(EditorEvents.SceneClosed, (data) => this.handleSceneClosed(data));
+        this.subscribeToEvent(this, Atomic.UIWidgetEvent((ev) => this.handleWidgetEvent(ev)));
+        this.subscribeToEvent(EditorEvents.ActiveSceneEditorChangeEvent((data) => this.handleActiveSceneEditorChanged(data)));
+        this.subscribeToEvent(EditorEvents.SceneClosedEvent((data) => this.handleSceneClosed(data)));
 
 
         var leftAnimationField = InspectorUtils.createAttrEditFieldWithSelectButton("Animation A", this.leftAnimContainer);
         var leftAnimationField = InspectorUtils.createAttrEditFieldWithSelectButton("Animation A", this.leftAnimContainer);
         leftAnimationField.selectButton.onClick = function () { this.openAnimationSelectionBox(leftAnimationField.editField, this.leftAnim); }.bind(this);
         leftAnimationField.selectButton.onClick = function () { this.openAnimationSelectionBox(leftAnimationField.editField, this.leftAnim); }.bind(this);

+ 7 - 7
Script/AtomicEditor/ui/EditorUI.ts

@@ -89,11 +89,11 @@ class EditorUI extends Atomic.ScriptObject {
 
 
     this.editor = editor;
     this.editor = editor;
 
 
-    this.subscribeToEvent("ScreenMode", (ev:Atomic.ScreenModeEvent) => {
+    this.subscribeToEvent(Atomic.ScreenModeEvent((ev:Atomic.ScreenModeEvent) => {
 
 
       this.mainframe.setSize(ev.width, ev.height);
       this.mainframe.setSize(ev.width, ev.height);
 
 
-    });
+    }));
 
 
     // set initial size
     // set initial size
     this.mainframe.setSize(graphics.width, graphics.height);
     this.mainframe.setSize(graphics.width, graphics.height);
@@ -107,13 +107,13 @@ class EditorUI extends Atomic.ScriptObject {
       this.modalOps);
       this.modalOps);
     ServiceLocator.subscribeToEvents(this.mainframe);
     ServiceLocator.subscribeToEvents(this.mainframe);
 
 
-    this.subscribeToEvent(EditorEvents.ModalError, (event:EditorEvents.ModalErrorEvent) => {
+    this.subscribeToEvent(EditorEvents.ModalErrorEvent((event:EditorEvents.ModalErrorEvent) => {
       this.showModalError(event.title, event.message);
       this.showModalError(event.title, event.message);
-    });
-    
-    this.subscribeToEvent(EditorEvents.EditorModal, (event:EditorEvents.EditorModalEvent) => {
+    }));
+
+    this.subscribeToEvent(EditorEvents.EditorModalEvent((event:EditorEvents.EditorModalEvent) => {
       this.showModalError(event.title, event.message);
       this.showModalError(event.title, event.message);
-    });
+    }));
 
 
   }
   }
 
 

+ 16 - 16
Script/AtomicEditor/ui/MainToolbar.ts

@@ -55,41 +55,41 @@ class MainToolbar extends Atomic.UIWidget {
 
 
         parent.addChild(this);
         parent.addChild(this);
 
 
-        this.subscribeToEvent("GizmoAxisModeChanged", (ev) => this.handleGizmoAxisModeChanged(ev));
-        this.subscribeToEvent("GizmoEditModeChanged", (ev) => this.handleGizmoEditModeChanged(ev));
+        this.subscribeToEvent(Editor.GizmoAxisModeChangedEvent((ev) => this.handleGizmoAxisModeChanged(ev)));
+        this.subscribeToEvent(Editor.GizmoEditModeChangedEvent((ev) => this.handleGizmoEditModeChanged(ev)));
 
 
-        this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.subscribeToEvent(this, Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
-        this.subscribeToEvent(EditorEvents.PlayerStarted, (data) => {
+        this.subscribeToEvent(EditorEvents.PlayerStartedEvent(() => {
             var skin = <Atomic.UISkinImage> this.playButton.getWidget("skin_image");
             var skin = <Atomic.UISkinImage> this.playButton.getWidget("skin_image");
             skin.setSkinBg("StopButton");
             skin.setSkinBg("StopButton");
             skin = <Atomic.UISkinImage> this.pauseButton.getWidget("skin_image");
             skin = <Atomic.UISkinImage> this.pauseButton.getWidget("skin_image");
             skin.setSkinBg("PauseButton");
             skin.setSkinBg("PauseButton");
-        });
-        this.subscribeToEvent(EditorEvents.PlayerStopped, (data) => {
+        }));
+        this.subscribeToEvent(EditorEvents.PlayerStoppedEvent(() => {
             var skin = <Atomic.UISkinImage> this.playButton.getWidget("skin_image");
             var skin = <Atomic.UISkinImage> this.playButton.getWidget("skin_image");
             skin.setSkinBg("PlayButton");
             skin.setSkinBg("PlayButton");
             skin = <Atomic.UISkinImage> this.pauseButton.getWidget("skin_image");
             skin = <Atomic.UISkinImage> this.pauseButton.getWidget("skin_image");
             skin.setSkinBg("PauseButton");
             skin.setSkinBg("PauseButton");
-        });
-        this.subscribeToEvent(EditorEvents.PlayerPaused, (data) => {
+        }));
+        this.subscribeToEvent(EditorEvents.PlayerPausedEvent(() => {
             var skin = <Atomic.UISkinImage> this.pauseButton.getWidget("skin_image");
             var skin = <Atomic.UISkinImage> this.pauseButton.getWidget("skin_image");
             skin.setSkinBg("PlayButton");
             skin.setSkinBg("PlayButton");
-        });
+        }));
 
 
-        this.subscribeToEvent(EditorEvents.PlayerResumed, (data) => {
+        this.subscribeToEvent(EditorEvents.PlayerResumedEvent(() => {
             var skin = <Atomic.UISkinImage> this.pauseButton.getWidget("skin_image");
             var skin = <Atomic.UISkinImage> this.pauseButton.getWidget("skin_image");
             skin.setSkinBg("PauseButton");
             skin.setSkinBg("PauseButton");
-        });
+        }));
 
 
         // TODO: We need better control over playmode during NET compiles
         // TODO: We need better control over playmode during NET compiles
-        this.subscribeToEvent("NETBuildBegin", (data) => {
+        this.subscribeToEvent(ToolCore.NETBuildBeginEvent((data) => {
             this.playButton.disable();
             this.playButton.disable();
-        });
+        }));
 
 
-        this.subscribeToEvent("NETBuildResult", (data) => {
+        this.subscribeToEvent(ToolCore.NETBuildResultEvent((data) => {
             this.playButton.enable();
             this.playButton.enable();
-        });
+        }));
 
 
     }
     }
 
 
@@ -135,7 +135,7 @@ class MainToolbar extends Atomic.UIWidget {
                 else if (ev.target.id == "3d_scale")
                 else if (ev.target.id == "3d_scale")
                     mode = 3;
                     mode = 3;
 
 
-                this.sendEvent("GizmoEditModeChanged", { mode: mode });
+                this.sendEvent(Editor.GizmoEditModeChangedEventName, { mode: mode });
 
 
                 return true;
                 return true;
 
 

+ 1 - 1
Script/AtomicEditor/ui/ScriptWidget.ts

@@ -30,7 +30,7 @@ class ScriptWidget extends Atomic.UIWidget {
         // this.subscribeToEvent(this, "WidgetEvent", this.handleWidgetEvent.bind(this));
         // this.subscribeToEvent(this, "WidgetEvent", this.handleWidgetEvent.bind(this));
 
 
         // TypeScript-ey
         // TypeScript-ey
-        this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.subscribeToEvent(this, Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
     }
     }
 
 

+ 7 - 7
Script/AtomicEditor/ui/Shortcuts.ts

@@ -30,9 +30,9 @@ class Shortcuts extends Atomic.ScriptObject {
 
 
         super();
         super();
 
 
-        this.subscribeToEvent(Atomic.UIShortcutEvent ( (ev) => this.handleUIShortcut(ev)));
+        this.subscribeToEvent(Atomic.UIShortcutEvent((ev) => this.handleUIShortcut(ev)));
 
 
-        this.subscribeToEvent(Atomic.KeyDownEvent( (ev) => this.handleKeyDown(ev)));
+        this.subscribeToEvent(Atomic.KeyDownEvent((ev) => this.handleKeyDown(ev)));
 
 
 
 
     }
     }
@@ -43,7 +43,7 @@ class Shortcuts extends Atomic.ScriptObject {
         this.sendEvent(EditorEvents.SaveAllResources);
         this.sendEvent(EditorEvents.SaveAllResources);
 
 
         if (Atomic.editorMode.isPlayerEnabled()) {
         if (Atomic.editorMode.isPlayerEnabled()) {
-            this.sendEvent("IPCPlayerExitRequest");
+            this.sendEvent("IPCPlayerExitRequest" /*AtomicApp.IPCPlayerExitRequestEventName*/);
         } else {
         } else {
 
 
             var playerWindow = Preferences.getInstance().playerWindow;
             var playerWindow = Preferences.getInstance().playerWindow;
@@ -92,13 +92,13 @@ class Shortcuts extends Atomic.ScriptObject {
 
 
     invokePauseOrResumePlayer() {
     invokePauseOrResumePlayer() {
         if (Atomic.editorMode.isPlayerEnabled()) {
         if (Atomic.editorMode.isPlayerEnabled()) {
-            this.sendEvent("IPCPlayerPauseResumeRequest");
+            this.sendEvent("IPCPlayerPauseResumeRequest" /*AtomicApp.IPCPlayerPauseResumeRequestEventName*/);
         }
         }
     }
     }
 
 
     invokeStepPausedPlayer() {
     invokeStepPausedPlayer() {
         if (Atomic.editorMode.isPlayerEnabled()) {
         if (Atomic.editorMode.isPlayerEnabled()) {
-            this.sendEvent("IPCPlayerPauseStepRequest");
+            this.sendEvent("IPCPlayerPauseStepRequest" /*AtomicApp.IPCPlayerPauseStepRequestEventName*/);
         }
         }
     }
     }
 
 
@@ -153,7 +153,7 @@ class Shortcuts extends Atomic.ScriptObject {
 
 
     invokeGizmoEditModeChanged(mode: Editor.EditMode) {
     invokeGizmoEditModeChanged(mode: Editor.EditMode) {
 
 
-        this.sendEvent("GizmoEditModeChanged", { mode: mode });
+        this.sendEvent(Editor.GizmoEditModeChangedEventName, { mode: mode });
 
 
     }
     }
 
 
@@ -162,7 +162,7 @@ class Shortcuts extends Atomic.ScriptObject {
 
 
         if (editor && editor instanceof Editor.SceneEditor3D) {
         if (editor && editor instanceof Editor.SceneEditor3D) {
             var mode = editor.getGizmo().axisMode ? Editor.AxisMode.AXIS_WORLD : Editor.AxisMode.AXIS_LOCAL;
             var mode = editor.getGizmo().axisMode ? Editor.AxisMode.AXIS_WORLD : Editor.AxisMode.AXIS_LOCAL;
-            this.sendEvent("GizmoAxisModeChanged", { mode: mode });
+            this.sendEvent(Editor.GizmoAxisModeChangedEventName, { mode: mode });
         }
         }
     }
     }
 
 

+ 13 - 1
Script/AtomicEditor/ui/UIEvents.ts

@@ -20,5 +20,17 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-export const MessageModalEvent = "MessageModalEvent";
+export const MessageModalEventName = "MessageModalEvent";
+export function MessageModalEvent(callback: Atomic.EventCallback<MessageModalEvent>) {
+    return Atomic.ScriptEvent(MessageModalEventName, callback);
+}
+export interface MessageModalEvent extends Atomic.EventMetaData {
+    type : string;
+    title : string;
+    message : string;
+}
+
 export const ResourceEditorChanged = "ResourceEditorChanged";
 export const ResourceEditorChanged = "ResourceEditorChanged";
+export function ResourceEditorChangedEvent(callback : Atomic.EventCallback<null>) {
+    return Atomic.ScriptEvent(ResourceEditorChanged, callback);
+}

+ 29 - 29
Script/AtomicEditor/ui/frames/HierarchyFrame.ts

@@ -64,40 +64,40 @@ class HierarchyFrame extends Atomic.UIWidget {
         hierList.multiSelect = true;
         hierList.multiSelect = true;
         hierList.rootList.id = "hierList_";
         hierList.rootList.id = "hierList_";
 
 
-        hierList.subscribeToEvent("UIListViewSelectionChanged", (event: Atomic.UIListViewSelectionChangedEvent) => this.handleHierListSelectionChangedEvent(event));
+        hierList.subscribeToEvent(Atomic.UIListViewSelectionChangedEvent((event: Atomic.UIListViewSelectionChangedEvent) => this.handleHierListSelectionChangedEvent(event)));
 
 
         hierarchycontainer.addChild(hierList);
         hierarchycontainer.addChild(hierList);
 
 
-        this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.subscribeToEvent(this, Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
-        this.subscribeToEvent(EditorEvents.EditorResourceClose, (data) => this.handleEditorResourceClosed(data));
-        this.subscribeToEvent(EditorEvents.ActiveSceneEditorChange, (data) => this.handleActiveSceneEditorChanged(data));
+        this.subscribeToEvent(EditorEvents.EditorResourceCloseEvent((data) => this.handleEditorResourceClosed(data)));
+        this.subscribeToEvent(EditorEvents.ActiveSceneEditorChangeEvent((data) => this.handleActiveSceneEditorChanged(data)));
 
 
-        this.searchEdit.subscribeToEvent(this.searchEdit, "WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.searchEdit.subscribeToEvent(this.searchEdit, Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
         // on mouse up clear the list's drag object
         // on mouse up clear the list's drag object
-        this.subscribeToEvent("MouseButtonUp", () => {
+        this.subscribeToEvent(Atomic.MouseButtonUpEvent(() => {
             // handle dropping on hierarchy, moving node, dropping prefabs, etc
             // handle dropping on hierarchy, moving node, dropping prefabs, etc
-            this.subscribeToEvent(this.hierList.rootList, "DragEnded", (data) => this.handleDragEnded(data));
+            this.subscribeToEvent(this.hierList.rootList, Atomic.DragEndedEvent((data) => this.handleDragEnded(data)));
             this.hierList.rootList.dragObject = null;
             this.hierList.rootList.dragObject = null;
-        });
+        }));
 
 
-        this.subscribeToEvent("KeyDown", () => {
+        this.subscribeToEvent(Atomic.KeyDownEvent(() => {
             this.canReparent = false;
             this.canReparent = false;
-        });
+        }));
 
 
-        this.subscribeToEvent("KeyUp", () => {
+        this.subscribeToEvent(Atomic.KeyUpEvent(() => {
             this.canReparent = true;
             this.canReparent = true;
-        });
+        }));
 
 
-        this.subscribeToEvent(EditorEvents.ProjectClosed, (ev) => {
+        this.subscribeToEvent(EditorEvents.ProjectClosedEvent((ev) => {
 
 
             this.scene = null;
             this.scene = null;
             this.populate();
             this.populate();
 
 
-        });
+        }));
 
 
-        this.subscribeToEvent(EditorEvents.SceneClosed, (ev: EditorEvents.SceneClosedEvent) => {
+        this.subscribeToEvent(EditorEvents.SceneClosedEvent((ev: EditorEvents.SceneClosedEvent) => {
 
 
             if (ev.scene == this.scene) {
             if (ev.scene == this.scene) {
 
 
@@ -107,9 +107,9 @@ class HierarchyFrame extends Atomic.UIWidget {
 
 
             }
             }
 
 
-        });
+        }));
 
 
-        this.subscribeToEvent("ComponentAdded", (ev: Atomic.ComponentAddedEvent) => {
+        this.subscribeToEvent(Atomic.ComponentAddedEvent((ev: Atomic.ComponentAddedEvent) => {
 
 
             if (!ev.component || ev.component.typeName != "PrefabComponent") return;
             if (!ev.component || ev.component.typeName != "PrefabComponent") return;
 
 
@@ -123,9 +123,9 @@ class HierarchyFrame extends Atomic.UIWidget {
 
 
             }
             }
 
 
-        });
+        }));
 
 
-        this.subscribeToEvent("ComponentRemoved", (ev: Atomic.ComponentRemovedEvent) => {
+        this.subscribeToEvent(Atomic.ComponentRemovedEvent((ev: Atomic.ComponentRemovedEvent) => {
 
 
             if (!ev.component || ev.component.typeName != "PrefabComponent") return;
             if (!ev.component || ev.component.typeName != "PrefabComponent") return;
 
 
@@ -138,9 +138,9 @@ class HierarchyFrame extends Atomic.UIWidget {
                 this.hierList.setItemTextSkin(node.id.toString(), "Folder");
                 this.hierList.setItemTextSkin(node.id.toString(), "Folder");
             }
             }
 
 
-        });
+        }));
 
 
-        this.subscribeToEvent("TemporaryChanged", (ev: Atomic.TemporaryChangedEvent) => {
+        this.subscribeToEvent(Atomic.TemporaryChangedEvent((ev: Atomic.TemporaryChangedEvent) => {
 
 
             // this can happen on a temporary status change on a non-scripted class instance
             // this can happen on a temporary status change on a non-scripted class instance
             if (!ev.serializable) {
             if (!ev.serializable) {
@@ -161,7 +161,7 @@ class HierarchyFrame extends Atomic.UIWidget {
 
 
             }
             }
 
 
-        });
+        }));
 
 
     }
     }
 
 
@@ -210,16 +210,16 @@ class HierarchyFrame extends Atomic.UIWidget {
 
 
         if (this.scene) {
         if (this.scene) {
 
 
-            this.subscribeToEvent(this.scene, "SceneNodeSelected", (event: Editor.SceneNodeSelectedEvent) => this.handleSceneNodeSelected(event));
-            this.subscribeToEvent(this.scene, "SceneEditNodeAdded", (ev: Editor.SceneEditNodeAddedEvent) => this.handleSceneEditNodeAdded(ev));
-            this.subscribeToEvent(this.scene, "SceneEditNodeRemoved", (ev: Editor.SceneEditNodeRemovedEvent) => this.handleSceneEditNodeRemoved(ev));
-            this.subscribeToEvent(this.scene, "NodeNameChanged", (ev: Atomic.NodeNameChangedEvent) => {
+            this.subscribeToEvent(this.scene, Editor.SceneNodeSelectedEvent((event: Editor.SceneNodeSelectedEvent) => this.handleSceneNodeSelected(event)));
+            this.subscribeToEvent(this.scene, Editor.SceneEditNodeAddedEvent((ev: Editor.SceneEditNodeAddedEvent) => this.handleSceneEditNodeAdded(ev)));
+            this.subscribeToEvent(this.scene, Editor.SceneEditNodeRemovedEvent((ev: Editor.SceneEditNodeRemovedEvent) => this.handleSceneEditNodeRemoved(ev)));
+            this.subscribeToEvent(this.scene, Atomic.NodeNameChangedEvent((ev: Atomic.NodeNameChangedEvent) => {
 
 
                 this.hierList.setItemText(ev.node.id.toString(), ev.node.name);
                 this.hierList.setItemText(ev.node.id.toString(), ev.node.name);
 
 
-            });
+            }));
 
 
-            this.subscribeToEvent(this.scene, "SceneEditNodeReparent", (ev) => {
+            this.subscribeToEvent(this.scene, Editor.SceneEditNodeReparentEvent((ev) => {
 
 
                 if (!ev.added) {
                 if (!ev.added) {
                     delete this.nodeIDToItemID[ev.node.id];
                     delete this.nodeIDToItemID[ev.node.id];
@@ -231,7 +231,7 @@ class HierarchyFrame extends Atomic.UIWidget {
 
 
                 }
                 }
 
 
-            });
+            }));
 
 
 
 
         }
         }

+ 5 - 5
Script/AtomicEditor/ui/frames/MainFrame.ts

@@ -63,17 +63,17 @@ class MainFrame extends ScriptWidget {
 
 
         this.disableProjectMenus();
         this.disableProjectMenus();
 
 
-        this.subscribeToEvent(UIEvents.ResourceEditorChanged, (data) => this.handleResourceEditorChanged(data));
+        this.subscribeToEvent(UIEvents.ResourceEditorChangedEvent((data) => this.handleResourceEditorChanged(data)));
 
 
-        this.subscribeToEvent("ProjectLoaded", (data) => {
+        this.subscribeToEvent(EditorEvents.ProjectLoadedEvent((data) => {
             this.showWelcomeFrame(false);
             this.showWelcomeFrame(false);
             this.enableProjectMenus();
             this.enableProjectMenus();
-        });
+        }));
 
 
-        this.subscribeToEvent(EditorEvents.ProjectUnloadedNotification, (data) => {
+        this.subscribeToEvent(EditorEvents.ProjectUnloadedNotificationEvent((data) => {
             this.showWelcomeFrame(true);
             this.showWelcomeFrame(true);
             this.disableProjectMenus();
             this.disableProjectMenus();
-        });
+        }));
 
 
         this.showWelcomeFrame(true);
         this.showWelcomeFrame(true);
 
 

+ 11 - 11
Script/AtomicEditor/ui/frames/ProjectFrame.ts

@@ -68,27 +68,27 @@ class ProjectFrame extends ScriptWidget {
         foldercontainer.addChild(folderList);
         foldercontainer.addChild(folderList);
 
 
         // events
         // events
-        this.subscribeToEvent("ProjectLoaded", (data) => this.handleProjectLoaded(data));
-        this.subscribeToEvent(EditorEvents.ProjectUnloadedNotification, (data) => this.handleProjectUnloaded(data));
-        this.subscribeToEvent("DragEnded", (data: Atomic.DragEndedEvent) => this.handleDragEnded(data));
+        this.subscribeToEvent(EditorEvents.ProjectLoadedEvent((data) => this.handleProjectLoaded(data)));
+        this.subscribeToEvent(EditorEvents.ProjectUnloadedNotificationEvent((data) => this.handleProjectUnloaded(data)));
+        this.subscribeToEvent(Atomic.DragEndedEvent((data: Atomic.DragEndedEvent) => this.handleDragEnded(data)));
 
 
-        this.subscribeToEvent("ResourceAdded", (ev: ToolCore.ResourceAddedEvent) => this.handleResourceAdded(ev));
-        this.subscribeToEvent("ResourceRemoved", (ev: ToolCore.ResourceRemovedEvent) => this.handleResourceRemoved(ev));
-        this.subscribeToEvent("AssetRenamed", (ev: ToolCore.AssetRenamedEvent) => this.handleAssetRenamed(ev));
-        this.subscribeToEvent(EditorEvents.InspectorProjectReference, (ev: EditorEvents.InspectorProjectReferenceEvent) => { this.handleInspectorProjectReferenceHighlight(ev.path); });
+        this.subscribeToEvent(ToolCore.ResourceAddedEvent((ev: ToolCore.ResourceAddedEvent) => this.handleResourceAdded(ev)));
+        this.subscribeToEvent(ToolCore.ResourceRemovedEvent((ev: ToolCore.ResourceRemovedEvent) => this.handleResourceRemoved(ev)));
+        this.subscribeToEvent(ToolCore.AssetRenamedEvent((ev: ToolCore.AssetRenamedEvent) => this.handleAssetRenamed(ev)));
+        this.subscribeToEvent(EditorEvents.InspectorProjectReferenceEvent((ev: EditorEvents.InspectorProjectReferenceEvent) => { this.handleInspectorProjectReferenceHighlight(ev.path); }));
 
 
-        this.searchEdit.subscribeToEvent(this.searchEdit, "WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.searchEdit.subscribeToEvent(this.searchEdit, Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
-        folderList.subscribeToEvent("UIListViewSelectionChanged", (event: Atomic.UIListViewSelectionChangedEvent) => this.handleFolderListSelectionChangedEvent(event));
+        folderList.subscribeToEvent(Atomic.UIListViewSelectionChangedEvent((event: Atomic.UIListViewSelectionChangedEvent) => this.handleFolderListSelectionChangedEvent(event)));
 
 
         // this.subscribeToEvent(EditorEvents.ResourceFolderCreated, (ev: EditorEvents.ResourceFolderCreatedEvent) => this.handleResourceFolderCreated(ev));
         // this.subscribeToEvent(EditorEvents.ResourceFolderCreated, (ev: EditorEvents.ResourceFolderCreatedEvent) => this.handleResourceFolderCreated(ev));
 
 
         // this uses FileWatcher which doesn't catch subfolder creation
         // this uses FileWatcher which doesn't catch subfolder creation
-        this.subscribeToEvent("FileChanged", (data) => {
+        this.subscribeToEvent(Atomic.FileChangedEvent((data) => {
 
 
             // console.log("File CHANGED! ", data.fileName);
             // console.log("File CHANGED! ", data.fileName);
 
 
-        });
+        }));
 
 
     }
     }
 
 

+ 10 - 10
Script/AtomicEditor/ui/frames/ResourceFrame.ts

@@ -73,7 +73,7 @@ class ResourceFrame extends ScriptWidget {
         }
         }
     }
     }
 
 
-    handleSaveAllResources(data) {
+    handleSaveAllResources() {
 
 
         for (var i in this.editors) {
         for (var i in this.editors) {
             this.editors[i].save();
             this.editors[i].save();
@@ -278,17 +278,17 @@ class ResourceFrame extends ScriptWidget {
         this.resourceEditorProvider = new ResourceEditorProvider(this);
         this.resourceEditorProvider = new ResourceEditorProvider(this);
         this.resourceEditorProvider.loadStandardEditors();
         this.resourceEditorProvider.loadStandardEditors();
 
 
-        this.subscribeToEvent(EditorEvents.ProjectUnloadedNotification, (data) => this.handleProjectUnloaded(data));
-        this.subscribeToEvent(EditorEvents.EditResource, (data) => this.handleEditResource(data));
-        this.subscribeToEvent(EditorEvents.SaveResource, (data) => this.handleSaveResource(data));
-        this.subscribeToEvent(EditorEvents.SaveAllResources, (data) => this.handleSaveAllResources(data));
-        this.subscribeToEvent(EditorEvents.EditorResourceClose, (ev: EditorEvents.EditorCloseResourceEvent) => this.handleCloseResource(ev));
-        this.subscribeToEvent(EditorEvents.RenameResourceNotification, (ev: EditorEvents.RenameResourceEvent) => this.handleRenameResource(ev));
-        this.subscribeToEvent(EditorEvents.DeleteResourceNotification, (data) => this.handleDeleteResource(data));
+        this.subscribeToEvent(EditorEvents.ProjectUnloadedNotificationEvent((data) => this.handleProjectUnloaded(data)));
+        this.subscribeToEvent(EditorEvents.EditResourceEvent((data) => this.handleEditResource(data)));
+        this.subscribeToEvent(EditorEvents.SaveResourceEvent((data) => this.handleSaveResource(data)));
+        this.subscribeToEvent(EditorEvents.SaveAllResourcesEvent((data) => this.handleSaveAllResources()));
+        this.subscribeToEvent(EditorEvents.EditorResourceCloseEvent((ev: EditorEvents.EditorCloseResourceEvent) => this.handleCloseResource(ev)));
+        this.subscribeToEvent(EditorEvents.RenameResourceNotificationEvent((ev: EditorEvents.RenameResourceEvent) => this.handleRenameResource(ev)));
+        this.subscribeToEvent(EditorEvents.DeleteResourceNotificationEvent((data) => this.handleDeleteResource(data)));
 
 
-        this.subscribeToEvent(UIEvents.ResourceEditorChanged, (data) => this.handleResourceEditorChanged(data));
+        this.subscribeToEvent(UIEvents.ResourceEditorChangedEvent((data) => this.handleResourceEditorChanged(data)));
 
 
-        this.subscribeToEvent("WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.subscribeToEvent(Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
     }
     }
 
 

+ 2 - 2
Script/AtomicEditor/ui/frames/WelcomeFrame.ts

@@ -58,9 +58,9 @@ class WelcomeFrame extends ScriptWidget {
 
 
         this.updateRecentProjects();
         this.updateRecentProjects();
 
 
-        this.subscribeToEvent(EditorEvents.CloseProject, () => {
+        this.subscribeToEvent(EditorEvents.CloseProjectEvent(() => {
             this.updateRecentProjects();
             this.updateRecentProjects();
-        });
+        }));
 
 
         this.initExampleBrowser();
         this.initExampleBrowser();
 
 

+ 1 - 1
Script/AtomicEditor/ui/frames/inspector/ArrayEditWidget.ts

@@ -46,7 +46,7 @@ class ArrayEditWidget extends Atomic.UILayout {
 
 
         this.countEditField = <Atomic.UIEditField>countEdit.getWidget("editfield");
         this.countEditField = <Atomic.UIEditField>countEdit.getWidget("editfield");
 
 
-        this.subscribeToEvent(this.countEditField, "UIWidgetEditComplete", (ev) => this.handleUIWidgetEditCompleteEvent(ev));
+        this.subscribeToEvent(this.countEditField, Atomic.UIWidgetEditCompleteEvent((ev) => this.handleUIWidgetEditCompleteEvent(ev)));
 
 
     }
     }
 
 

+ 1 - 1
Script/AtomicEditor/ui/frames/inspector/AssemblyInspector.ts

@@ -29,7 +29,7 @@ class AssemblyInspector extends InspectorWidget {
 
 
         super();
         super();
 
 
-        this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.subscribeToEvent(this, Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
     }
     }
 
 

+ 30 - 30
Script/AtomicEditor/ui/frames/inspector/AttributeInfoEdit.ts

@@ -65,7 +65,7 @@ class AttributeInfoEdit extends Atomic.UILayout {
 
 
         this.createEditWidget();
         this.createEditWidget();
 
 
-        this.editWidget.subscribeToEvent(this.editWidget, "WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.editWidget.subscribeToEvent(this.editWidget, Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
         if (this.attrInfo.tooltip) {
         if (this.attrInfo.tooltip) {
             this.editWidget.tooltip = this.attrInfo.tooltip;
             this.editWidget.tooltip = this.attrInfo.tooltip;
@@ -123,7 +123,7 @@ class AttributeInfoEdit extends Atomic.UILayout {
 
 
     }
     }
 
 
-    static createAttrEdit(editType: SerializableEditType, attrInfo: Atomic.AttributeInfo, nameOverride:string=undefined, typeOverride:Atomic.VariantType = undefined ): AttributeInfoEdit {
+    static createAttrEdit(editType: SerializableEditType, attrInfo: Atomic.AttributeInfo, nameOverride:string = undefined, typeOverride:Atomic.VariantType = undefined ): AttributeInfoEdit {
 
 
         var type: typeof AttributeInfoEdit;
         var type: typeof AttributeInfoEdit;
         var customTypes = AttributeInfoEdit.customAttrEditTypes[editType.typeName];
         var customTypes = AttributeInfoEdit.customAttrEditTypes[editType.typeName];
@@ -244,7 +244,7 @@ class StringAttributeEdit extends AttributeInfoEdit {
         lp.width = 160;
         lp.width = 160;
         field.layoutParams = lp;
         field.layoutParams = lp;
 
 
-        field.subscribeToEvent(field, "UIWidgetEditComplete", (ev) => this.handleUIWidgetEditCompleteEvent(ev));
+        field.subscribeToEvent(field, Atomic.UIWidgetEditCompleteEvent((ev) => this.handleUIWidgetEditCompleteEvent(ev)));
 
 
         this.editWidget = field;
         this.editWidget = field;
     }
     }
@@ -327,7 +327,7 @@ class IntAttributeEdit extends AttributeInfoEdit {
             lp.width = 140;
             lp.width = 140;
             field.layoutParams = lp;
             field.layoutParams = lp;
 
 
-            field.subscribeToEvent(field, "UIWidgetEditComplete", (ev) => this.handleUIWidgetEditCompleteEvent(ev));
+            field.subscribeToEvent(field, Atomic.UIWidgetEditCompleteEvent((ev) => this.handleUIWidgetEditCompleteEvent(ev)));
 
 
             this.editWidget = field;
             this.editWidget = field;
         }
         }
@@ -422,7 +422,7 @@ class FloatAttributeEdit extends AttributeInfoEdit {
         lp.width = 140;
         lp.width = 140;
         field.layoutParams = lp;
         field.layoutParams = lp;
 
 
-        field.subscribeToEvent(field, "UIWidgetEditComplete", (ev) => this.handleUIWidgetEditCompleteEvent(ev));
+        field.subscribeToEvent(field, Atomic.UIWidgetEditCompleteEvent((ev) => this.handleUIWidgetEditCompleteEvent(ev)));
 
 
         this.editWidget = field;
         this.editWidget = field;
 
 
@@ -445,7 +445,7 @@ class FloatAttributeEdit extends AttributeInfoEdit {
                     console.log("WARNING: Undefined value for object: ", this.editType.typeName + "." + attrInfo.name);
                     console.log("WARNING: Undefined value for object: ", this.editType.typeName + "." + attrInfo.name);
                     widget.text = "???";
                     widget.text = "???";
 
 
-                } else {                    
+                } else {
                     widget.text = parseFloat(value.toFixed(5)).toString();
                     widget.text = parseFloat(value.toFixed(5)).toString();
                 }
                 }
 
 
@@ -525,8 +525,8 @@ class NumberArrayAttributeEdit extends AttributeInfoEdit {
             select["_dec"] = select.getWidget("dec");
             select["_dec"] = select.getWidget("dec");
             select["_inc"] = select.getWidget("inc");
             select["_inc"] = select.getWidget("inc");
 
 
-            select.subscribeToEvent(select, "WidgetEvent", (ev) => this.handleWidgetEvent(ev));
-            select.subscribeToEvent(select, "UIWidgetEditComplete", (ev) => this.handleUIWidgetEditCompleteEvent(ev));
+            select.subscribeToEvent(select, Atomic.UIWidgetEvent((ev) => this.handleWidgetEvent(ev)));
+            select.subscribeToEvent(select, Atomic.UIWidgetEditCompleteEvent((ev) => this.handleUIWidgetEditCompleteEvent(ev)));
         }
         }
 
 
         this.editWidget = layout;
         this.editWidget = layout;
@@ -661,7 +661,7 @@ class ColorAttributeEdit extends AttributeInfoEdit {
 
 
         this.editWidget = layout;
         this.editWidget = layout;
 
 
-        this.editWidget.subscribeToEvent(this.editWidget, "WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.editWidget.subscribeToEvent(this.editWidget, Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
         selectButton.onClick = () => {
         selectButton.onClick = () => {
 
 
@@ -678,14 +678,14 @@ class ColorAttributeEdit extends AttributeInfoEdit {
             let restore = null;
             let restore = null;
             let chooser = new ColorChooser ( color );
             let chooser = new ColorChooser ( color );
 
 
-            this.subscribeToEvent(chooser, "ColorChooserChanged", (ev) => {
+            this.subscribeToEvent(chooser, Editor.ColorChooserChangedEvent((ev) => {
 
 
                 restore = color;
                 restore = color;
                 this.updateColor(chooser.getRGBA());
                 this.updateColor(chooser.getRGBA());
 
 
-            });
+            }));
 
 
-            this.subscribeToEvent(chooser, "UIWidgetEditCanceled", (ev) => {
+            this.subscribeToEvent(chooser, Atomic.UIWidgetEditCanceledEvent((ev) => {
 
 
                 if (restore) {
                 if (restore) {
 
 
@@ -694,9 +694,9 @@ class ColorAttributeEdit extends AttributeInfoEdit {
 
 
                 }
                 }
 
 
-            });
+            }));
 
 
-            this.subscribeToEvent(chooser, "UIWidgetEditComplete", (ev) => {
+            this.subscribeToEvent(chooser, Atomic.UIWidgetEditCompleteEvent((ev) => {
 
 
                 let newColor = chooser.getRGBA();
                 let newColor = chooser.getRGBA();
 
 
@@ -729,7 +729,7 @@ class ColorAttributeEdit extends AttributeInfoEdit {
 
 
                 }
                 }
 
 
-            });
+            }));
 
 
         };
         };
 
 
@@ -746,7 +746,7 @@ class ColorAttributeEdit extends AttributeInfoEdit {
             this.colorWidget.color = color;
             this.colorWidget.color = color;
         }
         }
 
 
-        
+
     }
     }
 
 
     // updates color on selection without committing to undo/redo for preview
     // updates color on selection without committing to undo/redo for preview
@@ -796,7 +796,7 @@ class ResourceRefAttributeEdit extends AttributeInfoEdit {
 
 
         if (parent) {
         if (parent) {
 
 
-            parent.sendEvent("AttributeEditResourceChanged", { attrInfoEdit: this, resource: resource });
+            parent.sendEvent(EditorEvents.AttributeEditResourceChangedEventName, { attrInfoEdit: this, resource: resource });
 
 
         }
         }
 
 
@@ -853,7 +853,7 @@ class ResourceRefAttributeEdit extends AttributeInfoEdit {
                 }
                 }
                 this.editField.text = text;
                 this.editField.text = text;
 
 
-                this.editField.subscribeToEvent(this.editField, "WidgetEvent", (ev: Atomic.UIWidgetEvent) => {
+                this.editField.subscribeToEvent(this.editField, Atomic.UIWidgetEvent((ev: Atomic.UIWidgetEvent) => {
 
 
                     if (ev.type == Atomic.UI_EVENT_TYPE.UI_EVENT_TYPE_POINTER_DOWN) {
                     if (ev.type == Atomic.UI_EVENT_TYPE.UI_EVENT_TYPE_POINTER_DOWN) {
 
 
@@ -882,7 +882,7 @@ class ResourceRefAttributeEdit extends AttributeInfoEdit {
                         }
                         }
                     }
                     }
 
 
-                });
+                }));
             }
             }
 
 
 
 
@@ -939,7 +939,7 @@ class ResourceRefAttributeEdit extends AttributeInfoEdit {
         };
         };
 
 
         // handle dropping of component on field
         // handle dropping of component on field
-        this.editField.subscribeToEvent(this.editField, "DragEnded", (ev: Atomic.DragEndedEvent) => {
+        this.editField.subscribeToEvent(this.editField, Atomic.DragEndedEvent((ev: Atomic.DragEndedEvent) => {
 
 
             if (ev.target == o.editField) {
             if (ev.target == o.editField) {
 
 
@@ -969,7 +969,7 @@ class ResourceRefAttributeEdit extends AttributeInfoEdit {
                 }
                 }
             }
             }
 
 
-        });
+        }));
 
 
     }
     }
 
 
@@ -1026,7 +1026,7 @@ class ResourceRefListAttributeEdit extends AttributeInfoEdit {
         lp.width = 160;
         lp.width = 160;
         sizeEdit.layoutParams = lp;
         sizeEdit.layoutParams = lp;
 
 
-        sizeEdit.subscribeToEvent(sizeEdit, "UIWidgetEditComplete", (ev) => this.handleUIWidgetEditCompleteEvent(ev));
+        sizeEdit.subscribeToEvent(sizeEdit, Atomic.UIWidgetEditCompleteEvent((ev) => this.handleUIWidgetEditCompleteEvent(ev)));
 
 
         this.editWidget = layout;
         this.editWidget = layout;
 
 
@@ -1036,7 +1036,7 @@ class ResourceRefListAttributeEdit extends AttributeInfoEdit {
 
 
         this.createEditWidget();
         this.createEditWidget();
 
 
-        this.editWidget.subscribeToEvent(this.editWidget, "WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.editWidget.subscribeToEvent(this.editWidget, Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
         this.addChild(this.editWidget);
         this.addChild(this.editWidget);
 
 
@@ -1161,7 +1161,7 @@ class ArrayAttributeEdit extends AttributeInfoEdit {
 
 
         this.layout.addChild(indexEdit);
         this.layout.addChild(indexEdit);
 
 
-        this.indexEdits.push(indexEdit);        
+        this.indexEdits.push(indexEdit);
 
 
     }
     }
 
 
@@ -1196,7 +1196,7 @@ class ArrayAttributeEdit extends AttributeInfoEdit {
         lp.width = 160;
         lp.width = 160;
         sizeEdit.layoutParams = lp;
         sizeEdit.layoutParams = lp;
 
 
-        sizeEdit.subscribeToEvent(sizeEdit, "UIWidgetEditComplete", (ev) => this.handleUIWidgetEditCompleteEvent(ev));
+        sizeEdit.subscribeToEvent(sizeEdit, Atomic.UIWidgetEditCompleteEvent((ev) => this.handleUIWidgetEditCompleteEvent(ev)));
 
 
         this.editWidget = layout;
         this.editWidget = layout;
 
 
@@ -1206,7 +1206,7 @@ class ArrayAttributeEdit extends AttributeInfoEdit {
 
 
         this.createEditWidget();
         this.createEditWidget();
 
 
-        this.editWidget.subscribeToEvent(this.editWidget, "WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.editWidget.subscribeToEvent(this.editWidget, Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
         this.addChild(this.editWidget);
         this.addChild(this.editWidget);
 
 
@@ -1237,18 +1237,18 @@ class ArrayAttributeEdit extends AttributeInfoEdit {
                 // record for undo/redo
                 // record for undo/redo
                 let scene = this.editType.getEditScene();
                 let scene = this.editType.getEditScene();
                 if (scene) {
                 if (scene) {
-                    scene.sendEvent("SceneEditEnd");
-                    scene.sendEvent("ComponentEditEnd");                    
+                    scene.sendEvent(Editor.SceneEditEndEventName);
+                    scene.sendEvent(Editor.ComponentEditEndEventName);
                 }
                 }
 
 
                 refresh = true;
                 refresh = true;
-            } 
+            }
 
 
         }
         }
 
 
         if (refresh)
         if (refresh)
             this.refresh();
             this.refresh();
-        
+
     }
     }
 
 
     refresh() {
     refresh() {

+ 1 - 1
Script/AtomicEditor/ui/frames/inspector/CSComponentClassSelector.ts

@@ -76,7 +76,7 @@ class CSComponentClassSelector extends Atomic.UIWindow {
 
 
         this.center();
         this.center();
 
 
-        this.subscribeToEvent("WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.subscribeToEvent(Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
     }
     }
 
 

+ 10 - 10
Script/AtomicEditor/ui/frames/inspector/ColorChooser.ts

@@ -69,8 +69,8 @@ class ColorChooser extends Atomic.UIWindow {
 
 
         (<Atomic.UIButton>this.getWidget("ccancelbutton")).onClick = () => {
         (<Atomic.UIButton>this.getWidget("ccancelbutton")).onClick = () => {
 
 
-            this.sendEvent("UIWidgetEditCanceled", { widget : this });
-            this.unsubscribeFromEvent("WidgetDeleted");
+            this.sendEvent(Atomic.UIWidgetEditCanceledEventName, { widget : this });
+            this.unsubscribeFromEvent(Atomic.UIWidgetDeletedEventName);
             this.close();
             this.close();
 
 
         };
         };
@@ -79,18 +79,18 @@ class ColorChooser extends Atomic.UIWindow {
 
 
             Preferences.getInstance().addColorHistory(this.infohex.text);
             Preferences.getInstance().addColorHistory(this.infohex.text);
 
 
-            this.sendEvent("UIWidgetEditComplete", { widget : this });
-            this.unsubscribeFromEvent("WidgetDeleted");
+            this.sendEvent(Atomic.UIWidgetEditCompleteEventName, { widget : this });
+            this.unsubscribeFromEvent(Atomic.UIWidgetDeletedEventName);
             this.close();
             this.close();
         };
         };
 
 
-        this.subscribeToEvent(this, "WidgetDeleted", (event: Atomic.UIWidgetDeletedEvent) => {
+        this.subscribeToEvent(this, Atomic.UIWidgetDeletedEvent((event: Atomic.UIWidgetDeletedEvent) => {
 
 
-            this.sendEvent("UIWidgetEditCanceled", { widget : this });
+            this.sendEvent(Atomic.UIWidgetEditCanceledEventName, { widget : this });
 
 
-        });
+        }));
 
 
-        this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.subscribeToEvent(this, Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
         this.resizeToFitContent();
         this.resizeToFitContent();
         this.center();
         this.center();
@@ -192,7 +192,7 @@ class ColorChooser extends Atomic.UIWindow {
 
 
         if (changed) {
         if (changed) {
 
 
-            this.sendEvent("ColorChooserChanged", { widget : this });
+            this.sendEvent(Editor.ColorChooserChangedEventName, { widget : this });
 
 
         }
         }
 
 
@@ -226,7 +226,7 @@ class ColorChooser extends Atomic.UIWindow {
             this.fixcolor();
             this.fixcolor();
             this.update_hslwidgets();
             this.update_hslwidgets();
             this.update_rgbwidgets();
             this.update_rgbwidgets();
-            this.sendEvent("ColorChooserChanged", { widget : this });
+            this.sendEvent(Editor.ColorChooserChangedEventName, { widget : this });
 
 
         }
         }
 
 

+ 10 - 10
Script/AtomicEditor/ui/frames/inspector/ComponentAttributeUI.ts

@@ -56,7 +56,7 @@ class LightCascadeAttributeEdit extends AttributeInfoEdit {
 
 
                 }
                 }
 
 
-                o.scene.sendEvent("SceneEditEnd");
+                o.scene.sendEvent(Editor.SceneEditEndEventName);
                 _this.refresh();
                 _this.refresh();
 
 
             }.bind({ index: index, field: field });
             }.bind({ index: index, field: field });
@@ -69,7 +69,7 @@ class LightCascadeAttributeEdit extends AttributeInfoEdit {
         for (var i = 0; i < 4; i++) {
         for (var i = 0; i < 4; i++) {
             var field = InspectorUtils.createAttrEditField("Split " + i, panel);
             var field = InspectorUtils.createAttrEditField("Split " + i, panel);
             field.layoutParams = flp;
             field.layoutParams = flp;
-            field.subscribeToEvent(field, "UIWidgetEditComplete", createHandler(i, field));
+            field.subscribeToEvent(field, Atomic.UIWidgetEditCompleteEvent(createHandler(i, field)));
             this.splitFields.push(field);
             this.splitFields.push(field);
         }
         }
 
 
@@ -152,7 +152,7 @@ class SubmeshAttributeEdit extends AttributeInfoEdit {
     openResourceSelectionBox(materialIndex: number, resourceTypeName: string, importerName: string) {
     openResourceSelectionBox(materialIndex: number, resourceTypeName: string, importerName: string) {
 
 
         this.matIndex = materialIndex;
         this.matIndex = materialIndex;
-        
+
         EditorUI.getModelOps().showResourceSelection("Select " + resourceTypeName + " Resource", importerName, resourceTypeName, function (retObject: any) {
         EditorUI.getModelOps().showResourceSelection("Select " + resourceTypeName + " Resource", importerName, resourceTypeName, function (retObject: any) {
 
 
             if (retObject == null) {
             if (retObject == null) {
@@ -208,7 +208,7 @@ class SubmeshAttributeEdit extends AttributeInfoEdit {
         };
         };
 
 
         // handle dropping of component on field
         // handle dropping of component on field
-        o.editField.subscribeToEvent(o.editField, "DragEnded", (ev: Atomic.DragEndedEvent) => {
+        o.editField.subscribeToEvent(o.editField, Atomic.DragEndedEvent((ev: Atomic.DragEndedEvent) => {
 
 
             if (ev.target == o.editField) {
             if (ev.target == o.editField) {
 
 
@@ -235,9 +235,9 @@ class SubmeshAttributeEdit extends AttributeInfoEdit {
                 }
                 }
             }
             }
 
 
-        });
+        }));
 
 
-        o.editField.subscribeToEvent(o.editField, "WidgetEvent", (ev: Atomic.UIWidgetEvent) => {
+        o.editField.subscribeToEvent(o.editField, Atomic.UIWidgetEvent((ev: Atomic.UIWidgetEvent) => {
 
 
             if (ev.type == Atomic.UI_EVENT_TYPE.UI_EVENT_TYPE_POINTER_DOWN && o.editField.text != "") {
             if (ev.type == Atomic.UI_EVENT_TYPE.UI_EVENT_TYPE_POINTER_DOWN && o.editField.text != "") {
 
 
@@ -249,7 +249,7 @@ class SubmeshAttributeEdit extends AttributeInfoEdit {
                 this.openResourceSelectionBox(materialIndex, resourceTypeName, importerName);
                 this.openResourceSelectionBox(materialIndex, resourceTypeName, importerName);
             }
             }
 
 
-        });
+        }));
     }
     }
 
 
     createEditWidget() {
     createEditWidget() {
@@ -264,7 +264,7 @@ class SubmeshAttributeEdit extends AttributeInfoEdit {
         var cb = InspectorUtils.createAttrCheckBox(this.name, mainLayout);
         var cb = InspectorUtils.createAttrCheckBox(this.name, mainLayout);
         this.enabledCheckBox = cb.checkBox;
         this.enabledCheckBox = cb.checkBox;
 
 
-        cb.checkBox.subscribeToEvent(cb.checkBox, "WidgetEvent", (ev: Atomic.UIWidgetEvent) => {
+        cb.checkBox.subscribeToEvent(cb.checkBox, Atomic.UIWidgetEvent((ev: Atomic.UIWidgetEvent) => {
 
 
             if (ev.type == Atomic.UI_EVENT_TYPE.UI_EVENT_TYPE_CHANGED) {
             if (ev.type == Atomic.UI_EVENT_TYPE.UI_EVENT_TYPE_CHANGED) {
 
 
@@ -288,7 +288,7 @@ class SubmeshAttributeEdit extends AttributeInfoEdit {
 
 
                 }
                 }
 
 
-                scene.sendEvent("SceneEditEnd");
+                scene.sendEvent(Editor.SceneEditEndEventName);
 
 
                 return true;
                 return true;
 
 
@@ -297,7 +297,7 @@ class SubmeshAttributeEdit extends AttributeInfoEdit {
             return false;
             return false;
 
 
 
 
-        });
+        }));
 
 
 
 
         this.nameField = cb.textField;
         this.nameField = cb.textField;

+ 2 - 2
Script/AtomicEditor/ui/frames/inspector/CreateComponentButton.ts

@@ -133,7 +133,7 @@ class CreateComponentButton extends Atomic.UIButton {
 
 
         this.text = "Create Component";
         this.text = "Create Component";
 
 
-        this.subscribeToEvent("WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.subscribeToEvent(Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
     }
     }
 
 
@@ -152,7 +152,7 @@ class CreateComponentButton extends Atomic.UIButton {
 
 
         if (ev.target && ev.target.id == "create component popup") {
         if (ev.target && ev.target.id == "create component popup") {
 
 
-            this.sendEvent("SelectionCreateComponent", { componentTypeName : ev.refid});
+            this.sendEvent(Editor.SelectionCreateComponentEventName, { componentTypeName : ev.refid});
 
 
             return true;
             return true;
 
 

+ 4 - 4
Script/AtomicEditor/ui/frames/inspector/InspectorFrame.ts

@@ -54,10 +54,10 @@ class InspectorFrame extends ScriptWidget {
 
 
         var container = this.getWidget("inspectorcontainer");
         var container = this.getWidget("inspectorcontainer");
 
 
-        this.subscribeToEvent(EditorEvents.EditResource, (data) => this.handleEditResource(data));
-        this.subscribeToEvent(EditorEvents.ProjectUnloadedNotification, (data) => this.handleProjectUnloaded(data));
+        this.subscribeToEvent(EditorEvents.EditResourceEvent((data) => this.handleEditResource(data)));
+        this.subscribeToEvent(EditorEvents.ProjectUnloadedNotificationEvent((data) => this.handleProjectUnloaded(data)));
 
 
-        this.subscribeToEvent(EditorEvents.ActiveSceneEditorChange, (data) => this.handleActiveSceneEditorChanged(data));
+        this.subscribeToEvent(EditorEvents.ActiveSceneEditorChangeEvent((data) => this.handleActiveSceneEditorChanged(data)));
 
 
     }
     }
 
 
@@ -83,7 +83,7 @@ class InspectorFrame extends ScriptWidget {
 
 
         if (this.scene) {
         if (this.scene) {
 
 
-            this.subscribeToEvent(this.scene, "SceneNodeSelected", (event: Editor.SceneNodeSelectedEvent) => this.handleSceneNodeSelected(event));
+            this.subscribeToEvent(this.scene, Editor.SceneNodeSelectedEvent((event: Editor.SceneNodeSelectedEvent) => this.handleSceneNodeSelected(event)));
 
 
             // add the current selection
             // add the current selection
             var selection = this.sceneEditor.selection;
             var selection = this.sceneEditor.selection;

+ 1 - 1
Script/AtomicEditor/ui/frames/inspector/InspectorWidget.ts

@@ -48,7 +48,7 @@ class InspectorWidget extends ScriptWidget {
         this.gravity = Atomic.UI_GRAVITY.UI_GRAVITY_ALL;
         this.gravity = Atomic.UI_GRAVITY.UI_GRAVITY_ALL;
         this.addChild(layout);
         this.addChild(layout);
 
 
-        this.subscribeToEvent("WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.subscribeToEvent(Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
     }
     }
 
 

+ 9 - 9
Script/AtomicEditor/ui/frames/inspector/MaterialInspector.ts

@@ -92,7 +92,7 @@ class MaterialInspector extends ScriptWidget {
         this.fd.id = "Vera";
         this.fd.id = "Vera";
         this.fd.size = 11;
         this.fd.size = 11;
 
 
-        this.subscribeToEvent("ResourceAdded", (ev: ToolCore.ResourceAddedEvent) => this.refreshTechniquesPopup());
+        this.subscribeToEvent(ToolCore.ResourceAddedEvent((ev: ToolCore.ResourceAddedEvent) => this.refreshTechniquesPopup()));
     }
     }
 
 
     createShaderParametersSection(): Atomic.UISection {
     createShaderParametersSection(): Atomic.UISection {
@@ -136,7 +136,7 @@ class MaterialInspector extends ScriptWidget {
             field.id = params[i].name;
             field.id = params[i].name;
             field.text = params[i].valueString;
             field.text = params[i].valueString;
 
 
-            field.subscribeToEvent(field, "WidgetEvent", function (ev: Atomic.UIWidgetEvent) {
+            field.subscribeToEvent(field, Atomic.UIWidgetEvent(function (ev: Atomic.UIWidgetEvent) {
 
 
                 if (ev.type == Atomic.UI_EVENT_TYPE.UI_EVENT_TYPE_CHANGED) {
                 if (ev.type == Atomic.UI_EVENT_TYPE.UI_EVENT_TYPE_CHANGED) {
 
 
@@ -145,7 +145,7 @@ class MaterialInspector extends ScriptWidget {
 
 
                 }
                 }
 
 
-            }.bind(this));
+            }.bind(this)));
 
 
             attrLayout.addChild(field);
             attrLayout.addChild(field);
 
 
@@ -230,7 +230,7 @@ class MaterialInspector extends ScriptWidget {
             menu.fontDescription = this.fd;
             menu.fontDescription = this.fd;
             menu.show(techniqueSource);
             menu.show(techniqueSource);
 
 
-            button.subscribeToEvent(button, "WidgetEvent", function (ev: Atomic.UIWidgetEvent) {
+            button.subscribeToEvent(button, Atomic.UIWidgetEvent(function (ev: Atomic.UIWidgetEvent) {
 
 
                 if (ev.type != Atomic.UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
                 if (ev.type != Atomic.UI_EVENT_TYPE.UI_EVENT_TYPE_CLICK)
                     return;
                     return;
@@ -241,7 +241,7 @@ class MaterialInspector extends ScriptWidget {
 
 
                 }
                 }
 
 
-            }.bind(this));
+            }.bind(this)));
 
 
         }.bind(this);
         }.bind(this);
 
 
@@ -275,7 +275,7 @@ class MaterialInspector extends ScriptWidget {
                 this.createTextureRemoveButtonCallback(this.tunit, this.textureWidget);
                 this.createTextureRemoveButtonCallback(this.tunit, this.textureWidget);
                 return;
                 return;
             }
             }
-            
+
             var texture = <Atomic.Texture2D>Atomic.cache.getResource("Texture2D", asset.path);
             var texture = <Atomic.Texture2D>Atomic.cache.getResource("Texture2D", asset.path);
 
 
             if (texture) {
             if (texture) {
@@ -394,7 +394,7 @@ class MaterialInspector extends ScriptWidget {
             attrsVerticalLayout.addChild(attrLayout);
             attrsVerticalLayout.addChild(attrLayout);
 
 
             // handle dropping of texture on widget
             // handle dropping of texture on widget
-            textureButton.subscribeToEvent(textureButton, "DragEnded", (ev: Atomic.DragEndedEvent) => {
+            textureButton.subscribeToEvent(textureButton, Atomic.DragEndedEvent((ev: Atomic.DragEndedEvent) => {
 
 
                 var importer = this.acceptAssetDrag("TextureImporter", ev);
                 var importer = this.acceptAssetDrag("TextureImporter", ev);
 
 
@@ -410,10 +410,10 @@ class MaterialInspector extends ScriptWidget {
                         this.material.setTexture(ev.target["tunit"], texture);
                         this.material.setTexture(ev.target["tunit"], texture);
                         (<Atomic.UITextureWidget>ev.target["textureWidget"]).texture = this.getTextureThumbnail(texture);
                         (<Atomic.UITextureWidget>ev.target["textureWidget"]).texture = this.getTextureThumbnail(texture);
 
 
-                        this.sendEvent("InspectorProjectReference", { "path": texture.getName(), "ButtonID": texture.getName() });
+                        this.sendEvent(EditorEvents.InspectorProjectReference, { "path": texture.getName(), "ButtonID": texture.getName() });
                     }
                     }
                 }
                 }
-            });
+            }));
 
 
         }
         }
 
 

+ 3 - 3
Script/AtomicEditor/ui/frames/inspector/ModelInspector.ts

@@ -31,7 +31,7 @@ class ModelInspector extends InspectorWidget {
 
 
         super();
         super();
 
 
-        this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.subscribeToEvent(this, Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
     }
     }
 
 
@@ -93,13 +93,13 @@ class ModelInspector extends InspectorWidget {
         editField.text = asset.name;
         editField.text = asset.name;
 
 
         //This should preferably be onClick
         //This should preferably be onClick
-        editField.subscribeToEvent(editField, "UIWidgetFocusChanged", (ev: Atomic.UIWidgetFocusChangedEvent) => {
+        editField.subscribeToEvent(editField, Atomic.UIWidgetFocusChangedEvent((ev: Atomic.UIWidgetFocusChangedEvent) => {
 
 
             if (ev.widget == editField && editField.focus) {
             if (ev.widget == editField && editField.focus) {
                 this.sendEvent(EditorEvents.InspectorProjectReference, { "path": asset.getRelativePath() });
                 this.sendEvent(EditorEvents.InspectorProjectReference, { "path": asset.getRelativePath() });
             }
             }
 
 
-        });
+        }));
 
 
         this.scaleEdit = InspectorUtils.createAttrEditField("Scale", modelLayout);
         this.scaleEdit = InspectorUtils.createAttrEditField("Scale", modelLayout);
         this.scaleEdit.text = this.importer.scale.toString();
         this.scaleEdit.text = this.importer.scale.toString();

+ 1 - 1
Script/AtomicEditor/ui/frames/inspector/PrefabInspector.ts

@@ -32,7 +32,7 @@ class PrefabInspector extends InspectorWidget {
         this.fd.id = "Vera";
         this.fd.id = "Vera";
         this.fd.size = 11;
         this.fd.size = 11;
 
 
-        this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.subscribeToEvent(this, Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
     }
     }
 
 

+ 17 - 23
Script/AtomicEditor/ui/frames/inspector/SelectionInspector.ts

@@ -48,7 +48,7 @@ class NodeSection extends SelectionSection {
         this.transformEdits.push(this.attrEdits["Rotation"]);
         this.transformEdits.push(this.attrEdits["Rotation"]);
         this.transformEdits.push(this.attrEdits["Scale"]);
         this.transformEdits.push(this.attrEdits["Scale"]);
 
 
-        this.subscribeToEvent("Update", (ev) => this.handleUpdate(ev));
+        this.subscribeToEvent(Atomic.UpdateEvent((ev) => this.handleUpdate(ev)));
 
 
     }
     }
 
 
@@ -129,12 +129,6 @@ class SceneSection extends SelectionSection {
 
 
 }
 }
 
 
-interface AttributeEditResourceChangedEvent {
-
-    attrInfoEdit: AttributeInfoEdit;
-    resource: Atomic.Resource;
-
-}
 
 
 class JSComponentSection extends ComponentSection {
 class JSComponentSection extends ComponentSection {
 
 
@@ -144,11 +138,11 @@ class JSComponentSection extends ComponentSection {
 
 
         this.hasDynamicAttr = true;
         this.hasDynamicAttr = true;
 
 
-        this.subscribeToEvent(this, "AttributeEditResourceChanged", (ev) => this.handleAttributeEditResourceChanged(ev));
+        this.subscribeToEvent(this, EditorEvents.AttributeEditResourceChangedEvent((ev) => this.handleAttributeEditResourceChanged(ev)));
         this.updateTitleFromComponentClass();
         this.updateTitleFromComponentClass();
     }
     }
 
 
-    private handleAttributeEditResourceChanged(ev: AttributeEditResourceChangedEvent) {
+    private handleAttributeEditResourceChanged(ev: EditorEvents.AttributeEditResourceChangedEvent) {
 
 
         var jsc = <Atomic.JSComponent>this.editType.getFirstObject();
         var jsc = <Atomic.JSComponent>this.editType.getFirstObject();
 
 
@@ -168,7 +162,7 @@ class JSComponentSection extends ComponentSection {
             let jscf = <Atomic.JSComponentFile> jsc.componentFile;
             let jscf = <Atomic.JSComponentFile> jsc.componentFile;
             if (jscf.typeScriptClass) {
             if (jscf.typeScriptClass) {
                 this.text = this.text.replace(".js", ".ts");
                 this.text = this.text.replace(".js", ".ts");
-            }            
+            }
         }
         }
     }
     }
 
 
@@ -184,11 +178,11 @@ class CSComponentSection extends ComponentSection {
 
 
         this.hasDynamicAttr = true;
         this.hasDynamicAttr = true;
 
 
-        this.subscribeToEvent(this, "AttributeEditResourceChanged", (ev) => this.handleAttributeEditResourceChanged(ev));
+        this.subscribeToEvent(this, EditorEvents.AttributeEditResourceChangedEvent((ev) => this.handleAttributeEditResourceChanged(ev)));
 
 
-        this.subscribeToEvent("CSComponentAssemblyChanged", (ev) => this.handleCSComponentAssemblyChanged(ev));
+        this.subscribeToEvent(AtomicNETScript.CSComponentAssemblyChangedEvent((ev) => this.handleCSComponentAssemblyChanged(ev)));
 
 
-        this.subscribeToEvent("CSComponentClassChanged", (ev) => this.handleCSComponentClassChanged(ev));
+        this.subscribeToEvent(AtomicNETScript.CSComponentClassChangedEvent((ev) => this.handleCSComponentClassChanged(ev)));
 
 
     }
     }
 
 
@@ -222,7 +216,7 @@ class CSComponentSection extends ComponentSection {
     }
     }
 
 
 
 
-    private handleAttributeEditResourceChanged(ev: AttributeEditResourceChangedEvent) {
+    private handleAttributeEditResourceChanged(ev: EditorEvents.AttributeEditResourceChangedEvent) {
 
 
 
 
         var csc = <AtomicNETScript.CSComponent>this.editType.getFirstObject();
         var csc = <AtomicNETScript.CSComponent>this.editType.getFirstObject();
@@ -290,14 +284,14 @@ class SelectionInspector extends ScriptWidget {
         this.createComponentButton = new CreateComponentButton();
         this.createComponentButton = new CreateComponentButton();
         mainLayout.addChild(this.createComponentButton);
         mainLayout.addChild(this.createComponentButton);
 
 
-        this.subscribeToEvent(sceneEditor.scene, "SceneEditStateChangesBegin", (data) => this.handleSceneEditStateChangesBeginEvent());
-        this.subscribeToEvent("SceneEditStateChange", (data) => this.handleSceneEditStateChangeEvent(data));
-        this.subscribeToEvent(sceneEditor.scene, "SceneEditStateChangesEnd", (data) => this.handleSceneEditStateChangesEndEvent());
+        this.subscribeToEvent(sceneEditor.scene, Editor.SceneEditStateChangesBeginEvent((data) => this.handleSceneEditStateChangesBeginEvent()));
+        this.subscribeToEvent(Editor.SceneEditStateChangeEvent((data) => this.handleSceneEditStateChangeEvent(data)));
+        this.subscribeToEvent(sceneEditor.scene, Editor.SceneEditStateChangesEndEvent((data) => this.handleSceneEditStateChangesEndEvent()));
 
 
-        this.subscribeToEvent(sceneEditor.scene, "SceneEditNodeRemoved", (ev: Editor.SceneEditNodeRemovedEvent) => this.handleSceneEditNodeRemoved(ev));
-        this.subscribeToEvent(sceneEditor.scene, "SceneEditComponentAddedRemoved", (ev) => this.handleSceneEditComponentAddedRemovedEvent(ev));
+        this.subscribeToEvent(sceneEditor.scene, Editor.SceneEditNodeRemovedEvent((ev: Editor.SceneEditNodeRemovedEvent) => this.handleSceneEditNodeRemoved(ev)));
+        this.subscribeToEvent(sceneEditor.scene, Editor.SceneEditComponentAddedRemovedEvent((ev) => this.handleSceneEditComponentAddedRemovedEvent(ev)));
 
 
-        this.subscribeToEvent(this.createComponentButton, "SelectionCreateComponent", (data) => this.handleSelectionCreateComponent(data));
+        this.subscribeToEvent(this.createComponentButton, Editor.SelectionCreateComponentEvent((data) => this.handleSelectionCreateComponent(data)));
 
 
     }
     }
 
 
@@ -682,7 +676,7 @@ class SelectionInspector extends ScriptWidget {
 
 
         if (removed.length) {
         if (removed.length) {
 
 
-            this.sceneEditor.scene.sendEvent("SceneEditEnd");
+            this.sceneEditor.scene.sendEvent(Editor.SceneEditEndEventName);
             this.refresh();
             this.refresh();
 
 
         }
         }
@@ -706,7 +700,7 @@ class SelectionInspector extends ScriptWidget {
 
 
             this.component = c;
             this.component = c;
 
 
-            this.sceneEditor.scene.sendEvent("SceneEditComponentCopy", { component: this.component });
+            this.sceneEditor.scene.sendEvent(Editor.SceneEditComponentCopyEventName, { component: this.component });
             this.refresh();
             this.refresh();
 
 
         }
         }
@@ -728,7 +722,7 @@ class SelectionInspector extends ScriptWidget {
 
 
             this.component = c;
             this.component = c;
 
 
-            this.sceneEditor.scene.sendEvent("SceneEditComponentPaste", { component: this.component });
+            this.sceneEditor.scene.sendEvent(Editor.SceneEditComponentPasteEventName, { component: this.component });
             this.refresh();
             this.refresh();
         }
         }
 
 

+ 5 - 5
Script/AtomicEditor/ui/frames/inspector/SelectionPrefabWidget.ts

@@ -57,7 +57,7 @@ class SelectionPrefabWidget extends Atomic.UILayout {
 
 
         saveButton.onClick = () => {
         saveButton.onClick = () => {
 
 
-            this.node.scene.sendEvent("SceneEditPrefabSave", {node : this.node});
+            this.node.scene.sendEvent(Editor.SceneEditPrefabSaveEventName, {node : this.node});
             return true;
             return true;
         };
         };
 
 
@@ -67,7 +67,7 @@ class SelectionPrefabWidget extends Atomic.UILayout {
 
 
         undoButton.onClick = () => {
         undoButton.onClick = () => {
 
 
-            this.node.scene.sendEvent("SceneEditPrefabRevert", {node : this.node});
+            this.node.scene.sendEvent(Editor.SceneEditPrefabRevertEventName, {node : this.node});
             return true;
             return true;
 
 
         };
         };
@@ -192,7 +192,7 @@ class ConfirmPrefabBreak extends Atomic.UIWindow {
 
 
         this.dimmer = new Atomic.UIDimmer();
         this.dimmer = new Atomic.UIDimmer();
 
 
-        this.subscribeToEvent("WidgetEvent", (ev) => { this.handleWidgetEvent(ev); });
+        this.subscribeToEvent(Atomic.UIWidgetEvent((ev) => { this.handleWidgetEvent(ev); }));
 
 
     }
     }
 
 
@@ -206,7 +206,7 @@ class ConfirmPrefabBreak extends Atomic.UIWindow {
 
 
                 this.hide();
                 this.hide();
 
 
-                this.node.scene.sendEvent("SceneEditPrefabBreak", {node : this.node});
+                this.node.scene.sendEvent(Editor.SceneEditPrefabBreakEventName, {node : this.node});
 
 
                 return true;
                 return true;
             }
             }
@@ -215,7 +215,7 @@ class ConfirmPrefabBreak extends Atomic.UIWindow {
 
 
                 this.hide();
                 this.hide();
 
 
-                this.node.scene.sendEvent("SceneEditPrefabRevert", {node : this.node});
+                this.node.scene.sendEvent(Editor.SceneEditPrefabRevertEventName, {node : this.node});
 
 
                 return true;
                 return true;
             }
             }

+ 4 - 4
Script/AtomicEditor/ui/frames/inspector/SelectionSectionCoreUI.ts

@@ -87,20 +87,20 @@ class CubemapGeneratorSectionUI extends SelectionSectionUI {
 
 
                     scene = gen.scene;
                     scene = gen.scene;
 
 
-                    this.subscribeToEvent(scene, "CubemapRenderBegin", () => {
+                    this.subscribeToEvent(scene, Editor.CubemapRenderBeginEvent(() => {
 
 
                         count++;
                         count++;
 
 
-                    });
+                    }));
 
 
-                    this.subscribeToEvent(scene, "CubemapRenderEnd", () => {
+                    this.subscribeToEvent(scene, Editor.CubemapRenderEndEvent(() => {
 
 
                         count--;
                         count--;
 
 
                         if (!count)
                         if (!count)
                             progressModal.hide();
                             progressModal.hide();
 
 
-                    });
+                    }));
 
 
 
 
                 }
                 }

+ 5 - 5
Script/AtomicEditor/ui/frames/inspector/SerializableEditType.ts

@@ -128,15 +128,15 @@ class SerializableEditType {
 
 
         if (scene) {
         if (scene) {
 
 
-            scene.sendEvent("SceneEditEnd");
+            scene.sendEvent(Editor.SceneEditEndEventName);
 
 
             if (editTypeName != "Node") {
             if (editTypeName != "Node") {
 
 
-                scene.sendEvent("ComponentEditEnd");
-                
+                scene.sendEvent(Editor.ComponentEditEndEventName);
+
             }
             }
         }
         }
-            
+
 
 
 
 
     }
     }
@@ -153,7 +153,7 @@ class SerializableEditType {
         if (node)
         if (node)
             return node.scene;
             return node.scene;
 
 
-        return null;        
+        return null;
     }
     }
 
 
     compareTypes(otherType: SerializableEditType, multiSelect:boolean = false): boolean {
     compareTypes(otherType: SerializableEditType, multiSelect:boolean = false): boolean {

+ 1 - 1
Script/AtomicEditor/ui/frames/inspector/TextureSelector.ts

@@ -75,7 +75,7 @@ class TextureSelector extends Atomic.UIWindow {
 
 
         this.center();
         this.center();
 
 
-        this.subscribeToEvent("WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.subscribeToEvent(Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
     }
     }
 
 

+ 7 - 7
Script/AtomicEditor/ui/frames/menus/HierarchyFrameMenu.ts

@@ -39,9 +39,9 @@ class HierarchyFrameMenus extends Atomic.ScriptObject {
         MenuItemSources.createMenuItemSource("hierarchy create items", createItems);
         MenuItemSources.createMenuItemSource("hierarchy create items", createItems);
         this.contextMenuItemSource = MenuItemSources.createMenuItemSource("node context general", nodeGeneralContextItems);
         this.contextMenuItemSource = MenuItemSources.createMenuItemSource("node context general", nodeGeneralContextItems);
 
 
-        this.subscribeToEvent(EditorEvents.ContentFolderChanged, (ev: EditorEvents.ContentFolderChangedEvent) => {
+        this.subscribeToEvent(EditorEvents.ContentFolderChangedEvent((ev: EditorEvents.ContentFolderChangedEvent) => {
             this.contentFolder = ev.path;
             this.contentFolder = ev.path;
-        });
+        }));
 
 
     }
     }
 
 
@@ -74,7 +74,7 @@ class HierarchyFrameMenus extends Atomic.ScriptObject {
             }
             }
 
 
             if (child) {
             if (child) {
-                child.scene.sendEvent("SceneEditNodeCreated", { node: child });
+                child.scene.sendEvent(Editor.SceneEditNodeCreatedEventName, { node: child });
             }
             }
 
 
             return true;
             return true;
@@ -101,10 +101,10 @@ class HierarchyFrameMenus extends Atomic.ScriptObject {
                     return;
                     return;
 
 
                 var scene = node.scene;
                 var scene = node.scene;
-                scene.sendEvent("SceneEditAddRemoveNodes", { end: false });
-                scene.sendEvent("SceneEditNodeRemoved", { node: node, parent: node.parent, scene: scene });
+                scene.sendEvent(Editor.SceneEditAddRemoveNodesEventName, { end: false });
+                scene.sendEvent(Editor.SceneEditNodeRemovedEventName, { node: node, parent: node.parent, scene: scene });
                 node.remove();
                 node.remove();
-                scene.sendEvent("SceneEditAddRemoveNodes", { end: true });
+                scene.sendEvent(Editor.SceneEditAddRemoveNodesEventName, { end: true });
 
 
                 editor.selection.delete();
                 editor.selection.delete();
 
 
@@ -116,7 +116,7 @@ class HierarchyFrameMenus extends Atomic.ScriptObject {
                     return;
                     return;
 
 
                 var newnode = node.clone();
                 var newnode = node.clone();
-                node.scene.sendEvent("SceneEditNodeCreated", { node: newnode });
+                node.scene.sendEvent(Editor.SceneEditNodeCreatedEventName, { node: newnode });
 
 
                 return true;
                 return true;
             }
             }

+ 5 - 5
Script/AtomicEditor/ui/frames/menus/MainFrameMenu.ts

@@ -140,7 +140,7 @@ class MainFrameMenu extends Atomic.ScriptObject {
         } else if (target.id == "menu file popup") {
         } else if (target.id == "menu file popup") {
             if (refid == "quit") {
             if (refid == "quit") {
 
 
-                this.sendEvent("ExitRequested");
+                this.sendEvent(Atomic.ExitRequestedEventName);
                 return true;
                 return true;
 
 
             }
             }
@@ -175,12 +175,12 @@ class MainFrameMenu extends Atomic.ScriptObject {
 
 
                 if (ToolCore.toolSystem.project) {
                 if (ToolCore.toolSystem.project) {
 
 
-                    this.subscribeToEvent(EditorEvents.ProjectClosed, () => {
+                    this.subscribeToEvent(EditorEvents.ProjectClosedEvent(() => {
 
 
                         this.unsubscribeFromEvent(EditorEvents.ProjectClosed);
                         this.unsubscribeFromEvent(EditorEvents.ProjectClosed);
                         requestProjectLoad();
                         requestProjectLoad();
 
 
-                    });
+                    }));
 
 
                     this.sendEvent(EditorEvents.CloseProject);
                     this.sendEvent(EditorEvents.CloseProject);
 
 
@@ -271,11 +271,11 @@ class MainFrameMenu extends Atomic.ScriptObject {
             if (refid == "tools toggle profiler") {
             if (refid == "tools toggle profiler") {
                 Atomic.ui.toggleDebugHud();
                 Atomic.ui.toggleDebugHud();
                 return true;
                 return true;
-            } if (refid == "tools perf profiler") {                
+            } if (refid == "tools perf profiler") {
                 Atomic.ui.debugHudProfileMode = Atomic.DebugHudProfileMode.DEBUG_HUD_PROFILE_PERFORMANCE;
                 Atomic.ui.debugHudProfileMode = Atomic.DebugHudProfileMode.DEBUG_HUD_PROFILE_PERFORMANCE;
                 Atomic.ui.showDebugHud(true);
                 Atomic.ui.showDebugHud(true);
                 return true;
                 return true;
-            } else if (refid == "tools metrics profiler") {                
+            } else if (refid == "tools metrics profiler") {
                 Atomic.ui.debugHudProfileMode = Atomic.DebugHudProfileMode.DEBUG_HUD_PROFILE_METRICS;
                 Atomic.ui.debugHudProfileMode = Atomic.DebugHudProfileMode.DEBUG_HUD_PROFILE_METRICS;
                 Atomic.ui.showDebugHud(true);
                 Atomic.ui.showDebugHud(true);
                 return true;
                 return true;

+ 2 - 2
Script/AtomicEditor/ui/frames/menus/ProjectFrameMenu.ts

@@ -40,9 +40,9 @@ class ProjectFrameMenus extends Atomic.ScriptObject {
         this.contextMenuItemSource = MenuItemSources.createMenuItemSource("asset context general", assetGeneralContextItems);
         this.contextMenuItemSource = MenuItemSources.createMenuItemSource("asset context general", assetGeneralContextItems);
         MenuItemSources.createMenuItemSource("project create items", createItems);
         MenuItemSources.createMenuItemSource("project create items", createItems);
 
 
-        this.subscribeToEvent(EditorEvents.ContentFolderChanged, (ev: EditorEvents.ContentFolderChangedEvent) => {
+        this.subscribeToEvent(EditorEvents.ContentFolderChangedEvent((ev: EditorEvents.ContentFolderChangedEvent) => {
             this.contentFolder = ev.path;
             this.contentFolder = ev.path;
-        });
+        }));
 
 
     }
     }
 
 

+ 2 - 2
Script/AtomicEditor/ui/modal/MessageModal.ts

@@ -37,7 +37,7 @@ export class MessageModal extends Atomic.ScriptObject {
 
 
     super();
     super();
 
 
-    this.subscribeToEvent(UIEvents.MessageModalEvent, (data) => {
+    this.subscribeToEvent(UIEvents.MessageModalEvent((data) => {
 
 
       if (data.type == "error") {
       if (data.type == "error") {
 
 
@@ -45,7 +45,7 @@ export class MessageModal extends Atomic.ScriptObject {
 
 
       }
       }
 
 
-    });
+    }));
 
 
   }
   }
 
 

+ 2 - 2
Script/AtomicEditor/ui/modal/ModalOps.ts

@@ -53,14 +53,14 @@ class ModalOps extends Atomic.ScriptObject {
 
 
         this.dimmer = new Atomic.UIDimmer();
         this.dimmer = new Atomic.UIDimmer();
 
 
-        this.subscribeToEvent("WindowClosed", (e) => {
+        this.subscribeToEvent(Atomic.WindowClosedEvent((e) => {
             if (e.window == this.opWindow) {
             if (e.window == this.opWindow) {
                 this.opWindow = null;
                 this.opWindow = null;
                 if (this.dimmer.parent) {
                 if (this.dimmer.parent) {
                     this.dimmer.parent.removeChild(this.dimmer, false);
                     this.dimmer.parent.removeChild(this.dimmer, false);
                 }
                 }
             }
             }
-        });
+        }));
 
 
     }
     }
 
 

+ 3 - 3
Script/AtomicEditor/ui/modal/ModalWindow.ts

@@ -36,13 +36,13 @@ class ModalWindow extends Atomic.UIWindow {
 
 
         this.setFocus();
         this.setFocus();
 
 
-        this.subscribeToEvent(this, "WidgetDeleted", (event: Atomic.UIWidgetDeletedEvent) => {
+        this.subscribeToEvent(this, Atomic.UIWidgetDeletedEvent((event: Atomic.UIWidgetDeletedEvent) => {
 
 
             this.hide();
             this.hide();
 
 
-        });
+        }));
 
 
-        this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.subscribeToEvent(this, Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
     }
     }
 
 

+ 1 - 1
Script/AtomicEditor/ui/modal/ResourceSelection.ts

@@ -52,7 +52,7 @@ class ResourceSelection extends ModalWindow {
         this.setSize(800, 600);
         this.setSize(800, 600);
         this.center();
         this.center();
 
 
-        this.searchEdit.subscribeToEvent(this.searchEdit, "WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.searchEdit.subscribeToEvent(this.searchEdit, Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
     }
     }
 
 

+ 1 - 1
Script/AtomicEditor/ui/modal/build/BuildComplete.ts

@@ -42,7 +42,7 @@ class BuildComplete extends Atomic.UIWindow {
             reveal.setState(Atomic.UI_WIDGET_STATE.UI_WIDGET_STATE_DISABLED, true);
             reveal.setState(Atomic.UI_WIDGET_STATE.UI_WIDGET_STATE_DISABLED, true);
 
 
 
 
-        this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
+        this.subscribeToEvent(this, Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 
     }
     }
 
 

+ 4 - 4
Script/AtomicEditor/ui/modal/build/BuildOutput.ts

@@ -39,19 +39,19 @@ class BuildOutput extends ModalWindow {
         this.resizeToFitContent();
         this.resizeToFitContent();
         this.center();
         this.center();
 
 
-        this.subscribeToEvent(buildBase, "BuildOutput", (ev: ToolCore.BuildOutputEvent) => {
+        this.subscribeToEvent(buildBase, ToolCore.BuildOutputEvent((ev: ToolCore.BuildOutputEvent) => {
 
 
             this.textOutput += ev.text;
             this.textOutput += ev.text;
             this.outputField.text = this.textOutput;
             this.outputField.text = this.textOutput;
             this.outputField.scrollTo(0, 0xffffff);
             this.outputField.scrollTo(0, 0xffffff);
 
 
-        });
+        }));
 
 
-        this.subscribeToEvent("BuildComplete", (ev: ToolCore.BuildCompleteEvent) => {
+        this.subscribeToEvent(ToolCore.BuildCompleteEvent((ev: ToolCore.BuildCompleteEvent) => {
 
 
             new BuildComplete(this, ev);
             new BuildComplete(this, ev);
 
 
-        });
+        }));
 
 
     }
     }
 
 

+ 3 - 3
Script/AtomicEditor/ui/modal/build/BuildSettingsWindow.ts

@@ -90,13 +90,13 @@ export class BuildSettingsWindow extends ModalWindow {
         this.resizeToFitContent();
         this.resizeToFitContent();
         this.center();
         this.center();
 
 
-        this.subscribeToEvent("PlatformChanged", (ev: ToolCore.PlatformChangedEvent) => {
+        this.subscribeToEvent(ToolCore.PlatformChangedEvent((ev: ToolCore.PlatformChangedEvent) => {
 
 
             this.platformIndicator.skinBg = this.platformInfo[ev.platform.name].logo;
             this.platformIndicator.skinBg = this.platformInfo[ev.platform.name].logo;
 
 
-        });
+        }));
 
 
-        this.subscribeToEvent(this, "WidgetEvent", (ev) => this.handleWidgetEvent(ev));
+        this.subscribeToEvent(this, Atomic.UIWidgetEvent((ev) => this.handleWidgetEvent(ev)));
     }
     }
 
 
     commitBuildSettings() {
     commitBuildSettings() {

+ 1 - 1
Script/AtomicEditor/ui/modal/build/BuildWindow.ts

@@ -59,7 +59,7 @@ class BuildWindow extends ModalWindow {
 
 
         }
         }
 
 
-        this.subscribeToEvent(this, "WidgetEvent", (ev) => this.handleWidgetEvent(ev));
+        this.subscribeToEvent(this, Atomic.UIWidgetEvent((ev) => this.handleWidgetEvent(ev)));
     }
     }
 
 
     handleWidgetEvent(ev: Atomic.UIWidgetEvent): boolean {
     handleWidgetEvent(ev: Atomic.UIWidgetEvent): boolean {

+ 3 - 3
Script/AtomicEditor/ui/modal/build/platforms/AndroidSettingsWidget.ts

@@ -63,7 +63,7 @@ class AndroidSettingsWidget extends Atomic.UIWidget implements BuildSettingsWind
 
 
         this.refreshWidgets();
         this.refreshWidgets();
 
 
-        this.subscribeToEvent(this, "WidgetEvent", (ev) => this.handleWidgetEvent(ev));
+        this.subscribeToEvent(this, Atomic.UIWidgetEvent((ev) => this.handleWidgetEvent(ev)));
 
 
     }
     }
 
 
@@ -136,7 +136,7 @@ class AndroidSettingsWidget extends Atomic.UIWidget implements BuildSettingsWind
 
 
         platform.refreshAndroidTargets();
         platform.refreshAndroidTargets();
 
 
-        this.subscribeToEvent(platform, "AndroidTargetsRefreshed", (ev) => {
+        this.subscribeToEvent(platform, ToolCore.AndroidTargetsRefreshedEvent((ev) => {
 
 
             this.sdkTargetSource.clear();
             this.sdkTargetSource.clear();
 
 
@@ -153,7 +153,7 @@ class AndroidSettingsWidget extends Atomic.UIWidget implements BuildSettingsWind
             this.sdkTargetSelect.value = -1;
             this.sdkTargetSelect.value = -1;
             this.sdkTargetSelect.value = 0;
             this.sdkTargetSelect.value = 0;
 
 
-        });
+        }));
 
 
     }
     }
 
 

+ 1 - 1
Script/AtomicEditor/ui/modal/build/platforms/IOSSettingsWidget.ts

@@ -42,7 +42,7 @@ class IOSSettingsWidget extends Atomic.UIWidget implements BuildSettingsWindow.B
 
 
         this.refreshWidgets();
         this.refreshWidgets();
 
 
-        this.subscribeToEvent(this, "WidgetEvent", (ev) => this.handleWidgetEvent(ev));
+        this.subscribeToEvent(this, Atomic.UIWidgetEvent((ev) => this.handleWidgetEvent(ev)));
 
 
     }
     }
 
 

+ 1 - 1
Script/AtomicEditor/ui/modal/build/platforms/WebSettingsWidget.ts

@@ -45,7 +45,7 @@ class WebSettingsWidget extends Atomic.UIWidget implements BuildSettingsWindow.B
 
 
       this.refreshWidgets();
       this.refreshWidgets();
 
 
-      this.subscribeToEvent(this, "WidgetEvent", (ev) => this.handleWidgetEvent(ev));
+      this.subscribeToEvent(this, Atomic.UIWidgetEvent((ev) => this.handleWidgetEvent(ev)));
     }
     }
 
 
     handleWidgetEvent(ev: Atomic.UIWidgetEvent): boolean {
     handleWidgetEvent(ev: Atomic.UIWidgetEvent): boolean {

+ 2 - 2
Script/AtomicEditor/ui/modal/license/EULAWindow.ts

@@ -63,7 +63,7 @@ class EULAWindow extends ModalWindow {
 
 
             if (id == "quit") {
             if (id == "quit") {
 
 
-                this.sendEvent("ExitRequested");
+                this.sendEvent(Atomic.ExitRequestedEventName);
                 return true;
                 return true;
 
 
             } else if (id == "ok") {
             } else if (id == "ok") {
@@ -78,7 +78,7 @@ class EULAWindow extends ModalWindow {
                 var licenseSystem = ToolCore.getLicenseSystem();
                 var licenseSystem = ToolCore.getLicenseSystem();
                 licenseSystem.licenseAgreementConfirmed();
                 licenseSystem.licenseAgreementConfirmed();
 
 
-                this.sendEvent("LicenseEulaAccepted");
+                this.sendEvent(ToolCore.LicenseEulaAcceptedEventName);
 
 
                 return true;
                 return true;
             }
             }

+ 3 - 3
Script/AtomicEditor/ui/playmode/PlayMode.ts

@@ -33,9 +33,9 @@ class PlayMode extends Atomic.ScriptObject {
 
 
         super();
         super();
         this.myPlayer = null;
         this.myPlayer = null;
-        this.subscribeToEvent("IPCJSError", (ev: Atomic.IPCJSErrorEvent) => this.handleIPCJSError(ev));
-        this.subscribeToEvent(EditorEvents.PlayerStarted, (ev) => this.handlePlayerStarted(ev));
-        this.subscribeToEvent(EditorEvents.PlayerStopped, (ev) => this.handlePlayerStopped(ev));
+        this.subscribeToEvent(Atomic.IPCJSErrorEvent((ev: Atomic.IPCJSErrorEvent) => this.handleIPCJSError(ev)));
+        this.subscribeToEvent(EditorEvents.PlayerStartedEvent((ev) => this.handlePlayerStarted(ev)));
+        this.subscribeToEvent(EditorEvents.PlayerStoppedEvent((ev) => this.handlePlayerStopped(ev)));
 
 
     }
     }
 
 

+ 2 - 2
Script/AtomicEditor/ui/playmode/PlayerOutput.ts

@@ -51,8 +51,8 @@ class PlayerOutput extends Atomic.UIWindow {
 
 
         };
         };
 
 
-        this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
-        this.subscribeToEvent(EditorEvents.PlayerLog, (ev: EditorEvents.PlayerLogEvent) => this.handlePlayerLog(ev));
+        this.subscribeToEvent(this, Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
+        this.subscribeToEvent(EditorEvents.PlayerLogEvent((ev: EditorEvents.PlayerLogEvent) => this.handlePlayerLog(ev)));
 
 
         this.resizeToFitContent();
         this.resizeToFitContent();
         this.center();
         this.center();

+ 6 - 6
Script/AtomicEditor/ui/resourceEditors/AbstractTextResourceEditorBuilder.ts

@@ -49,10 +49,10 @@ export abstract class AbstractTextResourceEditorBuilder implements Editor.Extens
         // one time subscriptions waiting for the web view to finish loading.  This event
         // one time subscriptions waiting for the web view to finish loading.  This event
         // actually hits the editor instance before we can hook it, so listen to it on the
         // actually hits the editor instance before we can hook it, so listen to it on the
         // frame and then unhook it
         // frame and then unhook it
-        editor.subscribeToEvent(EditorEvents.WebViewLoadEnd, (data) => {
+        editor.subscribeToEvent(EditorEvents.WebViewLoadEndEvent((data) => {
             editor.unsubscribeFromEvent(EditorEvents.WebViewLoadEnd);
             editor.unsubscribeFromEvent(EditorEvents.WebViewLoadEnd);
             this.loadCode(<Editor.JSResourceEditor>editor, resourcePath);
             this.loadCode(<Editor.JSResourceEditor>editor, resourcePath);
-        });
+        }));
 
 
         // Cannot subscribe to WebMessage until the .ts side can return a Handler.Success() message
         // Cannot subscribe to WebMessage until the .ts side can return a Handler.Success() message
         // editor.subscribeToEvent(EditorEvents.WebMessage, (data) => {
         // editor.subscribeToEvent(EditorEvents.WebMessage, (data) => {
@@ -68,15 +68,15 @@ export abstract class AbstractTextResourceEditorBuilder implements Editor.Extens
         //     }
         //     }
         // });
         // });
 
 
-        editor.subscribeToEvent(EditorEvents.DeleteResourceNotification, (data) => {
+        editor.subscribeToEvent(EditorEvents.DeleteResourceNotificationEvent((data) => {
             const webClient = editor.webView.webClient;
             const webClient = editor.webView.webClient;
             webClient.executeJavaScript(`HOST_resourceDeleted("${this.getNormalizedPath(data.path)}");`);
             webClient.executeJavaScript(`HOST_resourceDeleted("${this.getNormalizedPath(data.path)}");`);
-        });
+        }));
 
 
-        editor.subscribeToEvent(EditorEvents.UserPreferencesChangedNotification, (data: EditorEvents.UserPreferencesChangedEvent) => {
+        editor.subscribeToEvent(EditorEvents.UserPreferencesChangedNotificationEvent((data: EditorEvents.UserPreferencesChangedEvent) => {
             const webClient = editor.webView.webClient;
             const webClient = editor.webView.webClient;
             webClient.executeJavaScript(`HOST_preferencesChanged('${data.projectPreferences}','${data.applicationPreferences}');`);
             webClient.executeJavaScript(`HOST_preferencesChanged('${data.projectPreferences}','${data.applicationPreferences}');`);
-        });
+        }));
 
 
         return editor;
         return editor;
     }
     }

+ 1 - 1
Script/AtomicNET/AtomicNETService/Program.cs

@@ -54,7 +54,7 @@ namespace AtomicTools
                     // exit service
                     // exit service
                     case "exit":
                     case "exit":
 
 
-                        app.SendEvent("ExitRequested");
+                        app.SendEvent(Atomic.ExitRequestedEventName);
                         break;
                         break;
 
 
                 }
                 }

+ 14 - 5
Script/AtomicWebViewEditor/clientExtensions/ClientExtensionServices.ts

@@ -43,11 +43,20 @@ export class EventDispatcher implements Editor.Extensions.EventDispatcher {
         });
         });
     }
     }
 
 
-    subscribeToEvent(eventType, callback) {
-        this.subscriptions.push({
-            eventName: eventType,
-            callback: callback
-        });
+    subscribeToEvent(eventType: string, callback: (...params) => any);
+    subscribeToEvent(wrapped: Atomic.EventMetaData);
+    subscribeToEvent(eventTypeOrWrapped: any, callback?: any) {
+        if (callback) {
+            this.subscriptions.push({
+                eventName: eventTypeOrWrapped,
+                callback: callback
+            });
+        } else {
+            this.subscriptions.push({
+                eventName: eventTypeOrWrapped._eventType,
+                callback: eventTypeOrWrapped._callback
+            });
+        }
     }
     }
 }
 }
 
 

+ 8 - 2
Script/AtomicWebViewEditor/clientExtensions/ServiceLocator.ts

@@ -64,9 +64,15 @@ export class ClientServiceLocatorType implements Editor.ClientExtensions.ClientS
      * @param  {string} eventType
      * @param  {string} eventType
      * @param  {any} callback
      * @param  {any} callback
      */
      */
-    subscribeToEvent(eventType: string, callback: (data: any) => void) {
+    subscribeToEvent(eventType: string, callback: (...params) => any);
+    subscribeToEvent(wrapped: Atomic.EventMetaData);
+    subscribeToEvent(eventTypeOrWrapped: any, callback?: any) {
         if (this.eventDispatcher) {
         if (this.eventDispatcher) {
-            this.eventDispatcher.subscribeToEvent(eventType, callback);
+            if (callback) {
+                this.eventDispatcher.subscribeToEvent(eventTypeOrWrapped, callback);
+            } else {
+                this.eventDispatcher.subscribeToEvent(eventTypeOrWrapped);
+            }
         }
         }
     }
     }
 
 

+ 4 - 2
Script/TypeScript/AtomicWork.d.ts

@@ -28,8 +28,10 @@ declare module Atomic {
 
 
     // Base interface for events, contains eventType string and callback
     // Base interface for events, contains eventType string and callback
     interface EventMetaData {
     interface EventMetaData {
-        _eventType: string;
-        _callback: any;
+        /**@internal*/
+        _eventType?: string;
+        /**@internal*/
+        _callback?: (...params) => any;
     }
     }
 
 
     interface NativeEvent extends EventMetaData { }
     interface NativeEvent extends EventMetaData { }

+ 7 - 1
Script/TypeScript/EditorWork.d.ts

@@ -208,7 +208,13 @@ declare module Editor.Extensions {
          * @param  {string} eventType
          * @param  {string} eventType
          * @param  {any} callback
          * @param  {any} callback
          */
          */
-        subscribeToEvent(eventType, callback);
+        subscribeToEvent?(eventType: string, callback: (...params) => any);
+
+        /**
+         * Subscribe to an event with a pre-wrapped event object.  This can be used by services to subscribe to custom events
+         * @param  {Atomic.EventMetaData} wrappedEvent
+         */
+        subscribeToEvent?(wrappedEvent: Atomic.EventMetaData);
     }
     }
 
 
     /**
     /**

+ 4 - 1
Source/Atomic/UI/UIEvents.h

@@ -123,6 +123,10 @@ ATOMIC_EVENT(E_UIWIDGETFOCUSESCAPED, UIWidgetFocusEscaped)
 {
 {
 }
 }
 
 
+ATOMIC_EVENT(E_UIWIDGETEDITCANCELED, UIWidgetEditCanceled)
+{
+}
+
 ATOMIC_EVENT(E_UIWIDGETEDITCOMPLETE, UIWidgetEditComplete)
 ATOMIC_EVENT(E_UIWIDGETEDITCOMPLETE, UIWidgetEditComplete)
 {
 {
     ATOMIC_PARAM(P_WIDGET, Widget);             // UIWidget pointer
     ATOMIC_PARAM(P_WIDGET, Widget);             // UIWidget pointer
@@ -139,5 +143,4 @@ ATOMIC_EVENT(E_UILISTVIEWSELECTIONCHANGED, UIListViewSelectionChanged)
     ATOMIC_PARAM(P_SELECTED, Selected);        // bool
     ATOMIC_PARAM(P_SELECTED, Selected);        // bool
 }
 }
 
 
-
 }
 }

+ 15 - 0
Source/AtomicEditor/Editors/SceneEditor3D/SceneEditor3DEvents.h

@@ -174,4 +174,19 @@ ATOMIC_EVENT(E_CUBEMAPRENDEREND, CubemapRenderEnd)
 
 
 }
 }
 
 
+ATOMIC_EVENT(E_COMPONENTEDITEND, ComponentEditEnd)
+{
+
+}
+
+ATOMIC_EVENT(E_COLORCHOOSERCHANGED, ColorChooserChanged)
+{
+}
+
+ATOMIC_EVENT(E_SELECTIONCREATECOMPONENT, SelectionCreateComponent)
+{
+    ATOMIC_PARAM(P_COMPONENTTYPENAME, ComponentTypeName);
+}
+
+
 }
 }

+ 1 - 1
Source/ToolCore/JSBind/JSBTypeScript.cpp

@@ -423,7 +423,7 @@ void JSBTypeScript::ExportModuleEvents(JSBModule* module)
             {
             {
                 typeName = "number";
                 typeName = "number";
                 mapped = true;
                 mapped = true;
-            } else if (typeName == "bool") {
+            } else if (typeName == "bool" || typeName == "boolean") {
                 typeName = "boolean";
                 typeName = "boolean";
                 mapped = true;
                 mapped = true;
             } else if (typeName == "string") {
             } else if (typeName == "string") {