This commit is contained in:
Spartan322
2025-06-05 19:48:09 -04:00
772 changed files with 22320 additions and 10966 deletions

View File

@@ -36,6 +36,7 @@
#include "core/io/dir_access.h"
#include "core/io/missing_resource.h"
#include "core/object/script_language.h"
#include "scene/property_utils.h"
void ResourceLoaderText::_printerr() {
ERR_PRINT(vformat("%s:%d - Parse Error: %s.", res_path, lines, error_text));
@@ -1225,15 +1226,10 @@ Error ResourceLoaderText::get_classes_used(HashSet<StringName> *r_classes) {
return error;
}
if (!next_tag.fields.has("type")) {
error = ERR_FILE_CORRUPT;
error_text = "Missing 'type' in external resource tag";
_printerr();
return error;
if (next_tag.fields.has("type")) {
r_classes->insert(next_tag.fields["type"]);
}
r_classes->insert(next_tag.fields["type"]);
while (true) {
String assign;
Variant value;
@@ -1449,9 +1445,9 @@ bool ResourceFormatLoaderText::handles_type(const String &p_type) const {
}
void ResourceFormatLoaderText::get_classes_used(const String &p_path, HashSet<StringName> *r_classes) {
String ext = p_path.get_extension().to_lower();
if (ext == "tscn") {
r_classes->insert("PackedScene");
const String type = get_resource_type(p_path);
if (!type.is_empty()) {
r_classes->insert(type);
}
// ...for anything else must test...
@@ -1937,7 +1933,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const Ref<Reso
}
}
Variant default_value = ClassDB::class_get_default_property_value(res->get_class(), name);
Variant default_value = PropertyUtils::get_property_default_value(res.ptr(), name);
if (default_value.get_type() != Variant::NIL && bool(Variant::evaluate(Variant::OP_EQUAL, value, default_value))) {
continue;