raiguard / RecipeBook

Recipe Book for Factorio.
MIT License
20 stars 9 forks source link

filter-option for "show recipes unlocked by certain science pack(s)" #89

Closed eyekoms closed 2 years ago

eyekoms commented 2 years ago

Hi,

do you see any possibility to add a filter-option, where one can set specific science packs, to only get search results based on it?

Like the "show unresearched objects" option.

Explanation: In big mods like Py or Nullius there are different recipes for one item. I want to have the possibilty to search only for recipes which are accessibly at the current state (in YAFC it's named Milestone) . So when I can just produce Science Pack 1 and 2, I don't need recipes which will be unlocked by Science Pack 3 or higher.

For example: If you are at the beginning (only red science) of a Py-Game and you have to make bones, this option will just show you all bones-recioes which can be made with corresponding technology (in this case only red science). Regardless whether they are already researched or not.

Many thanks in advance!

raiguard commented 2 years ago

image

I thought this was going to be a royal pain, but it was actually pretty straightforward! Implemented for the next major version.

eyekoms commented 2 years ago

This looks really cool, I'm curious to see how it works! I didn't think it could be so complicated - I thought it could be a simple query, but I have no idea about programming at all. Thank you very much for implementing it!

raiguard commented 2 years ago

It builds off of the existing categories system, with one difference: every science pack that is related to a thing must be enabled in order for the thing to show. I also had to add some logic so that things with multiple technologies to unlock them show when their lowest tier set of science packs is checked. Overall, it built on the existing system, but I did have to make a few tweaks.