-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

View File

@ -1813,8 +1813,13 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p
Property p;
p.name_idx = get_string_index(F->get().name);
p.value = E->get()->get(F->get().name);
if (((F->get().usage & PROPERTY_USAGE_STORE_IF_NONZERO) && p.value.is_zero()) || ((F->get().usage & PROPERTY_USAGE_STORE_IF_NONONE) && p.value.is_one()))
Variant default_value = ClassDB::class_get_default_property_value(E->get()->get_class(), F->get().name);
if (default_value.get_type() != Variant::NIL && bool(Variant::evaluate(Variant::OP_EQUAL, p.value, default_value))) {
continue;
}
p.pi = F->get();
rd.properties.push_back(p);