Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix editing exported nodes in array as text. #90047

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions editor/editor_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2717,7 +2717,7 @@ Variant EditorPropertyNodePath::_get_cache_value(const StringName &p_prop, bool
return Variant();
}

void EditorPropertyNodePath::_node_selected(const NodePath &p_path) {
void EditorPropertyNodePath::_node_selected(const NodePath &p_path, bool p_absolute) {
NodePath path = p_path;
Node *base_node = get_base_node();

Expand All @@ -2727,7 +2727,7 @@ void EditorPropertyNodePath::_node_selected(const NodePath &p_path) {
path = get_tree()->get_edited_scene_root()->get_path_to(to_node);
}

if (base_node) { // for AnimationTrackKeyEdit
if (p_absolute && base_node) { // for AnimationTrackKeyEdit
path = base_node->get_path().rel_path_to(p_path);
}

Expand All @@ -2749,7 +2749,7 @@ void EditorPropertyNodePath::_node_assign() {
scene_tree->get_scene_tree()->set_show_enabled_subscene(true);
scene_tree->set_valid_types(valid_types);
add_child(scene_tree);
scene_tree->connect("selected", callable_mp(this, &EditorPropertyNodePath::_node_selected));
scene_tree->connect("selected", callable_mp(this, &EditorPropertyNodePath::_node_selected).bind(true));
}
scene_tree->popup_scenetree_dialog();
}
Expand Down Expand Up @@ -2804,7 +2804,7 @@ void EditorPropertyNodePath::_accept_text() {

void EditorPropertyNodePath::_text_submitted(const String &p_text) {
NodePath np = p_text;
emit_changed(get_edited_property(), np);
_node_selected(np, false);
edit->hide();
assign->show();
menu->show();
Expand Down
2 changes: 1 addition & 1 deletion editor/editor_properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ class EditorPropertyNodePath : public EditorProperty {
bool editing_node = false;

Vector<StringName> valid_types;
void _node_selected(const NodePath &p_path);
void _node_selected(const NodePath &p_path, bool p_absolute = true);
void _node_assign();
Node *get_base_node();
void _update_menu();
Expand Down
Loading