About writing nil, explicitly, in "opened"
Posted: Wed Feb 07, 2024 12:35 am
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.
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.