Fix NOTIFICATION_POSTINITIALIZE sent twice to native parent class
parent
ad307e4b9c
commit
06373ce1cf
|
@ -89,6 +89,7 @@ protected:
|
||||||
::godot::List<::godot::PropertyInfo> plist_owned;
|
::godot::List<::godot::PropertyInfo> plist_owned;
|
||||||
|
|
||||||
void _postinitialize();
|
void _postinitialize();
|
||||||
|
virtual void _notificationv(int32_t p_what, bool p_reversed = false) {}
|
||||||
|
|
||||||
Wrapped(const StringName p_godot_class);
|
Wrapped(const StringName p_godot_class);
|
||||||
Wrapped(GodotObject *p_godot_object);
|
Wrapped(GodotObject *p_godot_object);
|
||||||
|
@ -374,6 +375,11 @@ public:
|
||||||
_gde_binding_reference_callback, \
|
_gde_binding_reference_callback, \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
|
protected: \
|
||||||
|
virtual void _notificationv(int32_t p_what, bool p_reversed = false) override { \
|
||||||
|
m_class::notification_bind(this, p_what, p_reversed); \
|
||||||
|
} \
|
||||||
|
\
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Don't use this for your classes, use GDCLASS() instead.
|
// Don't use this for your classes, use GDCLASS() instead.
|
||||||
|
|
|
@ -51,10 +51,7 @@ void Wrapped::_postinitialize() {
|
||||||
}
|
}
|
||||||
godot::internal::gdextension_interface_object_set_instance_binding(_owner, godot::internal::token, this, _get_bindings_callbacks());
|
godot::internal::gdextension_interface_object_set_instance_binding(_owner, godot::internal::token, this, _get_bindings_callbacks());
|
||||||
if (extension_class) {
|
if (extension_class) {
|
||||||
Object *obj = dynamic_cast<Object *>(this);
|
_notificationv(Object::NOTIFICATION_POSTINITIALIZE);
|
||||||
if (obj) {
|
|
||||||
obj->notification(Object::NOTIFICATION_POSTINITIALIZE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue