diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-05-18 16:13:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-18 16:13:54 +0200 |
commit | e7868626fa9732e70a93c199aea76437506d12be (patch) | |
tree | 8414c37dfc812d5eaca4f26a3675e90e2d3c0709 /editor/plugins | |
parent | e22255edaf1e48fffe71f6918814bbc2b089c278 (diff) | |
parent | 1101f6c660feec732af14257f6f9fa26a17364e1 (diff) |
Merge pull request #61148 from Jummit/drop-unique-nodes
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index ee8767e6a6..9df99dcce4 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1568,7 +1568,12 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data continue; } - String path = sn->get_path_to(node); + String path; + if (node->is_unique_name_in_owner()) { + path = "%" + node->get_name(); + } else { + path = sn->get_path_to(node); + } for (const String &segment : path.split("/")) { if (!segment.is_valid_identifier()) { path = path.c_escape().quote(quote_style); @@ -1595,7 +1600,12 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data continue; } - String path = sn->get_path_to(node); + String path; + if (node->is_unique_name_in_owner()) { + path = "%" + node->get_name(); + } else { + path = sn->get_path_to(node); + } for (const String &segment : path.split("/")) { if (!segment.is_valid_identifier()) { path = path.c_escape().quote(quote_style); |