Browse Source

SceneEditor: Add Ctrl+P parent

trethaller 7 years ago
parent
commit
9b0c6b17e2
2 changed files with 8 additions and 0 deletions
  1. 1 0
      bin/defaultProps.json
  2. 7 0
      hide/comp/SceneEditor.hx

+ 1 - 0
bin/defaultProps.json

@@ -47,6 +47,7 @@
 	"key.sceneeditor.showAll": "Ctrl-H",
 	"key.sceneeditor.isolate": "I",
 	"key.sceneeditor.selectParent": "Backspace",
+	"key.sceneeditor.reparent": "Ctrl-P",
 
 	// cdb config
 

+ 7 - 0
hide/comp/SceneEditor.hx

@@ -152,6 +152,13 @@ class SceneEditor {
 			if(curEdit.rootElements.length > 0)
 				selectObjects([curEdit.rootElements[0].parent]);
 		});
+		view.keys.register("sceneeditor.reparent", function() {
+			if(curEdit.rootElements.length > 1) {
+				var children = curEdit.rootElements.copy();
+				var parent = children.pop();
+				reparentElement(children, parent, 0);
+			}
+		});
 	}
 
 	public dynamic function onResize() {