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

Bugs that are actually features.
Post Reply
User avatar
theRustyKnife
Filter Inserter
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

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13928
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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.
If you want to get ahold of me I'm almost always on Discord.

User avatar
theRustyKnife
Filter Inserter
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

Post 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.

Post Reply

Return to “Not a bug”