Browse Source

Add _get_bind_compatibility_methods to Object

Co-authored-by: RedworkDE <[email protected]>
Gilles Roudière 2 years ago
parent
commit
b4d86cb42a
1 changed files with 10 additions and 0 deletions
  1. 10 0
      core/object/object.h

+ 10 - 0
core/object/object.h

@@ -429,6 +429,9 @@ public:
 protected:                                                                                                                                       \
 protected:                                                                                                                                       \
 	_FORCE_INLINE_ static void (*_get_bind_methods())() {                                                                                        \
 	_FORCE_INLINE_ static void (*_get_bind_methods())() {                                                                                        \
 		return &m_class::_bind_methods;                                                                                                          \
 		return &m_class::_bind_methods;                                                                                                          \
+	}                                                                                                                                            \
+	_FORCE_INLINE_ static void (*_get_bind_compatibility_methods())() {                                                                          \
+		return &m_class::_bind_compatibility_methods;                                                                                            \
 	}                                                                                                                                            \
 	}                                                                                                                                            \
                                                                                                                                                  \
                                                                                                                                                  \
 public:                                                                                                                                          \
 public:                                                                                                                                          \
@@ -442,6 +445,9 @@ public:
 		if (m_class::_get_bind_methods() != m_inherits::_get_bind_methods()) {                                                                   \
 		if (m_class::_get_bind_methods() != m_inherits::_get_bind_methods()) {                                                                   \
 			_bind_methods();                                                                                                                     \
 			_bind_methods();                                                                                                                     \
 		}                                                                                                                                        \
 		}                                                                                                                                        \
+		if (m_class::_get_bind_compatibility_methods() != m_inherits::_get_bind_compatibility_methods()) {                                       \
+			_bind_compatibility_methods();                                                                                                       \
+		}                                                                                                                                        \
 		initialized = true;                                                                                                                      \
 		initialized = true;                                                                                                                      \
 	}                                                                                                                                            \
 	}                                                                                                                                            \
                                                                                                                                                  \
                                                                                                                                                  \
@@ -674,6 +680,7 @@ protected:
 	virtual void _notificationv(int p_notification, bool p_reversed) {}
 	virtual void _notificationv(int p_notification, bool p_reversed) {}
 
 
 	static void _bind_methods();
 	static void _bind_methods();
+	static void _bind_compatibility_methods() {}
 	bool _set(const StringName &p_name, const Variant &p_property) { return false; };
 	bool _set(const StringName &p_name, const Variant &p_property) { return false; };
 	bool _get(const StringName &p_name, Variant &r_property) const { return false; };
 	bool _get(const StringName &p_name, Variant &r_property) const { return false; };
 	void _get_property_list(List<PropertyInfo> *p_list) const {};
 	void _get_property_list(List<PropertyInfo> *p_list) const {};
@@ -685,6 +692,9 @@ protected:
 	_FORCE_INLINE_ static void (*_get_bind_methods())() {
 	_FORCE_INLINE_ static void (*_get_bind_methods())() {
 		return &Object::_bind_methods;
 		return &Object::_bind_methods;
 	}
 	}
+	_FORCE_INLINE_ static void (*_get_bind_compatibility_methods())() {
+		return &Object::_bind_compatibility_methods;
+	}
 	_FORCE_INLINE_ bool (Object::*_get_get() const)(const StringName &p_name, Variant &r_ret) const {
 	_FORCE_INLINE_ bool (Object::*_get_get() const)(const StringName &p_name, Variant &r_ret) const {
 		return &Object::_get;
 		return &Object::_get;
 	}
 	}