Page 1 of 1

on_mod_item_opened - add clicked LuaItemStack to event?

Posted: Thu Jul 12, 2018 2:16 am
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.

Re: on_mod_item_opened - add clicked LuaItemStack to event?

Posted: Thu Jul 12, 2018 5:38 am
by eradicator
What value does player.opened have during the event? It should point at the ItemStack according to API doc.

Re: on_mod_item_opened - add clicked LuaItemStack to event?

Posted: Thu Jul 12, 2018 6:26 am
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.