summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-07-01 16:46:32 +0200
committerGitHub <noreply@github.com>2020-07-01 16:46:32 +0200
commit8a484756de0d66aa91da7975672234d58ca31d7d (patch)
treebf6a26be1a1fe51edae23db700c0eb94427de4fb /editor/plugins
parent5c9ee93f3e6918974aa5dc7dab65a2fdbc8c3313 (diff)
parent4285211f40cf3519237faf08b8fdbf09bc28e954 (diff)
Merge pull request #39076 from rileylyman/editor_tab_names
Implement filename disambiguation for scene tabs and script names
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/script_editor_plugin.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 72d287c35c..66f0155c6a 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -1731,6 +1731,19 @@ void ScriptEditor::_update_script_names() {
sedata.push_back(sd);
}
+ Vector<String> disambiguated_script_names;
+ Vector<String> full_script_paths;
+ for (int j = 0; j < sedata.size(); j++) {
+ disambiguated_script_names.append(sedata[j].name);
+ full_script_paths.append(sedata[j].tooltip);
+ }
+
+ EditorNode::disambiguate_filenames(full_script_paths, disambiguated_script_names);
+
+ for (int j = 0; j < sedata.size(); j++) {
+ sedata.write[j].name = disambiguated_script_names[j];
+ }
+
EditorHelp *eh = Object::cast_to<EditorHelp>(tab_container->get_child(i));
if (eh) {
String name = eh->get_class();