Allow filtering the vehicle list by station#997
Allow filtering the vehicle list by station#997AaronVanGeffen merged 9 commits intoOpenLoco:masterfrom
Conversation
|
I think a really useful feature along these lines would be filtering by Route. It would entail adding another widget where you can manage routes (which are essentially order lists) as a new tab on top right of screen perhaps called the route management widget. Then each train really has a reference to a global route object. This way you can have lets say 10 trains for example all on the same route. And then if you want to make a change, all you have to do is change the route to change all the trains destinations. This is essentially the same as "Shared-Orders" in openTTD. I guess the reason I'm posting here is that route is a very useful thing to sort trains by. Routes could be auto-named by there start and end station or something along those lines (you could manually name them too). |
|
I also think that the trains list view should have a selection mechanic where you can select multiple trains and then on the bottom of the window you can do various actions to all the trains you have selected. For example: Set Route, Remove From Rail, Stop, etc. |
|
Hi @TrevorCash, thanks for your input! I agree, filtering by order table would be even better. Unfortunately, implementing shared orders requires more of the base game to be reimplemented in C++. I think we don't have an issue tracked for shared order tables yet, by the way -- feel free to create one! (While it would technically be possible to share order tables at present, there is no good way to keep track of which ones are shared and such. Moreover, any of the original routines interopt |
|
I'll throw an issue up. Will be cool to see how things progress. |
a2945c3 to
5531b88
Compare
| 2212: "{MOVE_X 10}Carrying {STRINGID} {SPRITE}" | ||
| 2213: "»{MOVE_X 10}Carrying {STRINGID} {SPRITE}" |
There was a problem hiding this comment.
Not too sure about the wording here. I thought 'Transporting' was too long, but perhaps just 'Load of' would be better.
There was a problem hiding this comment.
I guess technically trains could have less than 1 Load of a cargo. Maybe "Contains cargo"?
There was a problem hiding this comment.
Hmm, "Contains cargo" is even longer. To be honest, I think we should probably just drop the verb entirely.
duncanspumpkin
left a comment
There was a problem hiding this comment.
Code looks sensible. Didn't test it though.
df0447a to
9e14c4f
Compare
…ature/mac-docker * 'master' of https://github.com/OpenLoco/OpenLoco: (536 commits) Mention code style in readme (OpenLoco#1047) Remove redundant rotate function (OpenLoco#1046) Link up implemented function (OpenLoco#1043) Fix use of constants for coord limits (OpenLoco#1037) validCoords: remove template parameter and name type (OpenLoco#1033) Add coordinate validation to tile loops with offsets (OpenLoco#1031) Implement ChangeCompanyColour game command (OpenLoco#1029) Implement colour picker dropdowns (OpenLoco#1028) Implement StationManager::generateNewStationName (OpenLoco#1020) Station rename command (OpenLoco#984) Fix access to embedded object name (OpenLoco#1022) Reduce inclusion of StringIds.h in header files (OpenLoco#985) Implement the station name background paint (OpenLoco#1023) Force alignment on TileManager::createAnimation hook Merge duplicated flags and use accessors (OpenLoco#1025) Remove use of global stringformatbuffer where not required (OpenLoco#1024) Refactor calls to tryCreateInitialMovementSound (OpenLoco#1018) Turn widget draw functions into Widget struct member functions (OpenLoco#1012) Allow filtering the vehicle list by station or cargo (OpenLoco#997) Restore game command table alignment ...
On advanced scenarios, the list of vehicles can get very long, making vehicle management more cumbersome than needed. This PR introduces basic filtering of the vehicle list by station or cargo
To do this, the window currently looks at whether a station window is open, and filters by that window's station id. Ideally, the user would be able to select a station via the UI. However, there can be 1024 stations in any given game, so I think this is a nice compromise.
While currently the filtering is enabled at all times, I would like to extend this so the player can opt-in to the filter instead. Perhaps we can offer a cargo filter as well (with a dropdown, up to 32 options).Showing all vehicles:

Filtering by a particular station (by open station window):

Filtering by particular cargo:
