-
-
Notifications
You must be signed in to change notification settings - Fork 968
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: rail station class name filtering #8706
Conversation
0016a83
to
ed8edad
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.
Some minor code style fixes. Maybe @SamuXarick could take a look at it also. :)
@devs: Please add the preview label to this. :) (And thanks for that feature. :P)
Would it be possible that the filter textbox get automatically focused when the station building window opens? So we could type in immediately without to click on the textbox. Just like in the case of the build object window. |
Done! All good. |
I would be happy with a drop down menu with the sort orders here too. :) |
Yep that could be a good addition, however I believe it might be better to do it in a separate PR. I am also thinking about ´favoriting´ / ´starring´ classes or objects to being able to quickly use the most frequent ones, |
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.
More or less fine, afaict. Looks good!
I'm playing the latest release candidate with a bunch of friends as we speak. Myself and several others are having issues with this feature. The filter works fine, but auto focus on the text field is a problem. For example, if you want to remove a station tile, you typically click the station button and hit R. But that R button is now simply adding an r to the filter string. Same thing if you press delete to clear all windows... you're deleting characters in the filter string. This really kills the whole flow of the UI, it's quite annoying. One of my friends pointed out that the Town Directory window has a similar filter string, but this text field does not automatically get the focus. And then it works just fine. So I think removing the auto focus should do the trick. |
You raise good points. I'd recommend raising a new issue though. Comments on closed/merged PRs tend to get lost |
Good point, I'll do it right away! |
If you press the ESC, the focus is lost and you can use the hotkeys. |
Motivation / Problem
Players with many NewGRF enabled for train stations sometimes struggle at finding the right one to place in every situation. This PR introduces a filter edit box for quicker access when train station NewGRF are enabled in the game. This is especially helpful for those that care about station design and eye candy looking terminals.
Description
Add a text box to the Build Rail Station window for filtering train station classes. This is similar to the previous feature implemented in the Object Selection window here: #8603.
This is what it looks like:
Note that the sorting logic is based on the added NewGRF order given the concerns in #8817:
Limitations
No limitations.
Testing
The following test cases have been tested:
All seems to work perfectly.
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.