Close current player.gui.center windows on escape.

Things that already exist in the current mod API
Post Reply
DRE
Inserter
Inserter
Posts: 41
Joined: Sun Jan 25, 2015 2:30 pm
Contact:

Close current player.gui.center windows on escape.

Post by DRE »

When player presses escape - current central window is automatically closed, next escape press - pause menu.
I wish it could be a thing for custom frames.

It can be property like 'close_on_menu_toggle' on LuaGuiElement for type = 'frame'. :roll:

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Close current player.gui.center windows on escape.

Post by Klonan »

You can do this by using player.opened, and listening for the on_gui_closed event

DRE
Inserter
Inserter
Posts: 41
Joined: Sun Jan 25, 2015 2:30 pm
Contact:

Re: Close current player.gui.center windows on escape.

Post by DRE »

Thanks! :D I should have posted this in another section.

Post Reply

Return to “Already exists”