diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-06-01 09:45:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-01 09:45:08 +0200 |
commit | d7163fb77a53a469d7351708fa779ea631ad92a3 (patch) | |
tree | 4a389900fbbfc62bfae09c4e7f0a567f26ec1731 | |
parent | 44bddecb8942c7be106a6d94538b2791c3948bd6 (diff) | |
parent | 7056c825a3d54111b1a1b960ffabefdd72db3793 (diff) |
Merge pull request #24708 from uzimonkey/sub-resource-names-in-script-editor
Add sub-resource name when available to script editor
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 38be92a67f..641c387c64 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1741,7 +1741,19 @@ void ScriptEditor::_update_script_names() { Ref<Texture> icon = se->get_icon(); String path = se->get_edited_resource()->get_path(); bool built_in = !path.is_resource_file(); - String name = built_in ? path.get_file() : se->get_name(); + String name; + + if (built_in) { + + name = path.get_file(); + String resource_name = se->get_edited_resource()->get_name(); + if (resource_name != "") { + name = name.substr(0, name.find("::", 0) + 2) + resource_name; + } + } else { + + name = se->get_name(); + } _ScriptEditorItemData sd; sd.icon = icon; |