Page 1 of 1

Refresh the GUI for an entity

Posted: Wed Sep 09, 2020 4:47 am
by sparr
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.

Re: Refresh the GUI for an entity

Posted: Wed Sep 09, 2020 12:12 pm
by eradicator
Can you "opened=nil; opened=combinator" force re-open it? Resets the gui position though.

Re: Refresh the GUI for an entity

Posted: Wed Sep 09, 2020 4:13 pm
by sparr
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

Posted: Wed Sep 09, 2020 7:20 pm
by Rseding91
I've fixed it so setting a signals through the lua API will refresh the set signal (set_signal()) for the next release.