Don't hardcode help text: Overmap filter popup #79325
Merged
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.
Summary
SUMMARY: Interface "Don't hardcode help text: Overmap filter popup"
Purpose of change
Help text should not be hardcoded as, if end user changes their keybinds, it will cause discrepancies in the UI.
This PR targets the filter pop up window for the Overmap UI and partially addresses #78986
Describe the solution
Pull the currently set keybind for each command, then replace the help text string with a function that enumerates the keybinds.
Describe alternatives you've considered
A lot of different ways of handling displaying help text. I used the Crafting window implementation as a reference again because it looks clean, even though it has some features that won't be relevant for this popup.
Testing
Game compiles and loads.
Open overmap, open filter popup.
Confirm all filter commands work.
Query something, confirm all search result commands work (previous/next result, confirm, quit, etc.)
Change keybind for
TEXT.CLEAR
and confirm it updates.Additional context
This popup is always the same width, regardless of terminal size.
Before
![Screenshot 2025-01-24 120622](https://private-user-images.githubusercontent.com/2993060/406546202-e3163b28-dbf9-4e7f-b415-7c248133caff.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MTQ4NzksIm5iZiI6MTczODkxNDU3OSwicGF0aCI6Ii8yOTkzMDYwLzQwNjU0NjIwMi1lMzE2M2IyOC1kYmY5LTRlN2YtYjQxNS03YzI0ODEzM2NhZmYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMDc0OTM5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjExZDQyNjM5NjlmYzMxNjkzMzAwNDU3OWY5MTQxNDZlMzBmOTY4MWU1OWRkYWYzMzE0YjQ4MmFhZjQwY2RhYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.KyFKokBdQz407g1GeKPONNCiIIQEgSPr5bf5XPfbeTs)
![Screenshot 2025-01-24 120437](https://private-user-images.githubusercontent.com/2993060/406546266-34c62ab0-7829-40ca-9b93-52aeddf63539.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MTQ4NzksIm5iZiI6MTczODkxNDU3OSwicGF0aCI6Ii8yOTkzMDYwLzQwNjU0NjI2Ni0zNGM2MmFiMC03ODI5LTQwY2EtOWI5My01MmFlZGRmNjM1MzkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMDc0OTM5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MmNlYTNiMWNlNzM5NmJjZWI2N2UxYTAwMGYxODAwZGZjYjY2ZTU0MzI3MTU4NjljNTViYjk3ZmJhNzEwMTJiZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.uQql-TZ1TGMiMEmvjs8PptY0ZDS8utZCdcwoNCiHcAg)
![Screenshot 2025-01-24 121019](https://private-user-images.githubusercontent.com/2993060/406546284-9df1b21b-dc9d-4745-8497-9370e84178eb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MTQ4NzksIm5iZiI6MTczODkxNDU3OSwicGF0aCI6Ii8yOTkzMDYwLzQwNjU0NjI4NC05ZGYxYjIxYi1kYzlkLTQ3NDUtODQ5Ny05MzcwZTg0MTc4ZWIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMDc0OTM5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YzJlZDZhNGExMWI3ODY1YjgyNGVjZTUzNmY5NjUyY2M2YzczYzM4ZmY4MWMwNGZmMDY4NzczODQ1OTMwMGMzZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.rNoAKxZgRTIqZs7WobI2uBG4zgiqwzaJCGgvjqZ8Sn4)
After (looks a little better too, right 🙂)
After changed the keybind for clear