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

Method get_resource_name

compat/resource_loader_compat.cpp:631–647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

629}
630
631String ResourceCompatConverter::get_resource_name(const Ref<MissingResource> &res, int ver_major) {
632 String name;
633 Variant n = ver_major < 3 ? res->get("resource/name") : res->get("resource_name");
634 if (n.get_type() == Variant::STRING) {
635 name = n;
636 }
637 if (ver_major == 0) {
638 n = res->get("resource_name");
639 if (n.get_type() == Variant::STRING) {
640 name = n;
641 }
642 }
643 if (name.is_empty()) {
644 name = res->get_name();
645 }
646 return name;
647}
648
649Ref<Resource> ResourceCompatLoader::_fake_load(const String &p_path, const String &p_type_hint) {
650 return fake_load(p_path, p_type_hint, nullptr);

Callers

nothing calls this directly

Calls 3

getMethod · 0.45
get_typeMethod · 0.45
get_nameMethod · 0.45

Tested by

no test coverage detected