Add sub-resource name when available to script editor

(cherry picked from commit 7056c825a3)
This commit is contained in:
UziMonkey 2019-01-02 00:54:51 -05:00 committed by Rémi Verschelde
parent 8946ac9616
commit cb0e500d27
1 changed files with 13 additions and 1 deletions

View File

@ -1689,7 +1689,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;