Skip to content

Conversation

@OriginLive
Copy link
Contributor

@OriginLive OriginLive commented Jan 3, 2026

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:

  • Searches through books in the player's inventory that contain the recipe
  • Searches through helpers in the crafting group who know the recipe
  • Matches against book names, book variant names, and helper names
Untitled3

Implementation details:

  • Added book to recipe_subset::search_type enum
  • Extended recipe_subset::search() methods with optional Character parameter (needed to check inventory and crafting group). Made sure it's backwards compatible and safe with constant ref!
  • Added case 'b' handler in filter_recipes() in crafting_gui.cpp

Example usage:

  • b:Tactical Handgun - shows recipes from books with "Tactical Handgun Digest" in the name
  • b:Defensive Handgun - shows the same recipes as above, since it's an alternative book name

Describe alternatives you've considered

  • I was also considering removing the current removal of the text once the player has memorised the recipe. But in the end, i chose not to tackle that since it might become unsightly when you have a lot of books at hand. But let me know if that's something that would come in handy, since it's an easy fix.
  • I was considering expanding Recipes display when looking at the book (via >), but that wouldn't solve the issue for searching conveniently in the crafting menu

Testing

Tested in-game:

  • Searched for recipes by book name (partial matches work)
  • Searched for recipes by book variant names!
  • ! Did not know how to search for recipes known by helper NPCs, would need some help here !
  • Searched for memorised recopies, works but doesn't show the source (see my first alternative)
  • Verified empty results when no matches found
  • ! Did not test with crafting group, never done that, would need some help here !

No regressions found in existing search functionality, did some normal searches just to be sure.

Untitled Untitled2

Additional context

This complements the existing filters and makes the recipe search more comprehensive, hopefully finally getting rid of my pet peeve

@github-actions github-actions bot added Info / User Interface Game - player communication, menus, etc. Crafting / Construction / Recipes Includes: Uncrafting / Disassembling [C++] Changes (can be) made in C++. Previously named `Code` new contributor astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Jan 3, 2026
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jan 3, 2026
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jan 4, 2026
simplified codebase
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jan 6, 2026
@Maleclypse Maleclypse merged commit d64b666 into CleverRaven:master Jan 9, 2026
24 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions new contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants