diff options
author | UziMonkey <uzimonkey@gmail.com> | 2019-01-02 00:54:51 -0500 |
---|---|---|
committer | UziMonkey <uzimonkey@gmail.com> | 2019-05-31 02:39:58 -0400 |
commit | 7056c825a3d54111b1a1b960ffabefdd72db3793 (patch) | |
tree | 21eff5cf10c07e286a739dd67d0cb74b41d3e53a /editor | |
parent | 09d090921cc4cbe6d60c0dfd75d28be1cd34222a (diff) |
Add sub-resource name when available to script editor
Diffstat (limited to '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 9e3a512724..79c8d50fe6 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1684,7 +1684,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; |