Page 1 of 1

Support drag to reorder for GUI Elements

Posted: Thu May 22, 2025 7:46 pm
by PennyJim
There's a number of times people want to make a GUI with a fancy drag to reorder list, like replicating the train schedule menu for various other reasons.

I'm imagining it either being a new element like "reorderable-list" or maybe an argument like allow_reorder on the "scroll-pane", that lets the direct children be valid targets for drag_target.

This of course would need to come with at least one event, but I'm thinking two:
  • on_gui_reorder_start - So mods can possibly collapse elements like the train schedule?
    • I was remembering behavior from an entirely different application. Feel no obligation to actually add this one. I was already thinking of plenty of problems with it and latency
  • on_gui_reorder_finish - Which contains a reference to the element moved, the initial index, and the new index

Re: Support drag to reorder for GUI Elements

Posted: Thu May 22, 2025 9:37 pm
by protocol_1903
+1, would greatly help for train stop like UIs where reordering is a main use case

Re: Support drag to reorder for GUI Elements

Posted: Thu May 22, 2025 11:19 pm
by curiosity

Re: Support drag to reorder for GUI Elements

Posted: Thu May 22, 2025 11:23 pm
by PennyJim
curiosity wrote: Thu May 22, 2025 11:19 pm Duplicate of viewtopic.php?t=100481
Damnit, I tried looking for other requests. In my defense, mine actually has improvement details to limit the scope of the idea instead of just asking for it...

Re: Support drag to reorder for GUI Elements

Posted: Thu May 22, 2025 11:31 pm
by curiosity
The risk of including implementation details is that it constrains possible implementations. I have seen requests denied because the dev couldn't do them exactly as asked. Which is why I made my request as open-ended as possible, in hope that maybe we finally get something.

Re: Support drag to reorder for GUI Elements

Posted: Fri May 23, 2025 3:09 am
by Osmo
+1, as someone who worked with replicas of this schedule-like system with buttons, and currently doing the same in a different mod, this would be very useful.
Even if the amount of work to make it will be the same or more, buttons are just much worse from end user perspective.

Re: Support drag to reorder for GUI Elements

Posted: Fri May 23, 2025 5:30 am
by MrSmoothieHuman
+1