summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/script_editor_plugin.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index bb03cad285..72a9e399f2 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -1783,9 +1783,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 {