Fix Object::notification order

Previously the `p_reversed` parameter didn't influence the order
in a correct way.
Also script overridden _notification functions were not called in
the correct order.

To fix this some `notification` functions had to add a `p_reversed`
parameter.

This made it necessary to adjust cpp-bindings.

Co-authored-by: David Snopek <dsnopek@gmail.com>
This commit is contained in:
Markus Sauermann 2023-06-24 03:07:22 +02:00
parent 247c3548d8
commit c4705a590b
14 changed files with 314 additions and 28 deletions

View file

@ -205,7 +205,7 @@ public:
}
virtual Variant call_const(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error); // implement if language supports const functions
virtual void notification(int p_notification) = 0;
virtual void notification(int p_notification, bool p_reversed = false) = 0;
virtual String to_string(bool *r_valid) {
if (r_valid) {
*r_valid = false;
@ -476,7 +476,7 @@ public:
r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
return Variant();
}
virtual void notification(int p_notification) override {}
virtual void notification(int p_notification, bool p_reversed = false) override {}
virtual Ref<Script> get_script() const override { return script; }