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.
on_mod_item_opened - add clicked LuaItemStack to event?
-
- Fast Inserter
- Posts: 128
- Joined: Thu Feb 08, 2018 8:25 am
- Contact:
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: on_mod_item_opened - add clicked LuaItemStack to event?
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.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
-
- Fast Inserter
- Posts: 128
- Joined: Thu Feb 08, 2018 8:25 am
- Contact:
Re: on_mod_item_opened - add clicked LuaItemStack to event?
Unfortunately, seems to be nil.eradicator wrote:What value does player.opened have during the event? It should point at the ItemStack according to API doc.