Closed SimplyLiz closed 3 years ago
Yes please!
Moving to v0.3
Closing because it has been fixed with order of add() calls in #657. If we need more functionality, like changing the z-index at runtime, then it should be enclosed in a different issue
I think for the Z-Order it'd be ok to have two containers:
The first container contains all UI Elements and is used for the UI renderloop. The second container only contains UiElements that are not in groups AND the containing group instead. (ButtonGroup is derived from UiElement). In the main event loop, try dynamic_cast to see if it's a group and needs to be treated differently, or else treat it as "normal" UiElement as before.
This way all elements could be handled in the same loop, maintaining correct click order and not handling buttons before other elements first.
Also, UiElements should have a "natural order". If a dialog is in the same Z-Order, buttons should always be drawn / handled before other elements.