pioneerspacesim / pioneer

A game of lonely space adventure
https://pioneerspacesim.net
1.63k stars 376 forks source link

Radial autopilot menu only works in the F4 list #4467

Closed bszlrd closed 5 years ago

bszlrd commented 6 years ago

Observed behaviour

The autopilot radial menus only work properly on the F4 list. On the UI itself. If you try to use it on the name next to the reticule or next to the body icon in worldview, the mouse will jump back to the center, and while doing that it picks the option from the menu, which is on that direction, and you can't pick another.

Expected behaviour

The radial menu to work properly on all three cases, like in the F4 menu, allowing the player to pick the proper autopilot command.

Steps to reproduce

Select a target, right click either to it's name on the right side of the reticule, or at the body indicator to call the radial menu. Try to pick any option other than what happens to be on the closest direction to the screen center.

My pioneer version (and OS): 2df911d

Web-eWorks commented 5 years ago

This appears to be a side effect from my IMGUI update - when using a radial, the mouse position jumps back to the center of the screen. In my testing, it appeared to work just fine when you held the mouse button down - the only difference was that at the start, the mouse warped to the center of the screen rather than staying at the center of the radial.

There are two ways to resolve this:

  1. Hide the mouse cursor entirely and use relative motion to select the radial direction. This would make the mouse input a virtual thumbstick bounded in -1..+1 for the duration of the radial, and is the most compatible with other input devices.the
  2. Test it against a revision from before my IMGUI update and figure out what exactly is causing the issue. My guess is it's in impl_sdl2, as it seems like an SDL-ish behavior to be exhibiting.

Ideally, we would restore the old behavior, but it might be worth also implementing the virtual thumbstick approach, as we could easily extend that to using gamepads or similar input devices for the FlightUI.

Web-eWorks commented 5 years ago

@nozmajner could you test again against the latest master? I believe this should be fixed now.

bszlrd commented 5 years ago

Yup, it works properly for me.