Game version:
0.C-27466-gca7d9b3
Operating system:
Windows 10
Tiles or curses:
Tiles
Mods active:
Recipe loaded on e-ink tablet should show in crafting menu when the tablet meets the other usual circumstances for recipes from books being added to the crafting menu.
It does not.
Was it even working previously? When you select recipe on the E-Ink it just starts to be displayed on its menu, it is not being added to the list of your known recipes.
I can't answer to "working previously" because I usually go a while between builds and don't know if this existed before. To the rest, let me respond with this: The expectation I'm referring to in the report is that the tablet in range set to "show" the recipe in question would add to the list of craftable recipes the same way that a book in range adds recipes that are not memorized to your list of craftable recipes.
It was working at some point, this is the intended behaviour for e-ink tablets, and electronic readers in general.
It was working at some point, this is the intended behaviour for e-ink tablets, and electronic readers in general.
Yes, seems to work in stable 0.C.
That's the code in 0.C that gets e-ink book recipes working:
But code with all that HAS_RECIPE and RECIPE tags is not in current version anymore. I first thought about #18633, but it happened to be #17494.
Cooper was before the blame on this, so I'm guessing the "is_book" logic added to this broke it, unless there is a way that tablet types are modified at runtime that I don't know. https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/player.cpp#L9164-L9187
EDIT: And yes, according to ZhilkinSerg's edit, there is supplementary code that used to exist.
This seems straightforward-ish, the ereader maintains a string encoding all the recipes it "knows", the crafting code just needs to get at it. Mechanically that means decoding a comma-seperated string of recipe names and fixing up some other code. Stylistically that means adding an item::get_recipes() method because the crafting code has no business knowing the internals of how the recipes are stored.
Along with fixing it, I'm going to remove the "display a recipe on the ereader" feature, it's unnecessary.
Most helpful comment
Yes, seems to work in stable
0.C.That's the code in
0.Cthat gets e-ink book recipes working:https://github.com/CleverRaven/Cataclysm-DDA/blob/b5b4d4834970b78c76883cc5c66de07b3966aca4/src/player.cpp#L12436-L12463
But code with all that
HAS_RECIPEandRECIPEtags is not in current version anymore. I first thought about #18633, but it happened to be #17494.