Page 1 of 1

[0.16.45] on_gui_closed event not fired

Posted: Tue May 29, 2018 3:54 am
by osldgoth
To reproduce: Build and open the gui of an assembler(1, 2 or 3), quick replace assembler to another level (3, 1, 2). gui will close but the event on_gui_closed will not be called. I have a mod https://mods.factorio.com/mod/Actual_Craft_Time that relies on this event. I expect either the gui to remain open or the event to be called. This also is true for stone and steel furnaces. As the event is not fired, a gui in my mod doesn't close and causes the game to crash when a new gui tries to be created as both will have the same name. I'll need to add a check if this is to be not fixed.

Re: [0.16.45] on_gui_closed event not fired

Posted: Tue May 29, 2018 5:03 am
by Rseding91
Thanks for the report however this is working correctly. It's even documented on the event: http://lua-api.factorio.com/latest/even ... gui_closed
Note: This is only called if the player explicitly closed the GUI.
This is a limitation of how the game works when it comes to GUIs. The same behavior happens if you kill or call destroy() on the open entity.

Re: [0.16.45] on_gui_closed event not fired

Posted: Tue May 29, 2018 5:42 am
by osldgoth
Very well, I'll make changes to my mod.