1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #90047 from ajreckof/fix-editing-exported-nodes-in-array-as-text

Fix editing exported nodes in array as text.
This commit is contained in:
Thaddeus Crews
2024-10-25 13:04:00 -05:00
2 changed files with 5 additions and 5 deletions

View File

@@ -2648,7 +2648,7 @@ Variant EditorPropertyNodePath::_get_cache_value(const StringName &p_prop, bool
return Variant(); 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; NodePath path = p_path;
Node *base_node = get_base_node(); Node *base_node = get_base_node();
@@ -2658,7 +2658,7 @@ void EditorPropertyNodePath::_node_selected(const NodePath &p_path) {
path = get_tree()->get_edited_scene_root()->get_path_to(to_node); 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); path = base_node->get_path().rel_path_to(p_path);
} }
@@ -2680,7 +2680,7 @@ void EditorPropertyNodePath::_node_assign() {
scene_tree->get_scene_tree()->set_show_enabled_subscene(true); scene_tree->get_scene_tree()->set_show_enabled_subscene(true);
scene_tree->set_valid_types(valid_types); scene_tree->set_valid_types(valid_types);
add_child(scene_tree); 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));
} }
Variant val = get_edited_property_value(); Variant val = get_edited_property_value();
@@ -2748,7 +2748,7 @@ void EditorPropertyNodePath::_accept_text() {
void EditorPropertyNodePath::_text_submitted(const String &p_text) { void EditorPropertyNodePath::_text_submitted(const String &p_text) {
NodePath np = p_text; NodePath np = p_text;
emit_changed(get_edited_property(), np); _node_selected(np, false);
edit->hide(); edit->hide();
assign->show(); assign->show();
menu->show(); menu->show();

View File

@@ -628,7 +628,7 @@ class EditorPropertyNodePath : public EditorProperty {
bool editing_node = false; bool editing_node = false;
Vector<StringName> valid_types; 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(); void _node_assign();
Node *get_base_node(); Node *get_base_node();
void _update_menu(); void _update_menu();