summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnknown <linux.kwongo@gmail.com>2018-05-03 11:53:57 +0100
committerAlexHoratio <linux.kwongo@gmail.com>2018-05-06 15:10:57 +0100
commitcdcfb9582e6e9f18df1475619f2ebe62b7f0bdce (patch)
tree3c82fa570fe473957d2d7eb8147e986fc9b0cc22
parent2bf71d0eeadbd2e497b1555bf1f04993f7f3d63a (diff)
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
-rw-r--r--editor/scene_tree_dock.cpp7
1 files changed, 6 insertions, 1 deletions
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<InputEvent> 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 :("));