Prototype/ItemWithInventory: Difference between revisions
(Set prototype parent) |
(Converted to SMW format) |
||
Line 1: | Line 1: | ||
{{Prototype parent|Prototype/ItemWithLabel}} | {{Prototype parent|Prototype/ItemWithLabel}} | ||
The inventory allows setting player defined filters similar to the quickbar and cargo wagon inventories. | |||
{{Prototype TOC|item-with-inventory}} | |||
Prototype | |||
== Extensions == | == Extensions == | ||
Line 12: | Line 10: | ||
This prototype inherits all the properties from [[Prototype/ItemWithLabel]]. | This prototype inherits all the properties from [[Prototype/ItemWithLabel]]. | ||
{{Prototype property|inventory_size|[[Types/ItemStackIndex|ItemStackIndex]]}} | |||
The inventory size of the item. | The inventory size of the item. | ||
== Optional properties == | == Optional properties == | ||
{{Prototype property|item_filters|[[Types/table|table]] of [[Types/string|string]]|optional=true}} | |||
A list of explicit item names to be used as filters. | A list of explicit item names to be used as filters. | ||
item_filters = {"iron-ore", "copper-ore", "coal", "stone"} | item_filters = {"iron-ore", "copper-ore", "coal", "stone"} | ||
{{Prototype property|item_group_filters|[[Types/table|table]] of [[Types/string|string]]|optional=true}} | |||
A list of explicit item group names to be used as filters. | A list of explicit item group names to be used as filters. | ||
item_group_filters = {"storage", "belt"} | item_group_filters = {"storage", "belt"} | ||
{{Prototype property|item_subgroup_filters|[[Types/table|table]] of [[Types/string|string]]|optional=true}} | |||
A list of explicit item subgroup names to be used as filters. | A list of explicit item subgroup names to be used as filters. | ||
item_subgroup_filters = {"capsule", "tool"} | item_subgroup_filters = {"capsule", "tool"} | ||
{{Prototype property|filter_mode|[[Types/string|string]]|"whitelist"|optional=true}} | |||
This determines how filters are applied. If no filters are defined this is automatically set to "none". | This determines how filters are applied. If no filters are defined this is automatically set to "none". | ||
filter_mode = "blacklist" -- or "whitelist" if you want whitelisting | filter_mode = "blacklist" -- or "whitelist" if you want whitelisting | ||
{{Prototype property|filter_message_key |[[Types/string|string]]|"item-limitation.item-not-allowed-in-this-container-item"|optional=true}} | |||
The locale key used when the player attempts to put an item that doesn't match the filter rules into the item-with-inventory. | The locale key used when the player attempts to put an item that doesn't match the filter rules into the item-with-inventory. | ||
{{Prototype property|extends_inventory_by_default|[[Types/bool|bool]]|false|optional=true}} | |||
When true, this item-with-inventory will extend the inventory it sits in by default. This is a runtime property on the result item that can be changed through the Lua interface and only determines the initial value. | When true, this item-with-inventory will extend the inventory it sits in by default. This is a runtime property on the result item that can be changed through the Lua interface and only determines the initial value. | ||
{{Prototype property|insertion_priority_mode|[[Types/string|string]]|"default"|optional=true}} | |||
The insertion priority mode for this item. This determines if items are first attempted to be put into this items inventory if the item extends the inventory it sits in when items are put into the parent inventory. | The insertion priority mode for this item. This determines if items are first attempted to be put into this items inventory if the item extends the inventory it sits in when items are put into the parent inventory. | ||
insertion_priority_mode = "never" | insertion_priority_mode = "never" |
Revision as of 15:12, 26 July 2019
Template:Prototype parent The inventory allows setting player defined filters similar to the quickbar and cargo wagon inventories.
Extensions
- Prototype/BlueprintBook blueprint-book
Mandatory properties
This prototype inherits all the properties from Prototype/ItemWithLabel.
Template:Prototype property The inventory size of the item.
Optional properties
Template:Prototype property A list of explicit item names to be used as filters.
item_filters = {"iron-ore", "copper-ore", "coal", "stone"}
Template:Prototype property A list of explicit item group names to be used as filters.
item_group_filters = {"storage", "belt"}
Template:Prototype property A list of explicit item subgroup names to be used as filters.
item_subgroup_filters = {"capsule", "tool"}
Template:Prototype property This determines how filters are applied. If no filters are defined this is automatically set to "none".
filter_mode = "blacklist" -- or "whitelist" if you want whitelisting
Template:Prototype property The locale key used when the player attempts to put an item that doesn't match the filter rules into the item-with-inventory.
Template:Prototype property When true, this item-with-inventory will extend the inventory it sits in by default. This is a runtime property on the result item that can be changed through the Lua interface and only determines the initial value.
Template:Prototype property The insertion priority mode for this item. This determines if items are first attempted to be put into this items inventory if the item extends the inventory it sits in when items are put into the parent inventory.
insertion_priority_mode = "never"
Possible values are:
Flag | meaning |
---|---|
default | Items are inserted into this item-with-inventory only if they match the whitelist defined in the prototype for the item and whitelist is used. |
never | Items are never inserted into this item-with-inventory except explicitly by the player or script |
always | All items first try to be inserted into this item-with-inventory |
when_manually_filtered | When the inventory contains filters that match the item-to-be-inserted then try to put it into this item before the inventory this item resides in |
Differing defaults
stackable
Defaults to false
, can't be changed.
stack_size
Must be 1.