Merge pull request #24708 from uzimonkey/sub-resource-names-in-script-editor

Add sub-resource name when available to script editor
This commit is contained in:
Rémi Verschelde 2019-06-01 09:45:08 +02:00 committed by GitHub
commit d7163fb77a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;