mirror of
https://github.com/godotengine/godot
synced 2024-09-04 21:28:28 +00:00
Merge pull request #90384 from groud/dont_save_some_default_tileset_props
TileSet: don't save angular and linear physics velocities if they have their default values
This commit is contained in:
commit
a5565c86ff
|
@ -6805,8 +6805,20 @@ void TileData::_get_property_list(List<PropertyInfo> *p_list) const {
|
|||
// Physics layers.
|
||||
p_list->push_back(PropertyInfo(Variant::NIL, GNAME("Physics", ""), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
|
||||
for (int i = 0; i < physics.size(); i++) {
|
||||
p_list->push_back(PropertyInfo(Variant::VECTOR2, vformat("physics_layer_%d/%s", i, PNAME("linear_velocity")), PROPERTY_HINT_NONE));
|
||||
p_list->push_back(PropertyInfo(Variant::FLOAT, vformat("physics_layer_%d/%s", i, PNAME("angular_velocity")), PROPERTY_HINT_NONE));
|
||||
// physics_layer_%d/linear_velocity
|
||||
property_info = PropertyInfo(Variant::VECTOR2, vformat("physics_layer_%d/%s", i, PNAME("linear_velocity")), PROPERTY_HINT_NONE);
|
||||
if (physics[i].linear_velocity == Vector2()) {
|
||||
property_info.usage ^= PROPERTY_USAGE_STORAGE;
|
||||
}
|
||||
p_list->push_back(property_info);
|
||||
|
||||
// physics_layer_%d/angular_velocity
|
||||
property_info = PropertyInfo(Variant::FLOAT, vformat("physics_layer_%d/%s", i, PNAME("angular_velocity")), PROPERTY_HINT_NONE);
|
||||
if (physics[i].angular_velocity == 0.0) {
|
||||
property_info.usage ^= PROPERTY_USAGE_STORAGE;
|
||||
}
|
||||
p_list->push_back(property_info);
|
||||
|
||||
p_list->push_back(PropertyInfo(Variant::INT, vformat("physics_layer_%d/%s", i, PNAME("polygons_count")), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR));
|
||||
|
||||
for (int j = 0; j < physics[i].polygons.size(); j++) {
|
||||
|
|
Loading…
Reference in a new issue