aboutsummaryrefslogtreecommitdiff
path: root/tools/editor/property_editor.cpp
diff options
context:
space:
mode:
authorRémi Verschelde2015-12-14 07:39:17 +0100
committerRémi Verschelde2015-12-14 07:39:17 +0100
commit55684dbea4dc29def533c28f47a0c70df3650c2b (patch)
treeb6ff09d98737c8341e3ad4b350f329001ed9c38d /tools/editor/property_editor.cpp
parent7f96f0603e16a970c7b0ea1fba936e56baf80d4a (diff)
parent2e8ed75d8dc1dc16399fc695a1fb130f312f4c5b (diff)
downloadgodot-55684dbea4dc29def533c28f47a0c70df3650c2b.tar.gz
godot-55684dbea4dc29def533c28f47a0c70df3650c2b.tar.zst
godot-55684dbea4dc29def533c28f47a0c70df3650c2b.zip
Merge pull request #3065 from TheHX/pr-array-editor
Fix array editor NodePath being relative to editor
Diffstat (limited to 'tools/editor/property_editor.cpp')
-rw-r--r--tools/editor/property_editor.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp
index 9fb623022..c44cfa3d6 100644
--- a/tools/editor/property_editor.cpp
+++ b/tools/editor/property_editor.cpp
@@ -915,15 +915,25 @@ void CustomPropertyEditor::_color_changed(const Color& p_color) {
void CustomPropertyEditor::_node_path_selected(NodePath p_path) {
- if (owner && owner->is_type("Node")) {
+ if (owner) {
+
+ Node *node=NULL;
+
+ if (owner->is_type("Node"))
+ node = owner->cast_to<Node>();
+ else if (owner->is_type("ArrayPropertyEdit"))
+ node = owner->cast_to<ArrayPropertyEdit>()->get_node();
+
+ if (!node) {
+ v=p_path;
+ emit_signal("variant_changed");
+ return;
+ }
- Node *node = owner->cast_to<Node>();
Node *tonode=node->get_node(p_path);
if (tonode) {
-
p_path=node->get_path_to(tonode);
}
-
}
v=p_path;