have on_mod_item_opened return the itemstack as well

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
Quezler
Filter Inserter
Filter Inserter
Posts: 269
Joined: Fri Mar 25, 2016 6:37 pm
Contact:

have on_mod_item_opened return the itemstack as well

Post by Quezler »

I am running into an issue where a player can have several selection tools with a label inside their inventory, and i cannot tell which one the player tried to open.

I wish to store configuration data related to the item inside of it by mapping the number all items with label support and their descendants can have to somewhere in my global table, but regardless of that implementation there is currently simply just no way to tell which specific item the player opened.
Rseding91
Factorio Staff
Factorio Staff
Posts: 16124
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: have on_mod_item_opened return the itemstack as well

Post by Rseding91 »

There may not be an item if it was opened through the quickbar. So while it might be possible to add in the not-quickbar case, the quickbar case will still not work.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Quezler
Filter Inserter
Filter Inserter
Posts: 269
Joined: Fri Mar 25, 2016 6:37 pm
Contact:

Re: have on_mod_item_opened return the itemstack as well

Post by Quezler »

Hmm i see, since selection tools extend labels it might still have the item number right? if the mod stored that beforehand it might be able to resolve which entry in the mod's storage table it refers to, so if i assume right the event could always have the item number and optionally the stack?
User avatar
Osmo
Fast Inserter
Fast Inserter
Posts: 155
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

Re: have on_mod_item_opened return the itemstack as well

Post by Osmo »

Even without the quickbar case it would still be useful to some mods, such as https://mods.factorio.com/mod/disk
User avatar
Osmo
Fast Inserter
Fast Inserter
Posts: 155
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

Re: have on_mod_item_opened return the itemstack as well

Post by Osmo »

Also, at least for item-with-tags the quickbar seems to bind to specific items, so it could work in the quickbar for some items as well
Post Reply

Return to “Modding interface requests”