diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-04-16 12:38:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-16 12:38:54 +0200 |
commit | 45a036feeca6a079c5dd9c96b7e599294af5c152 (patch) | |
tree | 255d0998b878b41aa328fbf67e912ae2f4e6a4a1 | |
parent | 51d86c9112156cde770e33fb4f0dd9f8839867de (diff) | |
parent | e90beade153f0ace450e3ec57b5eb44898023c1f (diff) |
Merge pull request #37012 from Calinou/reverse-builtin-script-naming
Tweak the built-in script naming for resources with custom names
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 0b97ade278..2c831979de 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1778,9 +1778,11 @@ void ScriptEditor::_update_script_names() { if (built_in) { name = path.get_file(); - String resource_name = se->get_edited_resource()->get_name(); + const String &resource_name = se->get_edited_resource()->get_name(); if (resource_name != "") { - name = name.substr(0, name.find("::", 0) + 2) + resource_name; + // If the built-in script has a custom resource name defined, + // display the built-in script name as follows: `ResourceName (scene_file.tscn)` + name = vformat("%s (%s)", resource_name, name.substr(0, name.find("::", 0))); } } else { |