You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Fix array editor NodePath being relative to editor
This commit is contained in:
@@ -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 = owner->cast_to<Node>();
|
||||
Node *tonode=node->get_node(p_path);
|
||||
if (tonode) {
|
||||
Node *node=NULL;
|
||||
|
||||
p_path=node->get_path_to(tonode);
|
||||
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 *tonode=node->get_node(p_path);
|
||||
if (tonode) {
|
||||
p_path=node->get_path_to(tonode);
|
||||
}
|
||||
}
|
||||
|
||||
v=p_path;
|
||||
|
||||
Reference in New Issue
Block a user