Hi,
I have a rather long running / command that raises some click events (script.raise_event).
These events cause some UI elements to be drawn, created, closed, ...
As everything happens in one command/function it looks like there is no UI update until the very end.
I would like to see the steps in between though (simply to make it visually followable).
Question: Is there a way to trigger a redraw of the UI via script?
I couldn't find an event to raise or a way to let the script run "asynchronous".
Or is this actually the case already and I'm just to slow/the runtime is not long enough yet?
Thanks
P.S. my search foo returned nothing the like, if this question has been answered already then I'm sorry
Trigger UI redrawing?!
-
- Burner Inserter
- Posts: 15
- Joined: Thu Sep 21, 2017 9:28 am
- Contact:
Re: Trigger UI redrawing?!
I think the UI only draws once per tick. So you will have to break up your command into multiple function calls, probably using script.on_nth_tick() to coordinate them.
-
- Burner Inserter
- Posts: 15
- Joined: Thu Sep 21, 2017 9:28 am
- Contact:
Re: Trigger UI redrawing?!
Okay, thanks.
I was afraid this was the answer
Off to creating a scheduler and some locking logic then
I was afraid this was the answer
Off to creating a scheduler and some locking logic then
Re: Trigger UI redrawing?!
I believe, if you add a `player.show_message_dialog()` function between each addition of the GUI, you will be able to see it being built 1 piece at a time
-
- Burner Inserter
- Posts: 15
- Joined: Thu Sep 21, 2017 9:28 am
- Contact:
Re: Trigger UI redrawing?!
Awesome, thanks
I'll try that out.
I'll try that out.
-
- Burner Inserter
- Posts: 15
- Joined: Thu Sep 21, 2017 9:28 am
- Contact:
Re: Trigger UI redrawing?!
Follow up question.
If I use the dialog it actually blocks UI rendering. Is there a way to programmatically close it again?
Because otherwise the user has to manually proceed for every step.
Or am I missing something?
If I use the dialog it actually blocks UI rendering. Is there a way to programmatically close it again?
Because otherwise the user has to manually proceed for every step.
Or am I missing something?
Re: Trigger UI redrawing?!
I thought you would use it for visual debugging onlyJasonMiles wrote: ↑Mon Nov 19, 2018 7:12 pmFollow up question.
If I use the dialog it actually blocks UI rendering. Is there a way to programmatically close it again?
Because otherwise the user has to manually proceed for every step.
Or am I missing something?
What is the exact problem you are having with the GUI?