mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Fix capsule height/radius setters with linked properties
Capsule height and radius setters can modify each other, rather than using clamping, to avoid cases where values are not set correctly when loading a scene (depending on the order of properties). Inspector undo/redo: Added the possibility to link properties together in the editor, so they can be undone together, for cases where a property can modify another one. Gizmo undo/redo: Capsule handles pass both radius and height values so they can be undone together.
This commit is contained in:
@@ -1068,6 +1068,20 @@ void ClassDB::set_property_default_value(const StringName &p_class, const String
|
||||
default_values[p_class][p_name] = p_default;
|
||||
}
|
||||
|
||||
void ClassDB::add_linked_property(const StringName &p_class, const String &p_property, const String &p_linked_property) {
|
||||
#ifdef TOOLS_ENABLED
|
||||
OBJTYPE_WLOCK;
|
||||
ClassInfo *type = classes.getptr(p_class);
|
||||
ERR_FAIL_COND(!type);
|
||||
|
||||
ERR_FAIL_COND(!type->property_map.has(p_property));
|
||||
ERR_FAIL_COND(!type->property_map.has(p_linked_property));
|
||||
|
||||
PropertyInfo &pinfo = type->property_map[p_property];
|
||||
pinfo.linked_properties.push_back(p_linked_property);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ClassDB::get_property_list(const StringName &p_class, List<PropertyInfo> *p_list, bool p_no_inheritance, const Object *p_validator) {
|
||||
OBJTYPE_RLOCK;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user