-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Container queue_sort not working #31408
Comments
Can't reproduce on 3.1 stable release 64-bit on windows 10. I've made a minimal project for test: @TheDuriel Can you test with my project? If it works for you, then please share a project for your repro. |
https://github.com/godotengine/godot/files/3509487/buttonlist.zip This is from a different issue of mine. Ignore the broken signals. If you replace the notification calls with the queue calls it should stop responding to updates when you edit the exported properties or add nodes to the container. Ill take a look at your project. |
Ok, I get it! You don't get the notification because your script overrides It works fine if you add You'll also have to remove |
sort_children and _sort_children should be very different functions. to override a function the name must an identical match. even so, if it was overriding it, then would that not result in the exact same result as calling _notification... considering all _notification is doing is calling _sort_children? |
Sorry for the confusion, I meant to only refer to The main idea is that Now the reason why you don't get the sorting to happen at all: Hope it's clearer now :) Code references: Lines 135 to 145 in afecc0b
Lines 86 to 94 in afecc0b
|
Yeah so this is interesting. _sort_children is bound in the Container.cpp https://docs.godotengine.org/en/latest/classes/class_container.html#class-container I have my doubts whether or not this is the problem at hand, but it could be. |
I see! You're right, it looks like the intended behavior is for the A side effect of the way it has been implemented is that if you have a function called |
…n prevent sorting to work correctly if it's overridden in gdscript by mistake. Added support for Object::notification to send notifications to the script first and updated the corresponding documentation. Fix godotengine#31408
Godot version:
3.1
Issue description:
Containers sort_children() function is meant to queue a NOTIFICATION_SORT_CHILDREN. But instead nothing happens.
Steps to reproduce:
The above code works as expected when calling _notification. I would expect that a queue_sort() call would have the same effect. Bug? Documentation error? Looking at source it implies it works as I expect.
https://github.com/godotengine/godot/blob/master/scene/gui/container.cpp#L135
The text was updated successfully, but these errors were encountered: