Browse Source

All editor events have now been mapped to native events. Next step is to clean up the events and weed out duplicates if possible.

Shaddock Heath 9 years ago
parent
commit
0bfea61e06

+ 8 - 9
Script/AtomicEditor/editor/Editor.ts

@@ -21,7 +21,6 @@
 //
 //
 
 
 import EditorUI = require("ui/EditorUI");
 import EditorUI = require("ui/EditorUI");
-import UIEvents = require("ui/UIEvents");
 import PlayMode = require("ui/playmode/PlayMode");
 import PlayMode = require("ui/playmode/PlayMode");
 import EditorLicense = require("./EditorLicense");
 import EditorLicense = require("./EditorLicense");
 import EditorEvents = require("./EditorEvents");
 import EditorEvents = require("./EditorEvents");
@@ -63,12 +62,12 @@ class AtomicEditor extends Atomic.ScriptObject {
 
 
         this.subscribeToEvent(Editor.EditorLoadProjectEvent((data) => this.handleEditorLoadProject(data)));
         this.subscribeToEvent(Editor.EditorLoadProjectEvent((data) => this.handleEditorLoadProject(data)));
         this.subscribeToEvent(Editor.EditorCloseProjectEvent((data) => this.handleEditorCloseProject(data)));
         this.subscribeToEvent(Editor.EditorCloseProjectEvent((data) => this.handleEditorCloseProject(data)));
-        this.subscribeToEvent(EditorEvents.ProjectUnloadedNotificationEvent((data) => {
+        this.subscribeToEvent(Editor.ProjectUnloadedNotificationEvent((data) => {
             Atomic.graphics.windowTitle = "AtomicEditor";
             Atomic.graphics.windowTitle = "AtomicEditor";
             this.handleProjectUnloaded(data);
             this.handleProjectUnloaded(data);
         }));
         }));
 
 
-        this.subscribeToEvent(Atomic.ScriptEvent("IPCPlayerWindowChanged", /*AtomicApp.IPCPlayerWindowChangedEvent(*/ (data: AtomicApp.IPCPlayerWindowChangedEvent) => {
+        this.subscribeToEvent(Atomic.ScriptEvent(EditorEvents.IPCPlayerWindowChangedEventType, (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) {
@@ -187,13 +186,13 @@ class AtomicEditor extends Atomic.ScriptObject {
         this.sendEvent(Editor.UserPreferencesChangedNotificationEventType, eventData);
         this.sendEvent(Editor.UserPreferencesChangedNotificationEventType, eventData);
     }
     }
 
 
-    handleEditorLoadProject(event: EditorEvents.LoadProjectEvent): boolean {
+    handleEditorLoadProject(event: Editor.LoadProjectNotificationEvent): boolean {
 
 
         var system = ToolCore.getToolSystem();
         var system = ToolCore.getToolSystem();
         if (system.project) {
         if (system.project) {
 
 
-            this.sendEvent(UIEvents.MessageModalEventName,
-                { type: "error", title: "Project already loaded", message: "Project already loaded" });
+            this.sendEvent(Editor.EditorModalEventType,
+                { type: Editor.EDITOR_MODALERROR, title: "Project already loaded", message: "Project already loaded" });
 
 
             return false;
             return false;
 
 
@@ -203,7 +202,7 @@ class AtomicEditor extends Atomic.ScriptObject {
             Preferences.getInstance().loadUserPrefs();
             Preferences.getInstance().loadUserPrefs();
             WebView.WebBrowserHost.setGlobalStringProperty("HOST_Preferences", "ProjectPreferences", JSON.stringify(Preferences.getInstance().cachedProjectPreferences, null, 2 ));
             WebView.WebBrowserHost.setGlobalStringProperty("HOST_Preferences", "ProjectPreferences", JSON.stringify(Preferences.getInstance().cachedProjectPreferences, null, 2 ));
             WebView.WebBrowserHost.setGlobalStringProperty("HOST_Preferences", "ApplicationPreferences", JSON.stringify(Preferences.getInstance().cachedApplicationPreferences, null, 2 ));
             WebView.WebBrowserHost.setGlobalStringProperty("HOST_Preferences", "ApplicationPreferences", JSON.stringify(Preferences.getInstance().cachedApplicationPreferences, null, 2 ));
-            this.sendEvent(EditorEvents.LoadProjectNotification, event);
+            this.sendEvent(Editor.LoadProjectNotificationEventType, event);
         }
         }
         return loaded;
         return loaded;
     }
     }
@@ -227,12 +226,12 @@ class AtomicEditor extends Atomic.ScriptObject {
 
 
     handleEditorCloseProject(event) {
     handleEditorCloseProject(event) {
         this.projectCloseRequested = true;
         this.projectCloseRequested = true;
-        this.sendEvent(EditorEvents.ProjectUnloadedNotification, event);
+        this.sendEvent(Editor.ProjectUnloadedNotificationEventType, event);
         this.closeAllResourceEditors();
         this.closeAllResourceEditors();
     }
     }
 
 
     closeProject() {
     closeProject() {
-        this.sendEvent("IPCPlayerExitRequest" /*AtomicApp.IPCPlayerExitRequestEventName*/);
+        this.sendEvent(EditorEvents.IPCPlayerExitRequestEventType);
         var system = ToolCore.getToolSystem();
         var system = ToolCore.getToolSystem();
 
 
         if (system.project) {
         if (system.project) {

+ 4 - 42
Script/AtomicEditor/editor/EditorEvents.ts

@@ -20,45 +20,7 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-export const PlayerLog = "EditorPlayerLog";
-export function PlayerLogEvent(callback: Atomic.EventCallback<PlayerLogEvent>) {
-    return Atomic.ScriptEvent(PlayerLog, callback);
-}
-export interface PlayerLogEvent extends Atomic.EventMetaData {
-
-  message: string;
-  level: number;
-
-}
-
-export const ProjectUnloadedNotification = "ProjectUnloadedNotification";
-export function ProjectUnloadedNotificationEvent(callback: Atomic.EventCallback<null>) {
-    return Atomic.ScriptEvent(ProjectUnloadedNotification, callback);
-}
-
-export const RequestProjectLoad = "RequestProjectLoad";
-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
-  path: string;
-
-}
-
-export const ProjectLoaded = "ProjectLoaded";
-export function ProjectLoadedEvent(callback: Atomic.EventCallback<null>) {
-    return Atomic.ScriptEvent(ProjectLoaded, callback);
-}
-
-export const LoadProjectNotification = "EditorLoadProjectNotification";
-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
-  path: string;
-
-}
+// These are exposed in AtomicApp, but that module is not available to call until the player is playing
+// but we need the event names
+export const IPCPlayerExitRequestEventType = "IPCPlayerExitRequest";
+export const IPCPlayerWindowChangedEventType = "IPCPlayerWindowChanged";

+ 1 - 2
Script/AtomicEditor/hostExtensions/HostExtensionServices.ts

@@ -20,7 +20,6 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-import * as EditorEvents from "../editor/EditorEvents";
 import * as EditorUI from "../ui/EditorUI";
 import * as EditorUI from "../ui/EditorUI";
 import MainFrame = require("../ui/frames/MainFrame");
 import MainFrame = require("../ui/frames/MainFrame");
 import InspectorFrame = require("../ui/frames/inspector/InspectorFrame");
 import InspectorFrame = require("../ui/frames/inspector/InspectorFrame");
@@ -70,7 +69,7 @@ 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.LoadProjectNotificationEvent((ev) => this.projectLoaded(ev)));
+        eventDispatcher.subscribeToEvent(Editor.LoadProjectNotificationEvent((ev) => this.projectLoaded(ev)));
         eventDispatcher.subscribeToEvent(Editor.EditorCloseProjectEvent((ev) => this.projectUnloaded(ev)));
         eventDispatcher.subscribeToEvent(Editor.EditorCloseProjectEvent((ev) => this.projectUnloaded(ev)));
         eventDispatcher.subscribeToEvent(Editor.EditorPlayRequestEvent(() => this.playerStarted()));
         eventDispatcher.subscribeToEvent(Editor.EditorPlayRequestEvent(() => this.playerStarted()));
     }
     }

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

@@ -20,7 +20,6 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-import EditorEvents = require("../editor/EditorEvents");
 import EditorUI = require("../ui/EditorUI");
 import EditorUI = require("../ui/EditorUI");
 import ProjectTemplates = require("ProjectTemplates");
 import ProjectTemplates = require("ProjectTemplates");
 
 
@@ -36,11 +35,11 @@ class ResourceOps extends Atomic.ScriptObject {
 
 
         }));
         }));
 
 
-        this.subscribeToEvent(EditorEvents.RequestProjectLoadEvent((ev: EditorEvents.RequestProjectLoadEvent) => { this.handleRequestProjectLoad(ev); }));
+        this.subscribeToEvent(Editor.RequestProjectLoadEvent((ev: Editor.RequestProjectLoadEvent) => { this.handleRequestProjectLoad(ev); }));
 
 
     }
     }
 
 
-    handleRequestProjectLoad(ev:EditorEvents.RequestProjectLoadEvent) {
+    handleRequestProjectLoad(ev:Editor.RequestProjectLoadEvent) {
 
 
         var fs = Atomic.fileSystem;
         var fs = Atomic.fileSystem;
         var projectPath = Atomic.addTrailingSlash(Atomic.getPath(ev.path));
         var projectPath = Atomic.addTrailingSlash(Atomic.getPath(ev.path));

+ 0 - 36
Script/AtomicEditor/ui/UIEvents.ts

@@ -1,36 +0,0 @@
-//
-// Copyright (c) 2014-2016 THUNDERBEAST GAMES LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-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 function ResourceEditorChangedEvent(callback : Atomic.EventCallback<null>) {
-    return Atomic.ScriptEvent(ResourceEditorChanged, callback);
-}

+ 3 - 6
Script/AtomicEditor/ui/frames/MainFrame.ts

@@ -28,13 +28,10 @@ import HierarchyFrame = require("./HierarchyFrame");
 import MainToolbar = require("ui//MainToolbar");
 import MainToolbar = require("ui//MainToolbar");
 import AnimationToolbar = require("ui//AnimationToolbar");
 import AnimationToolbar = require("ui//AnimationToolbar");
 
 
-import UIEvents = require("ui/UIEvents");
-
 import ScriptWidget = require("ui/ScriptWidget");
 import ScriptWidget = require("ui/ScriptWidget");
 import MainFrameMenu = require("./menus/MainFrameMenu");
 import MainFrameMenu = require("./menus/MainFrameMenu");
 
 
 import MenuItemSources = require("./menus/MenuItemSources");
 import MenuItemSources = require("./menus/MenuItemSources");
-import * as EditorEvents from "../../editor/EditorEvents";
 
 
 class MainFrame extends ScriptWidget {
 class MainFrame extends ScriptWidget {
 
 
@@ -63,14 +60,14 @@ class MainFrame extends ScriptWidget {
 
 
         this.disableProjectMenus();
         this.disableProjectMenus();
 
 
-        this.subscribeToEvent(UIEvents.ResourceEditorChangedEvent((data) => this.handleResourceEditorChanged(data)));
+        this.subscribeToEvent(Editor.ResourceEditorChangedEvent((data) => this.handleResourceEditorChanged(data)));
 
 
-        this.subscribeToEvent(EditorEvents.ProjectLoadedEvent((data) => {
+        this.subscribeToEvent(Editor.ProjectLoadedEvent((data) => {
             this.showWelcomeFrame(false);
             this.showWelcomeFrame(false);
             this.enableProjectMenus();
             this.enableProjectMenus();
         }));
         }));
 
 
-        this.subscribeToEvent(EditorEvents.ProjectUnloadedNotificationEvent((data) => {
+        this.subscribeToEvent(Editor.ProjectUnloadedNotificationEvent((data) => {
             this.showWelcomeFrame(true);
             this.showWelcomeFrame(true);
             this.disableProjectMenus();
             this.disableProjectMenus();
         }));
         }));

+ 2 - 3
Script/AtomicEditor/ui/frames/ProjectFrame.ts

@@ -22,7 +22,6 @@
 
 
 import ScriptWidget = require("ui/ScriptWidget");
 import ScriptWidget = require("ui/ScriptWidget");
 import {default as AtomicEditor} from "editor/Editor";
 import {default as AtomicEditor} from "editor/Editor";
-import EditorEvents = require("editor/EditorEvents");
 import ProjectFrameMenu = require("./menus/ProjectFrameMenu");
 import ProjectFrameMenu = require("./menus/ProjectFrameMenu");
 import MenuItemSources = require("./menus/MenuItemSources");
 import MenuItemSources = require("./menus/MenuItemSources");
 import SearchBarFiltering = require("resources/SearchBarFiltering");
 import SearchBarFiltering = require("resources/SearchBarFiltering");
@@ -68,8 +67,8 @@ class ProjectFrame extends ScriptWidget {
         foldercontainer.addChild(folderList);
         foldercontainer.addChild(folderList);
 
 
         // events
         // events
-        this.subscribeToEvent(EditorEvents.ProjectLoadedEvent((data) => this.handleProjectLoaded(data)));
-        this.subscribeToEvent(EditorEvents.ProjectUnloadedNotificationEvent((data) => this.handleProjectUnloaded(data)));
+        this.subscribeToEvent(Editor.ProjectLoadedEvent((data) => this.handleProjectLoaded(data)));
+        this.subscribeToEvent(Editor.ProjectUnloadedNotificationEvent((data) => this.handleProjectUnloaded(data)));
         this.subscribeToEvent(Atomic.DragEndedEvent((data: Atomic.DragEndedEvent) => this.handleDragEnded(data)));
         this.subscribeToEvent(Atomic.DragEndedEvent((data: Atomic.DragEndedEvent) => this.handleDragEnded(data)));
 
 
         this.subscribeToEvent(ToolCore.ResourceAddedEvent((ev: ToolCore.ResourceAddedEvent) => this.handleResourceAdded(ev)));
         this.subscribeToEvent(ToolCore.ResourceAddedEvent((ev: ToolCore.ResourceAddedEvent) => this.handleResourceAdded(ev)));

+ 3 - 5
Script/AtomicEditor/ui/frames/ResourceFrame.ts

@@ -21,8 +21,6 @@
 //
 //
 
 
 import ScriptWidget = require("ui/ScriptWidget");
 import ScriptWidget = require("ui/ScriptWidget");
-import EditorEvents = require("editor/EditorEvents");
-import UIEvents = require("ui/UIEvents");
 import ResourceEditorProvider from "../ResourceEditorProvider";
 import ResourceEditorProvider from "../ResourceEditorProvider";
 
 
 // the root content of editor widgets (rootContentWidget property) are extended with an editor field
 // the root content of editor widgets (rootContentWidget property) are extended with an editor field
@@ -224,7 +222,7 @@ class ResourceFrame extends ScriptWidget {
 
 
                     }
                     }
 
 
-                    this.sendEvent(UIEvents.ResourceEditorChanged, { editor: w.editor });
+                    this.sendEvent(Editor.ResourceEditorChangedEventType, { editor: w.editor });
 
 
                 }
                 }
 
 
@@ -278,7 +276,7 @@ class ResourceFrame extends ScriptWidget {
         this.resourceEditorProvider = new ResourceEditorProvider(this);
         this.resourceEditorProvider = new ResourceEditorProvider(this);
         this.resourceEditorProvider.loadStandardEditors();
         this.resourceEditorProvider.loadStandardEditors();
 
 
-        this.subscribeToEvent(EditorEvents.ProjectUnloadedNotificationEvent((data) => this.handleProjectUnloaded(data)));
+        this.subscribeToEvent(Editor.ProjectUnloadedNotificationEvent((data) => this.handleProjectUnloaded(data)));
         this.subscribeToEvent(Editor.EditorEditResourceEvent((data) => this.handleEditResource(data)));
         this.subscribeToEvent(Editor.EditorEditResourceEvent((data) => this.handleEditResource(data)));
         this.subscribeToEvent(Editor.EditorSaveResourceEvent((data) => this.handleSaveResource(data)));
         this.subscribeToEvent(Editor.EditorSaveResourceEvent((data) => this.handleSaveResource(data)));
         this.subscribeToEvent(Editor.EditorSaveAllResourcesEvent((data) => this.handleSaveAllResources()));
         this.subscribeToEvent(Editor.EditorSaveAllResourcesEvent((data) => this.handleSaveAllResources()));
@@ -286,7 +284,7 @@ class ResourceFrame extends ScriptWidget {
         this.subscribeToEvent(Editor.EditorRenameResourceNotificationEvent((ev: Editor.EditorRenameResourceNotificationEvent) => this.handleRenameResource(ev)));
         this.subscribeToEvent(Editor.EditorRenameResourceNotificationEvent((ev: Editor.EditorRenameResourceNotificationEvent) => this.handleRenameResource(ev)));
         this.subscribeToEvent(Editor.EditorDeleteResourceNotificationEvent((data) => this.handleDeleteResource(data)));
         this.subscribeToEvent(Editor.EditorDeleteResourceNotificationEvent((data) => this.handleDeleteResource(data)));
 
 
-        this.subscribeToEvent(UIEvents.ResourceEditorChangedEvent((data) => this.handleResourceEditorChanged(data)));
+        this.subscribeToEvent(Editor.ResourceEditorChangedEvent((data) => this.handleResourceEditorChanged(data)));
 
 
         this.subscribeToEvent(Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
         this.subscribeToEvent(Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
 
 

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

@@ -20,7 +20,6 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-import EditorEvents = require("editor/EditorEvents");
 import EditorUI = require("ui/EditorUI");
 import EditorUI = require("ui/EditorUI");
 import ScriptWidget = require("ui/ScriptWidget");
 import ScriptWidget = require("ui/ScriptWidget");
 import Preferences = require("editor/Preferences");
 import Preferences = require("editor/Preferences");
@@ -233,7 +232,7 @@ class WelcomeFrame extends ScriptWidget {
                 var path = utils.openProjectFileDialog();
                 var path = utils.openProjectFileDialog();
                 if (path) {
                 if (path) {
 
 
-                    this.sendEvent(EditorEvents.RequestProjectLoad, { path: path });
+                    this.sendEvent(Editor.RequestProjectLoadEventType, { path: path });
 
 
                 }
                 }
 
 
@@ -253,7 +252,7 @@ class WelcomeFrame extends ScriptWidget {
                     return;
                     return;
                 }
                 }
                 var path: string = this.recent[this.recentList.getSelectedItemID()];
                 var path: string = this.recent[this.recentList.getSelectedItemID()];
-                this.sendEvent(EditorEvents.RequestProjectLoad, { path: path });
+                this.sendEvent(Editor.RequestProjectLoadEventType, { path: path });
             }
             }
 
 
             if (id == "recentProjectsContextMenu") {
             if (id == "recentProjectsContextMenu") {

+ 1 - 2
Script/AtomicEditor/ui/frames/inspector/InspectorFrame.ts

@@ -20,7 +20,6 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-import EditorEvents = require("editor/EditorEvents");
 import ScriptWidget = require("ui/ScriptWidget");
 import ScriptWidget = require("ui/ScriptWidget");
 
 
 // inspectors
 // inspectors
@@ -55,7 +54,7 @@ class InspectorFrame extends ScriptWidget {
         var container = this.getWidget("inspectorcontainer");
         var container = this.getWidget("inspectorcontainer");
 
 
         this.subscribeToEvent(Editor.EditorEditResourceEvent((data) => this.handleEditResource(data)));
         this.subscribeToEvent(Editor.EditorEditResourceEvent((data) => this.handleEditResource(data)));
-        this.subscribeToEvent(EditorEvents.ProjectUnloadedNotificationEvent((data) => this.handleProjectUnloaded(data)));
+        this.subscribeToEvent(Editor.ProjectUnloadedNotificationEvent((data) => this.handleProjectUnloaded(data)));
 
 
         this.subscribeToEvent(Editor.EditorActiveSceneEditorChangeEvent((data) => this.handleActiveSceneEditorChanged(data)));
         this.subscribeToEvent(Editor.EditorActiveSceneEditorChangeEvent((data) => this.handleActiveSceneEditorChanged(data)));
 
 

+ 0 - 1
Script/AtomicEditor/ui/frames/inspector/MaterialInspector.ts

@@ -21,7 +21,6 @@
 //
 //
 
 
 import ScriptWidget = require("ui/ScriptWidget");
 import ScriptWidget = require("ui/ScriptWidget");
-import UIEvents = require("ui/UIEvents");
 import EditorUI = require("ui/EditorUI");
 import EditorUI = require("ui/EditorUI");
 
 
 import TextureSelector = require("./TextureSelector");
 import TextureSelector = require("./TextureSelector");

+ 0 - 1
Script/AtomicEditor/ui/frames/inspector/TextureInspector.ts

@@ -21,7 +21,6 @@
 //
 //
 
 
 import ScriptWidget = require("ui/ScriptWidget");
 import ScriptWidget = require("ui/ScriptWidget");
-import UIEvents = require("ui/UIEvents");
 import EditorUI = require("ui/EditorUI");
 import EditorUI = require("ui/EditorUI");
 import InspectorWidget = require("./InspectorWidget");
 import InspectorWidget = require("./InspectorWidget");
 import InspectorUtils = require("./InspectorUtils");
 import InspectorUtils = require("./InspectorUtils");

+ 1 - 2
Script/AtomicEditor/ui/frames/menus/MainFrameMenu.ts

@@ -21,7 +21,6 @@
 //
 //
 
 
 import strings = require("../../EditorStrings");
 import strings = require("../../EditorStrings");
-import EditorEvents = require("../../../editor/EditorEvents");
 import EditorUI = require("../../EditorUI");
 import EditorUI = require("../../EditorUI");
 import MenuItemSources = require("./MenuItemSources");
 import MenuItemSources = require("./MenuItemSources");
 import Preferences = require("editor/Preferences");
 import Preferences = require("editor/Preferences");
@@ -171,7 +170,7 @@ class MainFrameMenu extends Atomic.ScriptObject {
 
 
                 }
                 }
 
 
-                var requestProjectLoad = () => this.sendEvent(EditorEvents.RequestProjectLoad, { path: path });
+                var requestProjectLoad = () => this.sendEvent(Editor.RequestProjectLoadEventType, { path: path });
 
 
                 if (ToolCore.toolSystem.project) {
                 if (ToolCore.toolSystem.project) {
 
 

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

@@ -20,7 +20,6 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-import UIEvents = require("../UIEvents");
 import EditorUI = require("../EditorUI");
 import EditorUI = require("../EditorUI");
 
 
 export class MessageModal extends Atomic.ScriptObject {
 export class MessageModal extends Atomic.ScriptObject {
@@ -37,9 +36,9 @@ export class MessageModal extends Atomic.ScriptObject {
 
 
     super();
     super();
 
 
-    this.subscribeToEvent(UIEvents.MessageModalEvent((data) => {
+    this.subscribeToEvent(Editor.EditorModalEvent((data) => {
 
 
-      if (data.type == "error") {
+      if (data.type == Editor.EDITOR_MODALERROR) {
 
 
         this.showErrorWindow(data.title, data.message);
         this.showErrorWindow(data.title, data.message);
 
 

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

@@ -23,7 +23,6 @@
 import EditorUI = require("ui/EditorUI");
 import EditorUI = require("ui/EditorUI");
 import ModalWindow = require("../ModalWindow");
 import ModalWindow = require("../ModalWindow");
 import ProgressModal = require("../ProgressModal");
 import ProgressModal = require("../ProgressModal");
-import UIEvents = require("../../UIEvents");
 
 
 import WindowsSettingsWidget = require("./platforms/WindowsSettingsWidget");
 import WindowsSettingsWidget = require("./platforms/WindowsSettingsWidget");
 import MacSettingsWidget = require("./platforms/MacSettingsWidget");
 import MacSettingsWidget = require("./platforms/MacSettingsWidget");

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

@@ -20,7 +20,6 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-import EditorEvents = require("../../editor/EditorEvents");
 import EditorUI = require("../EditorUI");
 import EditorUI = require("../EditorUI");
 import Preferences = require("../../editor/Preferences");
 import Preferences = require("../../editor/Preferences");
 
 
@@ -52,7 +51,7 @@ class PlayerOutput extends Atomic.UIWindow {
         };
         };
 
 
         this.subscribeToEvent(this, Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
         this.subscribeToEvent(this, Atomic.UIWidgetEvent((data) => this.handleWidgetEvent(data)));
-        this.subscribeToEvent(EditorEvents.PlayerLogEvent((ev: EditorEvents.PlayerLogEvent) => this.handlePlayerLog(ev)));
+        this.subscribeToEvent(Editor.EditorPlayerLogEvent((ev: Editor.EditorPlayerLogEvent) => this.handlePlayerLog(ev)));
 
 
         this.resizeToFitContent();
         this.resizeToFitContent();
         this.center();
         this.center();
@@ -60,7 +59,7 @@ class PlayerOutput extends Atomic.UIWindow {
 
 
     }
     }
 
 
-    handlePlayerLog(ev: EditorEvents.PlayerLogEvent) {
+    handlePlayerLog(ev: Editor.EditorPlayerLogEvent) {
 
 
         var text = this.output.text;
         var text = this.output.text;
 
 

+ 0 - 1
Script/tsconfig.json

@@ -112,7 +112,6 @@
         "./AtomicEditor/ui/resourceEditors/XMLResourceEditorBuilder.ts",
         "./AtomicEditor/ui/resourceEditors/XMLResourceEditorBuilder.ts",
         "./AtomicEditor/ui/ScriptWidget.ts",
         "./AtomicEditor/ui/ScriptWidget.ts",
         "./AtomicEditor/ui/Shortcuts.ts",
         "./AtomicEditor/ui/Shortcuts.ts",
-        "./AtomicEditor/ui/UIEvents.ts",
         "./TypeScript/Atomic.d.ts",
         "./TypeScript/Atomic.d.ts",
         "./TypeScript/AtomicApp.d.ts",
         "./TypeScript/AtomicApp.d.ts",
         "./TypeScript/AtomicNETScript.d.ts",
         "./TypeScript/AtomicNETScript.d.ts",

+ 39 - 7
Source/AtomicEditor/EditorMode/AEEditorEvents.h

@@ -57,7 +57,7 @@ ATOMIC_EVENT(E_JAVASCRIPTSAVED, JavascriptSaved)
 
 
 }
 }
 
 
-// editor play request
+// emitted when the play button has been pressed in the editor, but the player has not yet started
 ATOMIC_EVENT(E_EDITORPLAYREQUEST, EditorPlayRequest)
 ATOMIC_EVENT(E_EDITORPLAYREQUEST, EditorPlayRequest)
 {
 {
     ATOMIC_PARAM(P_MODE, Mode);    // uint (AEPlayerMode)
     ATOMIC_PARAM(P_MODE, Mode);    // uint (AEPlayerMode)
@@ -70,7 +70,6 @@ ATOMIC_EVENT(E_EDITORPLAYSTOP, EditorPlayStop)
 
 
 }
 }
 
 
-// stop play mode
 ATOMIC_EVENT(E_EDITORRESOURCEEDITORCHANGED, EditorResourceEditorChanged)
 ATOMIC_EVENT(E_EDITORRESOURCEEDITORCHANGED, EditorResourceEditorChanged)
 {
 {
     ATOMIC_PARAM(P_RESOURCEEDITOR, ResourceEditor); // ResourceEditor*
     ATOMIC_PARAM(P_RESOURCEEDITOR, ResourceEditor); // ResourceEditor*
@@ -112,12 +111,12 @@ ATOMIC_EVENT(E_EDITORBUILD, EditorBuild)
 static const unsigned EDITOR_MODALERROR = 0x1;
 static const unsigned EDITOR_MODALERROR = 0x1;
 static const unsigned EDITOR_MODALINFO = 0x2;
 static const unsigned EDITOR_MODALINFO = 0x2;
 
 
-
+// emitted to display a modal message in the editor
 ATOMIC_EVENT(E_EDITORMODAL, EditorModal)
 ATOMIC_EVENT(E_EDITORMODAL, EditorModal)
 {
 {
-    ATOMIC_PARAM(P_TYPE, Type);      // uint (EDITOR_ERROR_MODAL, etc)
-    ATOMIC_PARAM(P_TITLE, Title);      // for modal errors, title text
-    ATOMIC_PARAM(P_MESSAGE, Message);    // for modal errors, error text
+    ATOMIC_PARAM(P_TYPE, Type);      // uint (Type can be EDITOR_MODALERROR, EDITOR_MODAL_INFOT)
+    ATOMIC_PARAM(P_TITLE, Title);      // string (for modal errors, title text)
+    ATOMIC_PARAM(P_MESSAGE, Message);    // string (for modal errors, error text)
 }
 }
 
 
 ATOMIC_EVENT(E_EDITORACTIVESCENEEDITORCHANGE, EditorActiveSceneEditorChange)
 ATOMIC_EVENT(E_EDITORACTIVESCENEEDITORCHANGE, EditorActiveSceneEditorChange)
@@ -181,6 +180,7 @@ ATOMIC_EVENT(E_CONTENTFOLDERCHANGED, ContentFolderChanged)
     ATOMIC_PARAM(P_PATH, Path);     // string
     ATOMIC_PARAM(P_PATH, Path);     // string
 }
 }
 
 
+// emitted when the editor has been requested to close the current project.
 ATOMIC_EVENT(E_EDITORCLOSEPROJECT, EditorCloseProject)
 ATOMIC_EVENT(E_EDITORCLOSEPROJECT, EditorCloseProject)
 {
 {
 
 
@@ -191,6 +191,7 @@ ATOMIC_EVENT(E_EDITORPROJECTCLOSED, EditorProjectClosed)
 
 
 }
 }
 
 
+// command to save all the open editors
 ATOMIC_EVENT(E_EDITORSAVEALLRESOURCES, EditorSaveAllResources)
 ATOMIC_EVENT(E_EDITORSAVEALLRESOURCES, EditorSaveAllResources)
 {
 {
 
 
@@ -198,7 +199,7 @@ ATOMIC_EVENT(E_EDITORSAVEALLRESOURCES, EditorSaveAllResources)
 
 
 ATOMIC_EVENT(E_EDITORSAVERESOURCE, EditorSaveResource)
 ATOMIC_EVENT(E_EDITORSAVERESOURCE, EditorSaveResource)
 {
 {
-    ATOMIC_PARAM(P_PATH, Path);     // string
+    ATOMIC_PARAM(P_PATH, Path);     // string full path of the current resource
 }
 }
 
 
 // Called once the resource has been saved
 // Called once the resource has been saved
@@ -248,4 +249,35 @@ ATOMIC_EVENT(E_ATTRIBUTEEDITRESOURCECHANGED, AttributeEditResourceChanged)
     ATOMIC_PARAM(P_RESOURCE, Resource); // Resource pointer
     ATOMIC_PARAM(P_RESOURCE, Resource); // Resource pointer
 }
 }
 
 
+ATOMIC_EVENT(E_RESOURCEEDITORCHANGED, ResourceEditorChanged)
+{
+    ATOMIC_PARAM(P_EDITOR, Editor); // ResourceEditor pointer
+}
+
+ATOMIC_EVENT(E_EDITORPLAYERLOG, EditorPlayerLog)
+{
+    ATOMIC_PARAM(P_MESSAGE, Message);   // string
+    ATOMIC_PARAM(P_LEVEL, Level);       // int
+}
+
+ATOMIC_EVENT(E_PROJECTUNLOADEDNOTIFICATION, ProjectUnloadedNotification)
+{
+
+}
+
+ATOMIC_EVENT(E_REQUESTPROJECTLOAD, RequestProjectLoad)
+{
+    ATOMIC_PARAM(P_PATH, Path);     // string (Full path to the .atomic file)
+}
+
+ATOMIC_EVENT(E_PROJECTLOADED, ProjectLoaded)
+{
+
+}
+
+ATOMIC_EVENT(E_LOADPROJECTNOTIFICATION,LoadProjectNotification)
+{
+    ATOMIC_PARAM(P_PATH, Path);     // string (Full path to the .atomic file)
+}
+
 }
 }

+ 2 - 0
Source/ToolCore/JSBind/JSBEvent.cpp

@@ -112,6 +112,8 @@ bool JSBEvent::ScanModuleEvents(JSBModule* module)
             if (line.StartsWith("ATOMIC_EVENT"))
             if (line.StartsWith("ATOMIC_EVENT"))
             {
             {
                 // First check to see if there is a line comment above this and try to capture it
                 // First check to see if there is a line comment above this and try to capture it
+                eventComment = NULL;
+
                 if (j > 0) {
                 if (j > 0) {
                     String prevLine = lines[j-1].Trimmed();
                     String prevLine = lines[j-1].Trimmed();
                     if (prevLine.StartsWith(("//")))
                     if (prevLine.StartsWith(("//")))