Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gui events not working #160

Open
white-cold opened this issue Dec 15, 2022 · 1 comment
Open

Gui events not working #160

white-cold opened this issue Dec 15, 2022 · 1 comment
Labels

Comments

@white-cold
Copy link

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.

@white-cold white-cold added the bug label Dec 15, 2022
@Nexela
Copy link
Collaborator

Nexela commented Dec 15, 2022

Gui. uses patterns. Does the following work?

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants