-Moved EditorDefaultValue to ClassDB, made it core
-Removed one and zero hints for properties, replaced by default value
This commit is contained in:
@@ -1600,9 +1600,11 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const RES &p_r
|
||||
|
||||
String name = PE->get().name;
|
||||
Variant value = res->get(name);
|
||||
Variant default_value = ClassDB::class_get_default_property_value(res->get_class(), name);
|
||||
|
||||
if ((PE->get().usage & PROPERTY_USAGE_STORE_IF_NONZERO && value.is_zero()) || (PE->get().usage & PROPERTY_USAGE_STORE_IF_NONONE && value.is_one()))
|
||||
if (default_value.get_type() != Variant::NIL && bool(Variant::evaluate(Variant::OP_EQUAL, value, default_value))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (PE->get().type == Variant::OBJECT && value.is_zero() && !(PE->get().usage & PROPERTY_USAGE_STORE_IF_NULL))
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user