diff options
author | Franklin Sobrinho <franklin_gs@hotmail.com> | 2015-12-13 08:41:11 -0300 |
---|---|---|
committer | Franklin Sobrinho <franklin_gs@hotmail.com> | 2015-12-13 08:47:54 -0300 |
commit | 4523a591d33d8c28ee5c034101228bf7a686537e (patch) | |
tree | 1768be1cc05af319c754666dffa7a853b6fb9fbb | |
parent | 451b1d91446f6e15763b4d6ec3bd6d74c2be8080 (diff) |
Double-click item for reparent and choose a node in NodePath dialog
-rw-r--r-- | tools/editor/reparent_dialog.cpp | 16 | ||||
-rw-r--r-- | tools/editor/scene_tree_editor.cpp | 5 |
2 files changed, 10 insertions, 11 deletions
diff --git a/tools/editor/reparent_dialog.cpp b/tools/editor/reparent_dialog.cpp index 78ba47d54b..f024844731 100644 --- a/tools/editor/reparent_dialog.cpp +++ b/tools/editor/reparent_dialog.cpp @@ -36,12 +36,12 @@ void ReparentDialog::_notification(int p_what) { - if (p_what==NOTIFICATION_ENTER_TREE) { + if (p_what==NOTIFICATION_ENTER_TREE) { connect("confirmed", this,"_reparent"); } - if (p_what==NOTIFICATION_EXIT_TREE) { + if (p_what==NOTIFICATION_EXIT_TREE) { disconnect("confirmed", this,"_reparent"); } @@ -83,29 +83,29 @@ void ReparentDialog::_bind_methods() { ReparentDialog::ReparentDialog() { - set_title("Reparent Node"); + VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); set_child_rect(vbc); tree = memnew( SceneTreeEditor(false) ); - + tree->set_show_enabled_subscene(true); vbc->add_margin_child("Reparent Location (Select new Parent):",tree,true); - + + tree->get_scene_tree()->connect("item_activated",this,"_reparent"); + //Label *label = memnew( Label ); //label->set_pos( Point2( 15,8) ); //label->set_text("Reparent Location (Select new Parent):"); - + node_only = memnew( CheckButton ); add_child(node_only); node_only->hide(); - tree->set_show_enabled_subscene(true); //vbc->add_margin_child("Options:",node_only);; - //cancel->connect("pressed", this,"_cancel"); diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp index 6575603073..a164703e31 100644 --- a/tools/editor/scene_tree_editor.cpp +++ b/tools/editor/scene_tree_editor.cpp @@ -928,7 +928,7 @@ void SceneTreeDialog::_cancel() { void SceneTreeDialog::_select() { if (tree->get_selected()) { - emit_signal("selected",tree->get_selected()->get_path()); + emit_signal("selected",tree->get_selected()->get_path()); hide(); } } @@ -939,7 +939,6 @@ void SceneTreeDialog::_bind_methods() { ObjectTypeDB::bind_method("_cancel",&SceneTreeDialog::_cancel); ADD_SIGNAL( MethodInfo("selected",PropertyInfo(Variant::NODE_PATH,"path"))); - } @@ -951,7 +950,7 @@ SceneTreeDialog::SceneTreeDialog() { add_child(tree); set_child_rect(tree); - + tree->get_scene_tree()->connect("item_activated",this,"_select"); } |