I am modifying the signals for a constant combinator whose GUI is open and that GUI does not show the changes until it's closed and re-opened. I'd like to be able to tell it to refresh.
PS: the alt mode render in the world already refreshes on its own, and so does the mini render in the GUI that shows the entity. The only thing that doesn't update is the rest of the GUI.
Refresh the GUI for an entity
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Refresh the GUI for an entity
Can you "opened=nil; opened=combinator" force re-open it? Resets the gui position though.
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.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Refresh the GUI for an entity
No. That seemingly has no effect. I'm guessing because .opened only applies at the end of the tick processing. What does "work" is doing .opened=nil then waiting for the next tick (which is far more complicated than it should be, new request incoming) to do .opened=combinator. This achieves the goal, but also re-opens my mod's GUI (because _closed and _opened get fired for the thing I just closed and opened, which I guess I could filter for if I'm mid-reopen), and plays the GUI close/open sounds which is annoying.
Re: Refresh the GUI for an entity
I've fixed it so setting a signals through the lua API will refresh the set signal (set_signal()) for the next release.
If you want to get ahold of me I'm almost always on Discord.