|
|
@@ -68,11 +68,19 @@ class InspectorFrame extends ScriptWidget {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ closeSelectionInspector() {
|
|
|
|
|
|
+ if (!this.selectionInspector)
|
|
|
+ return;
|
|
|
|
|
|
- handleSceneNodeSelected(ev: Editor.SceneNodeSelectedEvent) {
|
|
|
+ var container = this.getWidget("inspectorcontainer");
|
|
|
+ container.deleteAllChildren();
|
|
|
|
|
|
- var selection = this.sceneEditor.selection;
|
|
|
+ this.selectionInspector = null;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ handleSceneNodeSelected(ev: Editor.SceneNodeSelectedEvent) {
|
|
|
|
|
|
if (this.selectionInspector) {
|
|
|
|
|
|
@@ -81,23 +89,30 @@ class InspectorFrame extends ScriptWidget {
|
|
|
} else {
|
|
|
this.selectionInspector.removeNode(ev.node);
|
|
|
}
|
|
|
+
|
|
|
} else if (ev.selected) {
|
|
|
|
|
|
- var container = this.getWidget("inspectorcontainer");
|
|
|
- container.deleteAllChildren();
|
|
|
+ var container = this.getWidget("inspectorcontainer");
|
|
|
+ container.deleteAllChildren();
|
|
|
+
|
|
|
+ var inspector = this.selectionInspector = new SelectionInspector(this.sceneEditor);
|
|
|
+ inspector.addNode(ev.node);
|
|
|
+ container.addChild(inspector);
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
- var inspector = this.selectionInspector = new SelectionInspector(this.sceneEditor);
|
|
|
- inspector.addNode(ev.node);
|
|
|
- container.addChild(inspector);
|
|
|
+ var selection = this.sceneEditor.selection;
|
|
|
|
|
|
+ if (!selection.selectedNodeCount) {
|
|
|
+ this.closeSelectionInspector();
|
|
|
}
|
|
|
|
|
|
- return;
|
|
|
}
|
|
|
|
|
|
|
|
|
handleProjectUnloaded(data) {
|
|
|
|
|
|
+ this.closeSelectionInspector();
|
|
|
var container = this.getWidget("inspectorcontainer");
|
|
|
container.deleteAllChildren();
|
|
|
}
|
|
|
@@ -121,6 +136,8 @@ class InspectorFrame extends ScriptWidget {
|
|
|
|
|
|
inspectAsset(asset: ToolCore.Asset) {
|
|
|
|
|
|
+ this.closeSelectionInspector();
|
|
|
+
|
|
|
var container = this.getWidget("inspectorcontainer");
|
|
|
container.deleteAllChildren();
|
|
|
|