Feature: Build train locomotive filter #8733
Merged
+26
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation / Problem
When creating a train, there is no way of filtering by engines, given that the 'None' cargo filter removes all engines that also carry cargo, typically passengers and mail. As a player, I want to be able to see all the available engines regardless of whether they can carry cargo or not. This is especially helpful when creating passenger trains.
Description
This PR adds a new filter in the train vehicle window drop down menu so in addition to (1) any cargo, (2) no cargo, and (3) a specific cargo, players can also filter by engines only, regardless of whether they carry cargo or not.
This is how it looks, observe that some of the engines can carry passengers, like the selected one:
Note that
seems a little hacky to me, so I just reused the same pattern using CT_AUTO_REFIT as there wasn't a better option.
Limitations
N/A
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.