on_mod_item_opened - add clicked LuaItemStack to event?

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
shanemadden
Fast Inserter
Fast Inserter
Posts: 128
Joined: Thu Feb 08, 2018 8:25 am
Contact:

on_mod_item_opened - add clicked LuaItemStack to event?

Post by shanemadden »

Currently in on_mod_item_opened, the event handler only exposes which item prototype got the click, but there isn't any way to determine which individual item in the inventory the player clicked on.

Would it be possible to include the LuaItemStack that was right-clicked to trigger the event in addition to the LuaItemPrototype that's currently passed with the event? I'd like to have different "instances" of an item (currently identified by their .item_number) in a player's inventory have their own distinct configuration, but I'm not able to determine which stack was clicked during this event.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: on_mod_item_opened - add clicked LuaItemStack to event?

Post by eradicator »

What value does player.opened have during the event? It should point at the ItemStack according to API doc.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
shanemadden
Fast Inserter
Fast Inserter
Posts: 128
Joined: Thu Feb 08, 2018 8:25 am
Contact:

Re: on_mod_item_opened - add clicked LuaItemStack to event?

Post by shanemadden »

eradicator wrote:What value does player.opened have during the event? It should point at the ItemStack according to API doc.
Unfortunately, seems to be nil.
Post Reply

Return to “Modding interface requests”