summaryrefslogtreecommitdiff
path: root/tools/editor/reparent_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/reparent_dialog.cpp')
-rw-r--r--tools/editor/reparent_dialog.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/tools/editor/reparent_dialog.cpp b/tools/editor/reparent_dialog.cpp
index 78ba47d54b..97b27603b2 100644
--- a/tools/editor/reparent_dialog.cpp
+++ b/tools/editor/reparent_dialog.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -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");
}
@@ -62,7 +62,7 @@ void ReparentDialog::_reparent() {
if (tree->get_selected()) {
- emit_signal("reparent",tree->get_selected()->get_path(),node_only->is_pressed());
+ emit_signal("reparent",tree->get_selected()->get_path(),keep_transform->is_pressed());
hide();
}
}
@@ -78,38 +78,41 @@ void ReparentDialog::_bind_methods() {
ObjectTypeDB::bind_method("_reparent",&ReparentDialog::_reparent);
ObjectTypeDB::bind_method("_cancel",&ReparentDialog::_cancel);
- ADD_SIGNAL( MethodInfo("reparent",PropertyInfo(Variant::NODE_PATH,"path"),PropertyInfo(Variant::BOOL,"only_node")));
+ ADD_SIGNAL( MethodInfo("reparent",PropertyInfo(Variant::NODE_PATH,"path"),PropertyInfo(Variant::BOOL,"keep_global_xform")));
}
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);
+ keep_transform = memnew( CheckBox );
+ keep_transform->set_text("Keep Global Transform");
+ keep_transform->set_pressed(true);
+ vbc->add_child(keep_transform);
+
+
//vbc->add_margin_child("Options:",node_only);;
-
//cancel->connect("pressed", this,"_cancel");
get_ok()->set_text("Reparent");
+
}