Browse Source

fix merge conflicts, incorporated updates from the ts extension into the js extension, added an info box for when you select a project or hierarchy plugin menu item, tweaks and optimizations

Shaddock Heath 9 years ago
parent
commit
997238ae46

+ 7 - 0
EditorPluginExample/Resources/EditorData/Infobox.tb.txt

@@ -0,0 +1,7 @@
+TBLayout: axis: y, distribution: gravity, position: left
+	TBLayout:
+		TBTextField:  id: infobox_msg, text: ""
+			lp: min-width: 250
+	TBSeparator: gravity: left right, skin: AESeparator
+	TBLayout:
+		TBButton: text: Ok, id: infobox_ok

+ 5 - 0
EditorPluginExample/Resources/EditorData/Infobox.tb.txt.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "7500b687e7956e510de690bb119fc614",
+	"TextImporter": {}
+}

+ 62 - 8
EditorPluginExample/Resources/EditorData/JSExample.plugin.js

@@ -1,11 +1,13 @@
 var ExamplePluginUILabel = "JS Example Plugin";
 var ExamplePluginUILabel = "JS Example Plugin";
 var ExamplePluginTBPath = "EditorData/Example.tb.txt";
 var ExamplePluginTBPath = "EditorData/Example.tb.txt";
+var InfoboxTBPath = "EditorData/Infobox.tb.txt";
 
 
 // Private variables
 // Private variables
 var serviceLocator = null;
 var serviceLocator = null;
 var extensionWindow = null;
 var extensionWindow = null;
 var helloLabel = null;
 var helloLabel = null;
 var nameField = null;
 var nameField = null;
+var lastObjectName = null;
 
 
 // Private functions
 // Private functions
 function getWidgets() {
 function getWidgets() {
@@ -15,6 +17,11 @@ function getWidgets() {
 
 
     helloLabel = extensionWindow.getWidget("example_hello");
     helloLabel = extensionWindow.getWidget("example_hello");
     nameField = extensionWindow.getWidget("example_name");
     nameField = extensionWindow.getWidget("example_name");
+
+    if (lastObjectName) {
+        nameField.text = lastObjectName;
+        lastObjectName = null;
+    }
 }
 }
 
 
 function handleWidgetEvent(ev) {
 function handleWidgetEvent(ev) {
@@ -38,6 +45,19 @@ function handleWidgetEvent(ev) {
     return false;
     return false;
 }
 }
 
 
+function showInfobox(title, msg) {
+    var infobox = serviceLocator.uiServices.showModalWindow(
+        title, InfoboxTBPath,
+        function(ev) {
+            if (ev.type == Atomic.UI_EVENT_TYPE_CLICK && ev.target.id == "infobox_ok") {
+                infobox.hide();
+                return true;
+            }
+        });
+    var msgLabel = infobox.getWidget("infobox_msg");
+    msgLabel.text = msg;
+}
+
 // Definition of the plugin
 // Definition of the plugin
 var JSExamplePlugin = {
 var JSExamplePlugin = {
     name: "JSExamplePlugin",
     name: "JSExamplePlugin",
@@ -45,7 +65,7 @@ var JSExamplePlugin = {
 };
 };
 
 
 JSExamplePlugin.initialize = function(serviceLoader) {
 JSExamplePlugin.initialize = function(serviceLoader) {
-    Atomic.print("JSExamplePluginService.initialize");
+    console.log("JSExamplePluginService.initialize");
 
 
     serviceLocator = serviceLoader;
     serviceLocator = serviceLoader;
     if (serviceLocator) {
     if (serviceLocator) {
@@ -55,9 +75,11 @@ JSExamplePlugin.initialize = function(serviceLoader) {
 };
 };
 
 
 JSExamplePlugin.projectUnloaded = function() {
 JSExamplePlugin.projectUnloaded = function() {
+    serviceLocator.uiServices.removeProjectContextMenuItemSource(ExamplePluginUILabel);
+    serviceLocator.uiServices.removeHierarchyContextMenuItemSource(ExamplePluginUILabel);
     serviceLocator.uiServices.removePluginMenuItemSource(ExamplePluginUILabel);
     serviceLocator.uiServices.removePluginMenuItemSource(ExamplePluginUILabel);
 
 
-    Atomic.print("JSExamplePluginService.projectUnloaded");
+    console.log("JSExamplePluginService.projectUnloaded");
     if (serviceLocator) {
     if (serviceLocator) {
         serviceLocator.projectServices.unregister(JSExamplePlugin);
         serviceLocator.projectServices.unregister(JSExamplePlugin);
         serviceLocator.uiServices.unregister(JSExamplePlugin);
         serviceLocator.uiServices.unregister(JSExamplePlugin);
@@ -65,20 +87,26 @@ JSExamplePlugin.projectUnloaded = function() {
 };
 };
 
 
 JSExamplePlugin.projectLoaded = function(ev) {
 JSExamplePlugin.projectLoaded = function(ev) {
-    Atomic.print("JSExamplePluginService.projectLoaded");
-    var menu = serviceLocator.uiServices.createPluginMenuItemSource(ExamplePluginUILabel, {
-        "Open": ["exampleplugin open"]
+    console.log("JSExamplePluginService.projectLoaded");
+    serviceLocator.uiServices.createPluginMenuItemSource(ExamplePluginUILabel, {
+        "Open": ["jsexampleplugin open"]
+    });
+    serviceLocator.uiServices.createHierarchyContextMenuItemSource(ExamplePluginUILabel, {
+        "Get name": ["jsexampleplugin hierarchy context"]
+    });
+    serviceLocator.uiServices.createProjectContextMenuItemSource(ExamplePluginUILabel, {
+        "Get name": ["jsexampleplugin project context"]
     });
     });
 };
 };
 
 
 JSExamplePlugin.playerStarted = function() {
 JSExamplePlugin.playerStarted = function() {
-    Atomic.print("JSExamplePluginService.playerStarted");
+    console.log("JSExamplePluginService.playerStarted");
 };
 };
 
 
 JSExamplePlugin.menuItemClicked = function(refId) {
 JSExamplePlugin.menuItemClicked = function(refId) {
-    Atomic.print("JSExamplePluginService.menuItemClicked: " + refId);
+    console.log("JSExamplePluginService.menuItemClicked: " + refId);
 
 
-    if (refId == "exampleplugin open") {
+    if (refId == "jsexampleplugin open") {
         extensionWindow = serviceLocator.uiServices.showModalWindow(
         extensionWindow = serviceLocator.uiServices.showModalWindow(
             ExamplePluginUILabel, ExamplePluginTBPath, handleWidgetEvent);
             ExamplePluginUILabel, ExamplePluginTBPath, handleWidgetEvent);
         getWidgets();
         getWidgets();
@@ -88,5 +116,31 @@ JSExamplePlugin.menuItemClicked = function(refId) {
     return false;
     return false;
 };
 };
 
 
+JSExamplePlugin.hierarchyContextItemClicked = function(node, refid) {
+    console.log("JSExamplePluginService.hierarchyContextItemClicked: " + node.name + " " + refid);
+
+    if (refid == "jsexampleplugin hierarchy context") {
+        lastObjectName = "node " + node.name;
+
+        showInfobox("Hierarchy Item Selected ", "Node: '" + node.name + "' was selected.");
+        return true;
+    }
+
+    return false;
+}
+
+JSExamplePlugin.projectContextItemClicked = function(asset, refid) {
+    console.log("JSExamplePluginService.projectContextItemClicked: " + asset.name + " " + refid);
+
+    if (refid == "jsexampleplugin project context") {
+        lastObjectName = "asset " + asset.name;
+
+        showInfobox("Project Item Selected ", "Asset: '" + asset.name + "' was selected.");
+        return true;
+    }
+
+    return false;
+}
+
 
 
 module.exports = JSExamplePlugin;
 module.exports = JSExamplePlugin;

+ 46 - 31
EditorPluginExample/Resources/EditorData/TSExample.plugin.js

@@ -1,16 +1,19 @@
-var ExamplePluginUILabel = "Example Plugin";
+"use strict";
+var ExamplePluginUILabel = "TS Example Plugin";
 var ExamplePluginTBPath = "EditorData/Example.tb.txt";
 var ExamplePluginTBPath = "EditorData/Example.tb.txt";
-var ExamplePluginService = (function () {
-    function ExamplePluginService() {
+var InfoboxTBPath = "EditorData/Infobox.tb.txt";
+var TSExamplePluginService = (function () {
+    function TSExamplePluginService() {
         var _this = this;
         var _this = this;
-        this.name = "ExampleService";
+        this.name = "TSExampleService";
         this.description = "This service demonstrates plugin functionality functionality.";
         this.description = "This service demonstrates plugin functionality functionality.";
         this.serviceLocator = null;
         this.serviceLocator = null;
         this.extensionWindow = null;
         this.extensionWindow = null;
         this.lastObjectName = null;
         this.lastObjectName = null;
         this.handleWidgetEvent = function (ev) {
         this.handleWidgetEvent = function (ev) {
-            if (!_this.extensionWindow)
+            if (!_this.extensionWindow) {
                 return;
                 return;
+            }
             if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) {
             if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) {
                 if (ev.target.id == "example_cancel") {
                 if (ev.target.id == "example_cancel") {
                     _this.extensionWindow.hide();
                     _this.extensionWindow.hide();
@@ -25,61 +28,64 @@ var ExamplePluginService = (function () {
             return false;
             return false;
         };
         };
     }
     }
-    ExamplePluginService.prototype.initialize = function (serviceLoader) {
-        Atomic.print("ExamplePluginService.initialize");
+    TSExamplePluginService.prototype.initialize = function (serviceLoader) {
+        Atomic.print("TSExamplePluginService.initialize");
         this.serviceLocator = (serviceLoader);
         this.serviceLocator = (serviceLoader);
         if (this.serviceLocator) {
         if (this.serviceLocator) {
             this.serviceLocator.projectServices.register(this);
             this.serviceLocator.projectServices.register(this);
             this.serviceLocator.uiServices.register(this);
             this.serviceLocator.uiServices.register(this);
         }
         }
     };
     };
-    ExamplePluginService.prototype.projectUnloaded = function () {
+    TSExamplePluginService.prototype.projectUnloaded = function () {
         this.serviceLocator.uiServices.removeProjectContextMenuItemSource(ExamplePluginUILabel);
         this.serviceLocator.uiServices.removeProjectContextMenuItemSource(ExamplePluginUILabel);
         this.serviceLocator.uiServices.removeHierarchyContextMenuItemSource(ExamplePluginUILabel);
         this.serviceLocator.uiServices.removeHierarchyContextMenuItemSource(ExamplePluginUILabel);
         this.serviceLocator.uiServices.removePluginMenuItemSource(ExamplePluginUILabel);
         this.serviceLocator.uiServices.removePluginMenuItemSource(ExamplePluginUILabel);
-        Atomic.print("ExamplePluginService.projectUnloaded");
+        Atomic.print("TSExamplePluginService.projectUnloaded");
         if (this.serviceLocator) {
         if (this.serviceLocator) {
             this.serviceLocator.projectServices.unregister(this);
             this.serviceLocator.projectServices.unregister(this);
             this.serviceLocator.uiServices.unregister(this);
             this.serviceLocator.uiServices.unregister(this);
         }
         }
     };
     };
-    ExamplePluginService.prototype.projectLoaded = function (ev) {
-        Atomic.print("ExamplePluginService.projectLoaded");
-        this.serviceLocator.uiServices.createPluginMenuItemSource(ExamplePluginUILabel, { "Open": ["exampleplugin open"] });
-        this.serviceLocator.uiServices.createHierarchyContextMenuItemSource(ExamplePluginUILabel, { "Get name": ["exampleplugin hierarchy context"] });
-        this.serviceLocator.uiServices.createProjectContextMenuItemSource(ExamplePluginUILabel, { "Get name": ["exampleplugin project context"] });
+    TSExamplePluginService.prototype.projectLoaded = function (ev) {
+        Atomic.print("TSExamplePluginService.projectLoaded");
+        this.serviceLocator.uiServices.createPluginMenuItemSource(ExamplePluginUILabel, { "Open": ["tsexampleplugin open"] });
+        this.serviceLocator.uiServices.createHierarchyContextMenuItemSource(ExamplePluginUILabel, { "Get name": ["tsexampleplugin hierarchy context"] });
+        this.serviceLocator.uiServices.createProjectContextMenuItemSource(ExamplePluginUILabel, { "Get name": ["tsexampleplugin project context"] });
     };
     };
-    ExamplePluginService.prototype.playerStarted = function () {
-        Atomic.print("ExamplePluginService.playerStarted");
+    TSExamplePluginService.prototype.playerStarted = function () {
+        Atomic.print("TSExamplePluginService.playerStarted");
     };
     };
-    ExamplePluginService.prototype.menuItemClicked = function (refId) {
-        Atomic.print("ExamplePluginService.menuItemClicked: " + refId);
-        if (refId == "exampleplugin open") {
+    TSExamplePluginService.prototype.menuItemClicked = function (refId) {
+        Atomic.print("TSExamplePluginService.menuItemClicked: " + refId);
+        if (refId == "tsexampleplugin open") {
             this.extensionWindow = this.serviceLocator.uiServices.showModalWindow(ExamplePluginUILabel, ExamplePluginTBPath, this.handleWidgetEvent);
             this.extensionWindow = this.serviceLocator.uiServices.showModalWindow(ExamplePluginUILabel, ExamplePluginTBPath, this.handleWidgetEvent);
             this.getWidgets();
             this.getWidgets();
             return true;
             return true;
         }
         }
         return false;
         return false;
     };
     };
-    ExamplePluginService.prototype.hierarchyContextItemClicked = function (node, refid) {
-        Atomic.print("ExamplePluginService.hierarchyContextItemClicked: " + node.name + " " + refid);
-        if (refid == "exampleplugin hierarchy context") {
+    TSExamplePluginService.prototype.hierarchyContextItemClicked = function (node, refid) {
+        Atomic.print("TSExamplePluginService.hierarchyContextItemClicked: " + node.name + " " + refid);
+        if (refid == "tsexampleplugin hierarchy context") {
             this.lastObjectName = "node " + node.name;
             this.lastObjectName = "node " + node.name;
+            this.showInfobox("Hierarchy Item Selected ", "Node: '" + node.name + "' was selected.");
             return true;
             return true;
         }
         }
         return false;
         return false;
     };
     };
-    ExamplePluginService.prototype.projectContextItemClicked = function (asset, refid) {
-        Atomic.print("ExamplePluginService.projectContextItemClicked: " + asset.name + " " + refid);
-        if (refid == "exampleplugin project context") {
+    TSExamplePluginService.prototype.projectContextItemClicked = function (asset, refid) {
+        Atomic.print("TSExamplePluginService.projectContextItemClicked: " + asset.name + " " + refid);
+        if (refid == "tsexampleplugin project context") {
             this.lastObjectName = "asset " + asset.name;
             this.lastObjectName = "asset " + asset.name;
+            this.showInfobox("Project Asset Selected", "Asset: '" + asset.name + "' was selected.");
             return true;
             return true;
         }
         }
         return false;
         return false;
     };
     };
-    ExamplePluginService.prototype.getWidgets = function () {
-        if (!this.extensionWindow)
+    TSExamplePluginService.prototype.getWidgets = function () {
+        if (!this.extensionWindow) {
             return;
             return;
+        }
         this.helloLabel = this.extensionWindow.getWidget("example_hello");
         this.helloLabel = this.extensionWindow.getWidget("example_hello");
         this.nameField = this.extensionWindow.getWidget("example_name");
         this.nameField = this.extensionWindow.getWidget("example_name");
         if (this.lastObjectName) {
         if (this.lastObjectName) {
@@ -87,8 +93,17 @@ var ExamplePluginService = (function () {
             this.lastObjectName = null;
             this.lastObjectName = null;
         }
         }
     };
     };
-    return ExamplePluginService;
-})();
-var examplePluginService = new ExamplePluginService();
+    TSExamplePluginService.prototype.showInfobox = function (title, msg) {
+        var infobox = this.serviceLocator.uiServices.showModalWindow(title, InfoboxTBPath, function (ev) {
+            if (ev.type == Atomic.UI_EVENT_TYPE_CLICK && ev.target.id == "infobox_ok") {
+                infobox.hide();
+                return true;
+            }
+        });
+        var msgLabel = infobox.getWidget("infobox_msg");
+        msgLabel.text = msg;
+    };
+    return TSExamplePluginService;
+}());
 Object.defineProperty(exports, "__esModule", { value: true });
 Object.defineProperty(exports, "__esModule", { value: true });
-exports.default = examplePluginService;
+exports.default = new TSExamplePluginService();

+ 40 - 23
EditorPluginExample/Resources/EditorData/TSExample.plugin.ts

@@ -1,12 +1,13 @@
 /// <reference path="../../typings/Atomic/AtomicWork.d.ts" />
 /// <reference path="../../typings/Atomic/AtomicWork.d.ts" />
 /// <reference path="../../typings/Atomic/EditorWork.d.ts" />
 /// <reference path="../../typings/Atomic/EditorWork.d.ts" />
 
 
-const ExamplePluginUILabel = "Example Plugin";
+const ExamplePluginUILabel = "TS Example Plugin";
 const ExamplePluginTBPath = "EditorData/Example.tb.txt";
 const ExamplePluginTBPath = "EditorData/Example.tb.txt";
+const InfoboxTBPath = "EditorData/Infobox.tb.txt";
 
 
-class ExamplePluginService implements Editor.HostExtensions.HostEditorService, Editor.HostExtensions.ProjectServicesEventListener, Editor.HostExtensions.UIServicesEventListener {
+class TSExamplePluginService implements Editor.HostExtensions.HostEditorService, Editor.HostExtensions.ProjectServicesEventListener, Editor.HostExtensions.UIServicesEventListener {
 
 
-    name: string = "ExampleService";
+    name: string = "TSExampleService";
     description: string = "This service demonstrates plugin functionality functionality.";
     description: string = "This service demonstrates plugin functionality functionality.";
 
 
     private serviceLocator: Editor.HostExtensions.HostServiceLocator = null;
     private serviceLocator: Editor.HostExtensions.HostServiceLocator = null;
@@ -18,7 +19,7 @@ class ExamplePluginService implements Editor.HostExtensions.HostEditorService, E
     private lastObjectName: string = null;
     private lastObjectName: string = null;
 
 
     initialize(serviceLoader: Editor.HostExtensions.HostServiceLocator) {
     initialize(serviceLoader: Editor.HostExtensions.HostServiceLocator) {
-        Atomic.print("ExamplePluginService.initialize");
+        Atomic.print("TSExamplePluginService.initialize");
 
 
         this.serviceLocator = (serviceLoader);
         this.serviceLocator = (serviceLoader);
         if (this.serviceLocator) {
         if (this.serviceLocator) {
@@ -31,26 +32,26 @@ class ExamplePluginService implements Editor.HostExtensions.HostEditorService, E
         this.serviceLocator.uiServices.removeHierarchyContextMenuItemSource(ExamplePluginUILabel);
         this.serviceLocator.uiServices.removeHierarchyContextMenuItemSource(ExamplePluginUILabel);
         this.serviceLocator.uiServices.removePluginMenuItemSource(ExamplePluginUILabel);
         this.serviceLocator.uiServices.removePluginMenuItemSource(ExamplePluginUILabel);
 
 
-        Atomic.print("ExamplePluginService.projectUnloaded");
+        Atomic.print("TSExamplePluginService.projectUnloaded");
         if (this.serviceLocator) {
         if (this.serviceLocator) {
             this.serviceLocator.projectServices.unregister(this);
             this.serviceLocator.projectServices.unregister(this);
             this.serviceLocator.uiServices.unregister(this);
             this.serviceLocator.uiServices.unregister(this);
         }
         }
     }
     }
     projectLoaded(ev: Editor.EditorEvents.LoadProjectEvent) {
     projectLoaded(ev: Editor.EditorEvents.LoadProjectEvent) {
-        Atomic.print("ExamplePluginService.projectLoaded");
-        this.serviceLocator.uiServices.createPluginMenuItemSource(ExamplePluginUILabel, { "Open" : ["exampleplugin open"] });
-        this.serviceLocator.uiServices.createHierarchyContextMenuItemSource(ExamplePluginUILabel, { "Get name" : ["exampleplugin hierarchy context"]});
-        this.serviceLocator.uiServices.createProjectContextMenuItemSource(ExamplePluginUILabel, { "Get name" : ["exampleplugin project context"]});
+        Atomic.print("TSExamplePluginService.projectLoaded");
+        this.serviceLocator.uiServices.createPluginMenuItemSource(ExamplePluginUILabel, { "Open" : ["tsexampleplugin open"] });
+        this.serviceLocator.uiServices.createHierarchyContextMenuItemSource(ExamplePluginUILabel, { "Get name" : ["tsexampleplugin hierarchy context"]});
+        this.serviceLocator.uiServices.createProjectContextMenuItemSource(ExamplePluginUILabel, { "Get name" : ["tsexampleplugin project context"]});
     }
     }
     playerStarted() {
     playerStarted() {
-        Atomic.print("ExamplePluginService.playerStarted");
+        Atomic.print("TSExamplePluginService.playerStarted");
     }
     }
 
 
     menuItemClicked(refId: string): boolean {
     menuItemClicked(refId: string): boolean {
-        Atomic.print("ExamplePluginService.menuItemClicked: " + refId);
-        
-        if (refId == "exampleplugin open") {
+        Atomic.print("TSExamplePluginService.menuItemClicked: " + refId);
+
+        if (refId == "tsexampleplugin open") {
             this.extensionWindow = this.serviceLocator.uiServices.showModalWindow(
             this.extensionWindow = this.serviceLocator.uiServices.showModalWindow(
                 ExamplePluginUILabel, ExamplePluginTBPath, this.handleWidgetEvent);
                 ExamplePluginUILabel, ExamplePluginTBPath, this.handleWidgetEvent);
             this.getWidgets();
             this.getWidgets();
@@ -61,11 +62,12 @@ class ExamplePluginService implements Editor.HostExtensions.HostEditorService, E
     }
     }
 
 
     hierarchyContextItemClicked(node: Atomic.Node, refid: string): boolean {
     hierarchyContextItemClicked(node: Atomic.Node, refid: string): boolean {
-        Atomic.print("ExamplePluginService.hierarchyContextItemClicked: " + node.name + " " + refid);
+        Atomic.print("TSExamplePluginService.hierarchyContextItemClicked: " + node.name + " " + refid);
 
 
-        if (refid == "exampleplugin hierarchy context") {
+        if (refid == "tsexampleplugin hierarchy context") {
             this.lastObjectName = "node " + node.name;
             this.lastObjectName = "node " + node.name;
 
 
+            this.showInfobox("Hierarchy Item Selected ", `Node: '${node.name}' was selected.`);
             return true;
             return true;
         }
         }
 
 
@@ -73,11 +75,11 @@ class ExamplePluginService implements Editor.HostExtensions.HostEditorService, E
     }
     }
 
 
     projectContextItemClicked(asset: ToolCore.Asset, refid: string): boolean {
     projectContextItemClicked(asset: ToolCore.Asset, refid: string): boolean {
-        Atomic.print("ExamplePluginService.projectContextItemClicked: " + asset.name + " " + refid);
+        Atomic.print("TSExamplePluginService.projectContextItemClicked: " + asset.name + " " + refid);
 
 
-        if (refid == "exampleplugin project context") {
+        if (refid == "tsexampleplugin project context") {
             this.lastObjectName = "asset " + asset.name;
             this.lastObjectName = "asset " + asset.name;
-
+            this.showInfobox("Project Asset Selected", `Asset: '${asset.name}' was selected.`);
             return true;
             return true;
         }
         }
 
 
@@ -85,8 +87,9 @@ class ExamplePluginService implements Editor.HostExtensions.HostEditorService, E
     }
     }
 
 
     getWidgets() {
     getWidgets() {
-        if (!this.extensionWindow)
+        if (!this.extensionWindow) {
             return;
             return;
+        }
 
 
         this.helloLabel = <Atomic.UITextField>this.extensionWindow.getWidget("example_hello");
         this.helloLabel = <Atomic.UITextField>this.extensionWindow.getWidget("example_hello");
         this.nameField = <Atomic.UIEditField>this.extensionWindow.getWidget("example_name");
         this.nameField = <Atomic.UIEditField>this.extensionWindow.getWidget("example_name");
@@ -97,9 +100,22 @@ class ExamplePluginService implements Editor.HostExtensions.HostEditorService, E
         }
         }
     }
     }
 
 
+    showInfobox(title: string, msg: string) {
+        const infobox = this.serviceLocator.uiServices.showModalWindow(
+            title, InfoboxTBPath, (ev: Atomic.UIWidgetEvent) => {
+                if (ev.type == Atomic.UI_EVENT_TYPE_CLICK && ev.target.id == "infobox_ok") {
+                    infobox.hide();
+                    return true;
+                }
+            });
+        const msgLabel = <Atomic.UITextField>infobox.getWidget("infobox_msg");
+        msgLabel.text = msg;
+    }
+
     handleWidgetEvent = (ev: Atomic.UIWidgetEvent): boolean => { // => notation used to bind "this" to the method
     handleWidgetEvent = (ev: Atomic.UIWidgetEvent): boolean => { // => notation used to bind "this" to the method
-        if (!this.extensionWindow)
+        if (!this.extensionWindow) {
             return;
             return;
+        }
 
 
         if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) {
         if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) {
 
 
@@ -115,12 +131,13 @@ class ExamplePluginService implements Editor.HostExtensions.HostEditorService, E
 
 
                 return true;
                 return true;
             }
             }
+
         }
         }
 
 
         return false;
         return false;
 
 
-    }
+    };
+
 }
 }
 
 
-const examplePluginService = new ExamplePluginService();
-export default examplePluginService;
+export default new TSExamplePluginService();

+ 5 - 0
EditorPluginExample/Resources/Scenes.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "0820b61fc0ee9df2ca7c0317f52fc353",
+	"FolderImporter": {}
+}

+ 58 - 0
EditorPluginExample/Resources/Scenes/Scene.scene

@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<scene id="1">
+	<attribute name="Name" value="" />
+	<attribute name="Time Scale" value="1" />
+	<attribute name="Smoothing Constant" value="50" />
+	<attribute name="Snap Threshold" value="5" />
+	<attribute name="Elapsed Time" value="0" />
+	<attribute name="Next Replicated Node ID" value="362" />
+	<attribute name="Next Replicated Component ID" value="1974" />
+	<attribute name="Next Local Node ID" value="16778496" />
+	<attribute name="Next Local Component ID" value="16777216" />
+	<attribute name="Variables" />
+	<attribute name="Variable Names" value="" />
+	<component type="PhysicsWorld" id="1" />
+	<component type="Octree" id="2" />
+	<component type="DebugRenderer" id="3" />
+	<node id="2">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Zone" />
+		<attribute name="Position" value="0 0 0" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="Zone" id="4">
+			<attribute name="Bounding Box Min" value="-10000 -10000 -10000" />
+			<attribute name="Bounding Box Max" value="10000 10000 10000" />
+			<attribute name="Ambient Color" value="0.4 0.4 0.4 1" />
+		</component>
+	</node>
+	<node id="3">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="GlobalLight" />
+		<attribute name="Position" value="0 0 0" />
+		<attribute name="Rotation" value="0.888074 0.325058 -0.325058 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="Light" id="5">
+			<attribute name="Light Type" value="Directional" />
+			<attribute name="Cast Shadows" value="true" />
+			<attribute name="CSM Splits" value="10 20 50 0" />
+			<attribute name="View Size Quantize" value="1" />
+			<attribute name="View Size Minimum" value="5" />
+			<attribute name="Depth Constant Bias" value="0.00025" />
+			<attribute name="Depth Slope Bias" value="0.001" />
+		</component>
+	</node>
+	<node id="361">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Camera" />
+		<attribute name="Position" value="0 0 -5" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="Camera" id="1973">
+			<attribute name="FOV" value="45" />
+		</component>
+	</node>
+</scene>

+ 8 - 0
EditorPluginExample/Resources/Scenes/Scene.scene.asset

@@ -0,0 +1,8 @@
+{
+	"version": 1,
+	"guid": "3c6bb8505409cacde83747b9a2151239",
+	"SceneImporter": {
+		"sceneCamRotation": "1 0 0 0",
+		"sceneCamPosition": "0 0 0"
+	}
+}