Page 1 of 1

Fire on_gui_click on mouse up for empty-widgets, instead of mouse down

Posted: Sun Feb 21, 2021 6:14 pm
by raiguard
I am experimenting with reordering items in a list by dragging in a mod GUI, similar to the train GUI. I have a pretty good idea of how to go about it, but I need a reliable way of detecting when the drag ends. Buttons fire on_gui_click on mouse up, which would be perfect, but unfortunately empty-widgets do not do the same. And you can't set a drag_target on a button, so I can't use a button to facilitate the drag either.

If empty-widgets fired the event on mouse up, then I could simply use that to tell when the finished dragging.