Picking event ordering
Objective
Correctly order picking events.
Solution
Event ordering very long standing problem with mod picking, stemming from two related issues. The was that events of different types couldn't be ordered, but we have already gotten around that in the upstream by switching to observers. Since observers run in the order they are triggered, this isn't an issue.
The second problem was that the underlying event streams that picking uses to create it's pointer interaction events also lacked ordering, and the systems that generated the points couldn't interleave events. This PR fixes that by unifying the event streams and integrating the various interaction systems.
The concrete changes are as follows:
-
bevy_winit::WinitEventhas been moved tobevy_window::WindowEvent. This provides a unified input stream for bothbevy_windowandbevy_inputevents. - Replaces
InputMoveandInputPresswithPointerInput, a new unified input event. This event is built to have drop-in forward compatibility with winit's upcoming pointer abstraction. I have added code to emulate it using the current winit input abstractions, but this entire thing will be much more robust when it lands. - Rolls
pointer_eventssend_click_and_drag_eventsandsend_drag_over_eventsinto a single system, which operates directly onPointerEventand triggers observers as output.
Status
This PR is unpolished. The core logic changes are present, but there's a lot of little details and polish. I've published this as a draft because I expect it to be X-Controversial and I want to get early fead-back on the overall solution. Nitpick away!
Testing
These changes are currently basically untested.