-Moved EditorDefaultValue to ClassDB, made it core

-Removed one and zero hints for properties, replaced by default value
This commit is contained in:
Juan Linietsky
2018-11-08 11:30:02 -03:00
parent e7cb47e686
commit f2e54057ae
53 changed files with 303 additions and 323 deletions
+3 -1
View File
@@ -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;