Crafting GUI filter: by recipe source (book or npc) #84441
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
Interface "Add crafting recipe filter by its source"
Purpose of change
Based on PR #78346 which added bodypart coverage filtering. I wanted to find recipes based on which book contains them. Currently, there's no way to filter recipes by their source in the crafting menu, making it frustrating to find all recipes from a specific book
Describe the solution
Adds a new
b:[b]ook prefix filter to the crafting GUI recipe search that allows searching by recipe source:Implementation details:
booktorecipe_subset::search_typeenumrecipe_subset::search()methods with optionalCharacterparameter (needed to check inventory and crafting group). Made sure it's backwards compatible and safe with constant ref!filter_recipes()in crafting_gui.cppExample usage:
b:Tactical Handgun- shows recipes from books with "Tactical Handgun Digest" in the nameb:Defensive Handgun- shows the same recipes as above, since it's an alternative book nameDescribe alternatives you've considered
Testing
Tested in-game:
No regressions found in existing search functionality, did some normal searches just to be sure.
Additional context
This complements the existing filters and makes the recipe search more comprehensive, hopefully finally getting rid of my pet peeve