diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/property_editor.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 42485317c1..ec085ea9f2 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -45,7 +45,6 @@ #include "pair.h" #include "print_string.h" #include "project_settings.h" -#include "project_settings.h" #include "property_selector.h" #include "scene/gui/label.h" #include "scene/main/viewport.h" @@ -863,6 +862,10 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: List<String> names; names.push_back(TTR("Assign")); names.push_back(TTR("Clear")); + + if (owner->is_class("Node") && (v.get_type() == Variant::NODE_PATH) && owner->cast_to<Node>()->has_node(v)) + names.push_back(TTR("Select Node")); + config_action_buttons(names); } break; @@ -1270,7 +1273,18 @@ void CustomPropertyEditor::_action_pressed(int p_which) { v = NodePath(); emit_signal("variant_changed"); hide(); + } else if (p_which == 2) { + + if (owner->is_class("Node") && (v.get_type() == Variant::NODE_PATH) && owner->cast_to<Node>()->has_node(v)) { + + Node *target_node = owner->cast_to<Node>()->get_node(v); + EditorNode::get_singleton()->get_editor_selection()->clear(); + EditorNode::get_singleton()->get_scene_tree_dock()->set_selected(target_node); + } + + hide(); } + } break; case Variant::OBJECT: { |