summaryrefslogtreecommitdiff
path: root/core/object/object.h
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2021-08-12 11:26:47 -0700
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2021-08-19 10:31:19 -0700
commit645bc94bfcb0d494e9d53e29aee1419800adcd4e (patch)
tree1ff9fd17f54d9490effc9bb09f0610bad3577b3c /core/object/object.h
parent93dac1c7db0837eba82831e6391a022d454b67f9 (diff)
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.
Diffstat (limited to 'core/object/object.h')
-rw-r--r--core/object/object.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/object/object.h b/core/object/object.h
index 63d38120f6..94531f1cd0 100644
--- a/core/object/object.h
+++ b/core/object/object.h
@@ -143,6 +143,7 @@ enum PropertyUsageFlags {
#define ADD_PROPERTY_DEFAULT(m_property, m_default) ::ClassDB::set_property_default_value(get_class_static(), m_property, m_default)
#define ADD_GROUP(m_name, m_prefix) ::ClassDB::add_property_group(get_class_static(), m_name, m_prefix)
#define ADD_SUBGROUP(m_name, m_prefix) ::ClassDB::add_property_subgroup(get_class_static(), m_name, m_prefix)
+#define ADD_LINKED_PROPERTY(m_property, m_linked_property) ::ClassDB::add_linked_property(get_class_static(), m_property, m_linked_property)
struct PropertyInfo {
Variant::Type type = Variant::NIL;
@@ -152,6 +153,10 @@ struct PropertyInfo {
String hint_string;
uint32_t usage = PROPERTY_USAGE_DEFAULT;
+#ifdef TOOLS_ENABLED
+ Vector<String> linked_properties;
+#endif
+
_FORCE_INLINE_ PropertyInfo added_usage(uint32_t p_fl) const {
PropertyInfo pi = *this;
pi.usage |= p_fl;