Page 1 of 1

About writing nil, explicitly, in "opened"

Posted: Wed Feb 07, 2024 12:35 am
by Honktown
player.opened = nil is how to close a gui, but I believe it's not present, or at least, stated well, in the description of opened:
https://lua-api.factorio.com/1.1.102/cl ... tml#opened

"If this attribute is not nil, and a new GUI is written to it, the existing one will be asked to close." - Describing behavior when writing a new gui

"Write supports any of the types" - At best, is writing nil hidden away in the '?' optional of: 'LuaEntity or LuaItemStack or LuaEquipment or LuaEquipmentGrid or LuaPlayer or LuaGuiElement or LuaInventory or LuaTechnology or defines.gui_type?'

A single line of e.g. "Writing nil when opened is non-nil will issue a request to close." is very opaque about how you close a gui.

Re: About writing nil, explicitly, in "opened"

Posted: Sun May 05, 2024 8:42 am
by Bilka
Thanks for the note, I added an explicit mention of writing nil to the "If the attribute is non-nil..." sentence for the next doc release.