|
@@ -1,8 +1,6 @@
|
|
|
|
|
|
|
|
class HierarchyFrame extends Atomic.UIWidget {
|
|
class HierarchyFrame extends Atomic.UIWidget {
|
|
|
|
|
|
|
|
- hierList: Atomic.UIListView;
|
|
|
|
|
-
|
|
|
|
|
constructor(parent: Atomic.UIWidget) {
|
|
constructor(parent: Atomic.UIWidget) {
|
|
|
|
|
|
|
|
super();
|
|
super();
|
|
@@ -22,13 +20,21 @@ class HierarchyFrame extends Atomic.UIWidget {
|
|
|
|
|
|
|
|
hierarchycontainer.addChild(hierList);
|
|
hierarchycontainer.addChild(hierList);
|
|
|
|
|
|
|
|
- //this.subscribeToEvent("NodeAdded", (data) => this.handleNodeAdded(data));
|
|
|
|
|
-
|
|
|
|
|
this.subscribeToEvent("EditorUpdateHierarchy", (data) => this.handleUpdateHierarchy(data));
|
|
this.subscribeToEvent("EditorUpdateHierarchy", (data) => this.handleUpdateHierarchy(data));
|
|
|
|
|
|
|
|
this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
|
|
this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
|
|
|
|
|
+
|
|
|
this.subscribeToEvent("EditorActiveSceneChanged", (data) => this.handleActiveSceneChanged(data));
|
|
this.subscribeToEvent("EditorActiveSceneChanged", (data) => this.handleActiveSceneChanged(data));
|
|
|
|
|
|
|
|
|
|
+ this.subscribeToEvent("EditorActiveNodeChange", (data) => {
|
|
|
|
|
+
|
|
|
|
|
+ if (data.node)
|
|
|
|
|
+ this.hierList.selectItemByID(data.node.id.toString());
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
recursiveAddNode(parentID: number, node: Atomic.Node) {
|
|
recursiveAddNode(parentID: number, node: Atomic.Node) {
|
|
@@ -79,8 +85,21 @@ class HierarchyFrame extends Atomic.UIWidget {
|
|
|
|
|
|
|
|
handleActiveSceneChanged(data) {
|
|
handleActiveSceneChanged(data) {
|
|
|
|
|
|
|
|
|
|
+ if (this.scene)
|
|
|
|
|
+ this.unsubscribeFromEvents(this.scene);
|
|
|
|
|
+
|
|
|
this.scene = <Atomic.Scene> data.scene;
|
|
this.scene = <Atomic.Scene> data.scene;
|
|
|
|
|
|
|
|
|
|
+ if (this.scene) {
|
|
|
|
|
+
|
|
|
|
|
+ this.subscribeToEvent("NodeRemoved", (data) => {
|
|
|
|
|
+
|
|
|
|
|
+ this.hierList.deleteItemByID(data.node.id.toString());
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
this.refresh();
|
|
this.refresh();
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -108,6 +127,7 @@ class HierarchyFrame extends Atomic.UIWidget {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
scene: Atomic.Scene = null;
|
|
scene: Atomic.Scene = null;
|
|
|
|
|
+ hierList: Atomic.UIListView;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|