Page 1 of 1

Access builtin gui, entity_gui_opened event, extend entity settings

Posted: Thu Jul 21, 2016 2:01 pm
by APXEOLOG
Hi, i really would like to have an access to the builtin gui and also track the event when player opens it. Also i would like to have the ability to add additional entity settings that will be copied via Copy Settings or stored inside the blueprint and restored when built by construction robots.

Use case:
Player opens the inserter configuration gui
Script receive event entity_gui_opened(LuaEntity target, LuaPlayer player, LuaGuiElement windowRoot)
Script adds custom child gui: configuration button (right before those "logistic" and "circuit" buttons) and all custom gui logic
Player configures the custom inserter logic, (for example: entity.settings.A = 1)
Player close the gui in normal way (all custom gui elements closed too because we've closed the root)
Player build new inserter and copy settings from the configured one
The new inserter have the entity.settings.A == 1 now
Same for the blueprint

I don't have the expirience with this mod api but i've looked through the docs and didn't find any information about custom entity settings, only settings_copy events