About writing nil, explicitly, in "opened"

Honktown
Smart Inserter
Smart Inserter
Posts: 1042
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
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

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

Post 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.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Resolved Requests”