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

Feature: Option to group vehicle list by shared orders #7028

Open
wants to merge 4 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@btzy
Copy link

btzy commented Jan 8, 2019

I added a "group by" dropdown to all vehicle lists to display one row per shared order, instead of one row per vehicle. I've tested it with all vehicle types, as well as with the "vehicle groups" window. When grouped by shared orders, clicking on a row will open the "shared orders of X vehicles" window.

Rationale: Quite often, we are concerned only with "routes" instead of individual vehicles. This feature highlights the important information (i.e. the routes) while reducing the importance of non-important information (i.e. the individual vehicles).

Extension: It is possible to have a third option - to group by vehicle group. As vehicle groups are mutually exclusive, it should be relatively simple to implement this extension. However, I'm not sure of its usefulness and I didn't want to make this PR too big.

Note: The new dropdown is available in the "shared orders of X vehicles" window too. Though it is of not much use, I left it in for consistency. The dropdown will be useful for the extension described above.

This is as per my post on TT Forums: https://www.tt-forums.net/viewtopic.php?f=32&t=84587&sid=fa68e80118896fca8f275a70d5cf6045

Some screenshots:
image
image
image
image

@btzy btzy force-pushed the btzy:station-vehicle-grouping branch from a02f906 to 7d4722c Jan 8, 2019

@LordAro
Copy link
Member

LordAro left a comment

General idea is great, thanks for contributing! It's quite a large diff with lots of changes all together, do you think it would be feasible to split it into multiple logical commits?
I wonder about the fairly significant use of C++11 stuff as well. Technically we should be all fine for it, but...

Show resolved Hide resolved src/vehicle_gui.cpp Outdated
Show resolved Hide resolved src/vehicle_gui.cpp Outdated
Show resolved Hide resolved src/vehicle_gui.cpp Outdated
Show resolved Hide resolved src/widgets/group_widget.h Outdated
Show resolved Hide resolved src/widgets/vehicle_widget.h Outdated
Show resolved Hide resolved src/vehicle_gui.cpp Outdated
@btzy

This comment has been minimized.

Copy link

btzy commented Jan 11, 2019

@LordAro Maybe I can split it into two commits: The first commit would split the original this->vehicles into this->vehicles and this->vehgroups. And the second commit would introduce GB_NONE and GB_SHARED_ORDERS. Would this be okay?

@btzy btzy force-pushed the btzy:station-vehicle-grouping branch 6 times, most recently from 8eb1680 to a31262a Jan 11, 2019

btzy added some commits Jan 11, 2019

Codechange: Make vehicle lists internally support grouping of vehicles
This is in preparation for the new UI feature that allows grouping by shared orders.
Feature: Option to group vehicle lists by shared orders
This applies to all kinds of vehicle lists, as well as the "vehicle groups" window.

@btzy btzy force-pushed the btzy:station-vehicle-grouping branch from a31262a to 70ab77f Jan 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment