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
Fast Inserter
Fast Inserter
Posts: 230
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: 15886
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
Fast Inserter
Fast Inserter
Posts: 230
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?
Post Reply

Return to “Modding interface requests”