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

Merge pull request #85384 from HolonProduction/unique-name-completion

Suggest scene unique nodes in `get_node` autocompletion
This commit is contained in:
Yuri Sizov
2024-01-17 18:52:31 +01:00
2 changed files with 24 additions and 5 deletions

View File

@@ -3088,6 +3088,10 @@ static void _add_nodes_to_options(const Node *p_base, const Node *p_node, List<S
if (p_node != p_base && !p_node->get_owner()) {
return;
}
if (p_node->is_unique_name_in_owner() && p_node->get_owner() == p_base) {
String n = "%" + p_node->get_name();
r_options->push_back(n.quote());
}
String n = p_base->get_path_to(p_node);
r_options->push_back(n.quote());
for (int i = 0; i < p_node->get_child_count(); i++) {