| 1695 | } |
| 1696 | |
| 1697 | ResourceUID::ID ResourceLoaderCompatText::get_uid(Ref<FileAccess> p_f) { |
| 1698 | error = OK; |
| 1699 | |
| 1700 | lines = 1; |
| 1701 | f = p_f; |
| 1702 | |
| 1703 | stream.f = f; |
| 1704 | |
| 1705 | ignore_resource_parsing = true; |
| 1706 | |
| 1707 | VariantParser::Tag tag; |
| 1708 | Error err = VariantParserCompat::parse_tag(&stream, lines, error_text, tag); |
| 1709 | |
| 1710 | if (err) { |
| 1711 | _printerr(); |
| 1712 | return ResourceUID::INVALID_ID; |
| 1713 | } |
| 1714 | |
| 1715 | if (tag.fields.has("uid")) { //field is optional |
| 1716 | String uidt = tag.fields["uid"]; |
| 1717 | return ResourceUID::get_singleton()->text_to_id(uidt); |
| 1718 | } |
| 1719 | |
| 1720 | return ResourceUID::INVALID_ID; |
| 1721 | } |
| 1722 | |
| 1723 | ///////////////////// |
| 1724 | |