You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Double-click item for reparent and choose a node in NodePath dialog
This commit is contained in:
@@ -84,17 +84,19 @@ void ReparentDialog::_bind_methods() {
|
|||||||
|
|
||||||
ReparentDialog::ReparentDialog() {
|
ReparentDialog::ReparentDialog() {
|
||||||
|
|
||||||
|
|
||||||
set_title("Reparent Node");
|
set_title("Reparent Node");
|
||||||
|
|
||||||
VBoxContainer *vbc = memnew( VBoxContainer );
|
VBoxContainer *vbc = memnew( VBoxContainer );
|
||||||
add_child(vbc);
|
add_child(vbc);
|
||||||
set_child_rect(vbc);
|
set_child_rect(vbc);
|
||||||
|
|
||||||
tree = memnew( SceneTreeEditor(false) );
|
tree = memnew( SceneTreeEditor(false) );
|
||||||
|
tree->set_show_enabled_subscene(true);
|
||||||
|
|
||||||
vbc->add_margin_child("Reparent Location (Select new Parent):",tree,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 *label = memnew( Label );
|
||||||
//label->set_pos( Point2( 15,8) );
|
//label->set_pos( Point2( 15,8) );
|
||||||
//label->set_text("Reparent Location (Select new Parent):");
|
//label->set_text("Reparent Location (Select new Parent):");
|
||||||
@@ -103,10 +105,8 @@ ReparentDialog::ReparentDialog() {
|
|||||||
add_child(node_only);
|
add_child(node_only);
|
||||||
node_only->hide();
|
node_only->hide();
|
||||||
|
|
||||||
tree->set_show_enabled_subscene(true);
|
|
||||||
//vbc->add_margin_child("Options:",node_only);;
|
//vbc->add_margin_child("Options:",node_only);;
|
||||||
|
|
||||||
|
|
||||||
//cancel->connect("pressed", this,"_cancel");
|
//cancel->connect("pressed", this,"_cancel");
|
||||||
|
|
||||||
get_ok()->set_text("Reparent");
|
get_ok()->set_text("Reparent");
|
||||||
|
|||||||
@@ -939,7 +939,6 @@ void SceneTreeDialog::_bind_methods() {
|
|||||||
ObjectTypeDB::bind_method("_cancel",&SceneTreeDialog::_cancel);
|
ObjectTypeDB::bind_method("_cancel",&SceneTreeDialog::_cancel);
|
||||||
ADD_SIGNAL( MethodInfo("selected",PropertyInfo(Variant::NODE_PATH,"path")));
|
ADD_SIGNAL( MethodInfo("selected",PropertyInfo(Variant::NODE_PATH,"path")));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -951,7 +950,7 @@ SceneTreeDialog::SceneTreeDialog() {
|
|||||||
add_child(tree);
|
add_child(tree);
|
||||||
set_child_rect(tree);
|
set_child_rect(tree);
|
||||||
|
|
||||||
|
tree->get_scene_tree()->connect("item_activated",this,"_select");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user