Compute materials the player have in stack/chests to determine craftable/cook-able recipes
mlorant opened this issue · 1 comments
I got an idea that may simplify the life for those who are achievement seeker (like me) and want to craft/cook known recipes as fast as possible.
Today there are two categories for crafting and cooking: Known recipes and Unknown recipes. I would like to introduce a new one: Ready to [cook|craft] recipes.
This category would list recipes known by the player and that can be done with the current items in the inventory/fridge and chests. This would avoid many round trip between the checkup and the wiki/menus.
I would not include unknown recipes as you should not know what they need (except using the wiki...) and as anyway you need the recipe first.
To achieve that however, it implies to import/copy the recipes content in the JS file... I don't think it is a big deal, but that would be a lot of data to append. A recipe could be represented like this:
recipes: {
[...]
611: {
'name': 'Blackberry Cobbler',
'requirements': [ [2, 410], [1, 245], [1, 246] ]
}
[...]
}
... where [ [2, 410], [1, 245], [1, 246] ]
means 2 Blackberries, 1 sugar and 1 wheat flour (according to my savefile, is it parentSheetIndex that I should take?). Once this big data object is specified, we need to iterate over each <Object xsi:type="Chest" />
, <fridge />
and <items />
to create a list of all the "materials" available to cook/craft the recipes.
This may severely slow down the JS processing of the file however, so it may be done apart/async of the rest, or give an extra button to compute it if the player needs it.
What do you think about it, @MouseyPounds?
I think this is beyond the scope of the app due to both the amount of data needed for the recipe ingredients and the amount of container searching. I'm leaving it open for now, though, as it is an interesting idea and I do see the usefulness.