Afforess / Factorio-Stdlib

Factorio Standard Library Project
ISC License
162 stars 45 forks source link

Gui events not working #160

Open white-cold opened 1 year ago

white-cold commented 1 year ago

Describe the Bug

The Gui.on_click and similar events do not seem to be functional

To Reproduce

Steps to reproduce the behavior:

--Gui.on_click("ii-close-button", function(e) window.close(e.player_index) end) Event.register(defines.events.on_gui_click, function(e) window.close(e.player_index) end, function(e) return e.element.name == "ii-close-button" end) These two functions are expected to show the same behaviour, calling window.close when the button is clicked, but using the first handler is not working, while manually registering the event works.

Nexela commented 1 year ago

Gui. uses patterns. Does the following work?

Gui.on_click("ii%-close%-button", function(e) window.close(e.player_index) end)