About writing nil, explicitly, in "opened"

Place to report issues and suggest improvements to the API documentation.
Post Reply
Honktown
Smart Inserter
Smart Inserter
Posts: 1026
Joined: Thu Oct 03, 2019 7:10 am
Contact:

About writing nil, explicitly, in "opened"

Post 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.
I have mods! I guess!
Link

Post Reply

Return to “Documentation Improvement Requests”