I tried to make simple filtered bag
Code: Select all
data:extend
{{
name = 'weapon-bag',
type = 'item-with-inventory',
inventory_size = 10,
icons = Lib.icons('weapon-bag'),
stack_size = 1,
item_subgroup_filters = item_subgroup_filters,
filter_mode = 'whitelist',
extends_inventory_by_default = true,
insertion_priority_mode = 'default'
}}
However there is one issue, if you have item in hotbar, it shows total amount of available items from your inventory and from the bag. When you click the item in hotbar, it takes full stack of the item into cursor, and it prioritizes taking items from the bag. When items are removed from cursor (Q), they return to bag. However, this works only when you have at least one same item in the main inventory. If all the items are in bag only, clicking on them at hotbar does nothing even though it shows you have enough of the items.
I would expect that I can use items from extended inventories, regardless if I have that item *also* in the main inventory, especially when the default behaviour is that all collected items go into the bag first, so main inventory usually will have none of the items.
As a bonus note, taking the items directly from bag still makes reservation on that slot (hand in slot), however when pressing Q, error is thrown that items can't be returned. Then hand disappears and repeated Q press drops the items into the bag (as it collects items first because of the filters)
Video: clicking on hotbar, dropping items back by pressing Q.