Viewing items will re-create crafting inventory for every single item (that has a recipe that uses it) viewed, even if the inventory doesn’t change (for example, when picking an item to craft or just scrolling an item list). The time to view an item is now comparable to the time to open crafting menu, which in big crafting rigs can get HUGE.
Even if the crafting inventory was to get cached, I’d rather have an option to turn this display off. At least the graying uncraftable things part - just listing recipes doesn’t take much time, as evidenced by items that lack recipes associated with them (no recipes = crafting inventory isn’t built).
I was worried about that, I suspect we may have fallen afoul of “dev box syndrome” here.
While it’s handy to have the list around, I’m not sure it’s worth it being displayed all the time if it causes slowdoooowwwnnnn…
hrm, this isn’t “stuff you can craft with nearby items”, this is “recipes that include this item”, right?
If so we just need to make a reversed known recipes map, that maps from components to recipes.
It would only need updating when you learn a new recipe.
When you view an item that has no recipes that use it, it is quite fast (not noticeably slower than before), because it only goes through the recipes.
If the item has at least one recipe that uses it, it builds an entire crafting inventory by reading surrounding map tiles. This one is as slow as opening a crafting menu.