Skip to content

Commit

Permalink
Ebooks: fix scanning and crafting menu info (#79354)
Browse files Browse the repository at this point in the history
* Ebooks: fix scanning and crafting menu info

Crafting menu lacks "Written in:" info; Scanning should be allowed with
backlight off.

fixes #79301, fixes #79317

* Update src/inventory.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: Vitaliy Andrianov <o1783783@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 28, 2025
1 parent baf75cf commit bf468b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/json/items/tool/electronics.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
"color": "blue",
"use_action": [
"E_FILE_DEVICE",
"EBOOKSAVE",
{
"type": "transform",
"menu_text": "Turn on the screen",
Expand Down
6 changes: 6 additions & 0 deletions src/inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,12 @@ const itype_bin &inventory::get_binned_items() const
for( const item *it : e->softwares() ) {
binned_items[it->typeId()].push_back( it );
}
// list stored ebooks
if( e->is_estorage() && !e->is_broken_on_active() ) {
for( const item *book : e->get_contents().ebooks() ) {
binned_items[ book->typeId() ].push_back( book );
}
}
return VisitResponse::NEXT;
} );

Expand Down

0 comments on commit bf468b8

Please sign in to comment.