on_player_opened_changed

Post Reply
User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 711
Joined: Sun Nov 23, 2014 11:57 am
Contact:

on_player_opened_changed

Post by Earendel »

Being able to change the opened state for a player is a big step forwards.

What would be great is if there was an event fired when the player opened state changes, either by opening or closing an interface.

Not only would this be useful in a number or normal situations, but it would also finally allow people to set up their own on-click GUI for custom entities by detecting the entity being opened and then immediately closing the entity in order to show their custom GUI.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13219
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: on_player_opened_changed

Post by Rseding91 »

I've added on_gui_opened and on_gui_closed events for 0.16. The closed event has a few special cases to it in that it won't fire if the thing opened is closed as a result of it being destroyed - it's only fired when the player or mod explicitly closes the GUI.
If you want to get ahold of me I'm almost always on Discord.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: on_player_opened_changed

Post by eradicator »

One tick handler less. Awesome :mrgreen:
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Implemented mod requests”