Page 1 of 1

[0.17.4] LuaPlayer.opened_self is true when closing an item's inventory

Posted: Sun Mar 03, 2019 9:37 am
by theRustyKnife
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

Posted: Wed Mar 06, 2019 12:58 pm
by Rseding91
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.

Re: [0.17.4] LuaPlayer.opened_self is true when closing an item's inventory

Posted: Wed Mar 06, 2019 7:56 pm
by theRustyKnife
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.