From cdcfb9582e6e9f18df1475619f2ebe62b7f0bdce Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 3 May 2018 11:53:57 +0100 Subject: Defaults to instancing child at tree root when none selected If no node is selected, it will default to selecting the tree root node to instance a child under. This solves #18557 --- editor/scene_tree_dock.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 38027a34a7..ba661813d6 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -107,7 +107,12 @@ void SceneTreeDock::_unhandled_key_input(Ref p_event) { void SceneTreeDock::instance(const String &p_file) { Node *parent = scene_tree->get_selected(); - if (!parent || !edited_scene) { + + if (!parent) { + Node *parent = edited_scene; + }; + + if (!edited_scene) { current_option = -1; accept->get_ok()->set_text(TTR("OK :(")); -- cgit v1.2.3