Add block search
If your pull request is not translation or serverlist-related, read the list of requirements below and check each box:
- [x] I have read the contribution guidelines.
- [x] I have ensured that my code compiles, if applicable.
- [x] I have ensured that any new features in this PR function correctly in-game, if applicable.
This PR Adds a search functionality very similar to the existing one for schematics to blocks. I made this because I can loosely type a block's name without needing to learn the speed dial for the block, or hunt for it in the menu.
Java is not my specialty, so feel free to roast me.
Also feel free to change the default keybind. the vim user in me (#btw 🤮) says / is search, so that's how I picked that.
Will this feature work on mobile?
I hadn't planned on it as typing to search on mobile seems like it would offer little advantage over whatever the mobile menu looks like.
I also don't currently have the know-how to test or develop for mobile.
This menu is broken as-is, and, frankly, I don't think it should look like it currently does at all:
- The icons are huge and blurry.
- Blocks are in ugly gray boxes.
- The dialog title is missing.
- Block names are incorrect (non-localized).
Personally, I think this should work like the IntelliJ Ctrl+N or the VSCode Ctrl+P "jump to file" menu - a very compact list that shows the first ~5 candidates in descending order of (biased) Levenshtein distance from the search term, with additional up/down arrow key selection for quick navigation. This would involve a complete rewrite of BuildingDialog as it is now, which is the bulk of this PR.
IntelliJ:
VSCode:
Hey @Anuken is there still anything outstanding from what you'd requested before this can be merged?