Merge pull request #50786 from reduz/implement-resource-uids

Implement Resource UIDs
This commit is contained in:
Rémi Verschelde 2021-07-24 17:18:12 +02:00 committed by GitHub
commit 2b1e6e303e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 900 additions and 126 deletions

View file

@ -178,6 +178,15 @@ void DependencyEditor::_update_list() {
path = n;
type = "Resource";
}
ResourceUID::ID uid = ResourceUID::get_singleton()->text_to_id(path);
if (uid != ResourceUID::INVALID_ID) {
// dependency is in uid format, obtain proper path
ERR_CONTINUE(!ResourceUID::get_singleton()->has_id(uid));
path = ResourceUID::get_singleton()->get_id_path(uid);
}
String name = path.get_file();
Ref<Texture2D> icon = EditorNode::get_singleton()->get_class_icon(type);