Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vehicle Groups: new group as subgroup of selected group #6491

Closed
DorpsGek opened this issue Jul 18, 2016 · 2 comments
Closed

Vehicle Groups: new group as subgroup of selected group #6491

DorpsGek opened this issue Jul 18, 2016 · 2 comments
Labels
component: interface This is an interface issue enhancement Issue would be a good enhancement; we accept Pull Requests! flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

3298 opened the ticket and wrote:

When creating a group, it is sometimes meant to be a subgroup of an existing group. Currently this has to be done in two steps: creating the group, then dragging it onto the parent group. With a lot of groups, dragging can become unpleasant. This patch aims to eliminate the second step by using the selected group as parent of the new group. Parent-less groups can be created by selecting the special groups (all, ungrouped).
This patch was originally done as a response to a thread in the OpenTTD Suggestions forum (https://www.tt-forums.net/viewtopic.php?f=32&t=72169), but it seems I never actually posted it. I recently rediscovered it in my local git repository and rebased it.
The implementation is pretty straightforward, using the (previously unused) parameter p2 of CmdCreateGroup to transfer the parent group. If it is a valid group, the same sanity checks as in CmdAlterGroup are performed (excluding the infinite loop check because the newly created group cannot be the parent of anything yet).
Creating a group by pushing the button sends the currently selected group as parent, of course.
Creating a group by dragging a vehicle sends INVALID_GROUP as parent because it needs to be dragged into the empty space below the list of groups. In that case, it feels more logical to create a parent-less group, but I am open to suggestions here.
Scripts also get to create parent-less groups only because I value compatibility over the slight performance and convenience advantages of changing the API to expose the added parent parameter. If a script wizard (Zuu?) knows how to expose the new parameter while preserving compatibility, feel free to amend the patch.
The attached patch applies to r27618.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/6491
@DorpsGek
Copy link
Member Author

andythenorth wrote:

See also #6053 for group expand/collapse, #6189 for group totals, and #5334 for group profit display.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6491#comment14603

@DorpsGek DorpsGek added component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) enhancement labels Apr 7, 2018
@andythenorth
Copy link
Contributor

3298 has stopped working on this. https://www.tt-forums.net/viewtopic.php?f=33&t=83025

I am closing as there is no longer anybody to push this one through, and we are cleaning up so we can prioritise. I do think it's a legit improvement, and could be re-opened in future if anybody wants to get it done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: interface This is an interface issue enhancement Issue would be a good enhancement; we accept Pull Requests! flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

2 participants