Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E-ink tablet displays copied recipes from ebooks and SD-cards #51138

Merged
merged 6 commits into from
Sep 11, 2021
Merged

E-ink tablet displays copied recipes from ebooks and SD-cards #51138

merged 6 commits into from
Sep 11, 2021

Conversation

Hymore246
Copy link
Contributor

Summary

Interface "E-ink tablet displays copied recipes from ebooks and SD-cards"

Purpose of change

Recipes stored in an e-ink tablet are included in the item description.

Describe the solution

After creating #50579, I decided to give the same treatment to the e-ink tablet. Previously, it was very hard to view recipes copied from SD cards and after #49408 added the ability store books in the tablet, it has become even more important to make this change.

When you examine an e-ink tablet, it will display two addition sections that show what recipes have been copied into it. One section is for SD card recipes and the other is a combination of all recipes from every ebook in the tablet. These follow the same format as in #50579. Furthermore, the ebook section will only display a recipe once even if it is found in multiple books to save space and make it easier to read. This doesn't include recipes scanned from SD cards so there can be duplicates between the two sections. This is intentional since there is no other way to view SD card recipes at this time. Lastly, I added some sorting code for SD card recipes so they will be displayed in alphabetical order instead of the order they were added to the tablet.

Describe alternatives you've considered

Due to the fact that recipes are stored in a comma separated string (SD card recipes) and in multiple string vectors (ebook recipes) I am concerned lag might become a problem. This will probably not be an issue unless the number of recipes gets extremely high (several thousand) but is worth keeping an eye on for potential problems.

Testing

  1. Spawn one or more e-ink tablets (and batteries).
  2. Spawn several SD cards.
  3. Spawn any book containing recipes.
  4. Scan the book into the tablet and examine the tablet afterwards.
  5. Scan SD cards until you download a recipe and examine the tablet afterwards.

Additional context

Example of a full e-ink tablet description containing 5 books and a few SD recipes:
eink-display1

eink-display2

@actual-nh actual-nh added <Enhancement / Feature> New features, or enhancements on existing [C++] Changes (can be) made in C++. Previously named `Code` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Info / User Interface Game - player communication, menus, etc. Items / Item Actions / Item Qualities Items and how they work and interact labels Aug 27, 2021
@dseguin
Copy link
Member

dseguin commented Aug 28, 2021

Just tested this PR. It's a cool feature!
e-ink_book

@actual-nh
Copy link
Contributor

Suggestion for a later E-ink tablet (or camera?) PR: Copying maps, such as from the card(s) in #51155.

src/item.cpp Outdated Show resolved Hide resolved
src/item.cpp Outdated Show resolved Hide resolved
Hymore246 and others added 2 commits August 28, 2021 11:03
Co-authored-by: Anton Burmistrov <Night_Pryanik@mail.ru>
Co-authored-by: Anton Burmistrov <Night_Pryanik@mail.ru>
@Entity-y
Copy link
Contributor

Would there be a way to move recipes and books from a tablet back onto an SD card to move data between devices like another tablet, laptop, or smartphone?

Perhaps this feature could be expanded to add new actions to the device, contained on SD cards as mentioned in #51064

@Hymore246
Copy link
Contributor Author

Would there be a way to move recipes and books from a tablet back onto an SD card to move data between devices like another tablet, laptop, or smartphone?

Perhaps this feature could be expanded to add new actions to the device, contained on SD cards as mentioned in #51064

Not at this time. It would take a fair amount of work to allow the transfer and SD card's code would need a bunch of updates to allow it to receive recipes. Smart applications are a whole other story since those would need to be designed and added individually.

@kevingranade kevingranade merged commit 316dc82 into CleverRaven:master Sep 11, 2021
Venera3 pushed a commit to Venera3/Cataclysm-DDA that referenced this pull request Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling <Enhancement / Feature> New features, or enhancements on existing Info / User Interface Game - player communication, menus, etc. Items / Item Actions / Item Qualities Items and how they work and interact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants