[0.17.4] LuaPlayer.opened_self is true when closing an item's inventory
- theRustyKnife
- Filter Inserter
- Posts: 259
- Joined: Thu Feb 26, 2015 9:26 pm
- Contact:
[0.17.4] LuaPlayer.opened_self is true when closing an item's inventory
If the player closes an item's inventory (upgrade planner, armor, ...) the on_gui_closed event is fired, but the value of opened_self and opened_gui_type for the player are still saying the player has their inventory open. Interestingly, this only happens if the player's inventory was open when they opened the item, for example opening the armor straight from the armor slot doesn't have this issue.
Re: [0.17.4] LuaPlayer.opened_self is true when closing an item's inventory
Thanks for the report - that's working correctly.
When you open your inventory, then open an item-with-inventory or armor it queues the GUI state and on closing the item-with-inventory/armor it goes back to the player inventory.
When you open your inventory, then open an item-with-inventory or armor it queues the GUI state and on closing the item-with-inventory/armor it goes back to the player inventory.
If you want to get ahold of me I'm almost always on Discord.
- theRustyKnife
- Filter Inserter
- Posts: 259
- Joined: Thu Feb 26, 2015 9:26 pm
- Contact:
Re: [0.17.4] LuaPlayer.opened_self is true when closing an item's inventory
I'm not sure what you mean? If I close an item's inventory (using either e or escape), the inventory just closes completely, yet in the event handler, the player object still says that the player has their inventory open, which is just not true.
This definitely doesn't seem like a not-a-bug.
Edit: Ok, I think I found the issue. If I open an item, then open another item and then press e/escape, it goes back to the player inventory. So this seems to be an issue of the inventory closing when it shouldn't, rather than the properties of LuaPlayer being wrong. At least if what you described is the intended behavior.
Edit 2: Made a separate report for that issue here.
This definitely doesn't seem like a not-a-bug.
Edit: Ok, I think I found the issue. If I open an item, then open another item and then press e/escape, it goes back to the player inventory. So this seems to be an issue of the inventory closing when it shouldn't, rather than the properties of LuaPlayer being wrong. At least if what you described is the intended behavior.
Edit 2: Made a separate report for that issue here.