-
-
Notifications
You must be signed in to change notification settings - Fork 972
Feature: Add cargo filter support to vehicle list. #8308
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
Conversation
d7ac3fa
to
9847f67
Compare
9847f67
to
40923b1
Compare
Hi Stormcone. Thanks for this! :) Would it be possible to add a brief description covering the list below?
This just really aids reviewing, and we would like to make reviewing faster and frequent. We have lots of nice contributions stuck and we would like to change that. :) |
For example if you have trains that can transport multiple cargoes, and want to replace one kind of wagon to another one which can carry a specific cargo, then you can filter the trains which can carry that one cargo. A more detailed example, in the early game years you have only box cars to carry everything, but with time goes, a grain hopper getting available, so you want to use it to break the monotonicity of appearance of your trains, or the new wagon can carry more cargo, or can be hauled faster. So it makes easier to find the right trains to replace the wagons. Or you can check on a station or on a waypoint whether a specific cargo goes through it or not. |
40923b1
to
c978c7c
Compare
Thanks. So currently I have to use 'Sort by' and 'Total capacity by cargo type' for the examples you give. This new filter seems useful. Does it have any weird interactions with 'refit at station' [to cargo] or [to any available]? |
Sorry, I did not see your reply yesterday. This patch collects the cargoes by the current state of what the vehicles can carry. So for example if a wagon currently can carry steel, then with filter set to steel the train will appear in the list. But if the train reaches a station where the wagon is refitted to carry goods, then it will disappear from the list. There is no difference whether the refit is explicit to a specific cargo or to any available. So I would not say that is weird interaction, but indeed it is not ideal in the case of refit orders. |
Needs a rebase. 🙂 I don't see an easy way to find vehicles which carry the selected cargo at some point in their journey, but are currently refitted to something else. It would be possible to loop through every order looking for a refit to the selected cargo, but that sounds expensive, and wouldn't work for vehicles with "refit to available cargo." The fact that it wouldn't find each individual vehicle might not be a big a problem since I imagine most players doing refits also use shared orders, and most shared-order vehicle groups would probably have at least one vehicle currently on the leg of its journey where it carries the selected cargo. I'm okay with this corner case but would appreciate more opinions. |
c978c7c
to
561e545
Compare
561e545
to
1529263
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me. Just a few nitpicks.
1529263
to
f57d753
Compare
This patch is based on @KeldorKatarn's commits:
KeldorKatarn/OpenTTD_PatchPack@3f03ec47
KeldorKatarn/OpenTTD_PatchPack@96c3f33b
KeldorKatarn/OpenTTD_PatchPack@7ba6ec3a