MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / get_resource_uid

Method get_resource_uid

compat/resource_compat_text.cpp:1858–1875  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1856}
1857
1858ResourceUID::ID ResourceFormatLoaderCompatText::get_resource_uid(const String &p_path) const {
1859 String ext = p_path.get_extension().to_lower();
1860
1861 if (ext != "tscn" && ext != "tres") {
1862 return ResourceUID::INVALID_ID;
1863 }
1864
1865 Ref<FileAccess> f = FileAccess::open(p_path, FileAccess::READ);
1866 if (f.is_null()) {
1867 return ResourceUID::INVALID_ID; //could not read
1868 }
1869
1870 ResourceLoaderCompatText loader;
1871 // Not actually used by get_uid()
1872 // loader.local_path = GDRESettings::get_singleton()->localize_path(p_path);
1873 // loader.res_path = loader.local_path;
1874 return loader.get_uid(f);
1875}
1876
1877bool ResourceFormatLoaderCompatText::has_custom_uid_support() const {
1878 return CompatFormatLoader::has_custom_uid_support();

Callers

nothing calls this directly

Calls 1

get_uidMethod · 0.45

Tested by

no test coverage detected