From b4d86cb42a8967be4f55038229e1d451498f2fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gilles=20Roudi=C3=A8re?= Date: Thu, 20 Jul 2023 12:53:10 +0200 Subject: [PATCH] Add _get_bind_compatibility_methods to Object Co-authored-by: RedworkDE <10944644+RedworkDE@users.noreply.github.com> --- core/object/object.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/object/object.h b/core/object/object.h index a3e9d025ea8e..318dbf98de7e 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -429,6 +429,9 @@ public: protected: \ _FORCE_INLINE_ static void (*_get_bind_methods())() { \ return &m_class::_bind_methods; \ + } \ + _FORCE_INLINE_ static void (*_get_bind_compatibility_methods())() { \ + return &m_class::_bind_compatibility_methods; \ } \ \ public: \ @@ -442,6 +445,9 @@ public: if (m_class::_get_bind_methods() != m_inherits::_get_bind_methods()) { \ _bind_methods(); \ } \ + if (m_class::_get_bind_compatibility_methods() != m_inherits::_get_bind_compatibility_methods()) { \ + _bind_compatibility_methods(); \ + } \ initialized = true; \ } \ \ @@ -674,6 +680,7 @@ class Object { virtual void _notificationv(int p_notification, bool p_reversed) {} static void _bind_methods(); + static void _bind_compatibility_methods() {} bool _set(const StringName &p_name, const Variant &p_property) { return false; }; bool _get(const StringName &p_name, Variant &r_property) const { return false; }; void _get_property_list(List *p_list) const {}; @@ -685,6 +692,9 @@ class Object { _FORCE_INLINE_ static void (*_get_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 { return &Object::_get; }