So I update the widget while the widget component’s visibility is off (inventory widget in this case). You can see towards the end in the gif, the item gets removed from the inventory while the widget component is not visible.
But when I toggle the visibility back on, it shows the widget as it was before it was updated, for a frame or 2, before it switches to the updated look. It’s noticeable.
Is there anything that can be done to prevent this? Thanks.
You’ll likely want to implement some manager / caching / buffer functionality that keeps track of all changes that have been that would update the widget in some visual way (when the widget is invisible); then when opening the widget → perform those updates first → if all cached operations have been completed and the widget is fully updated → make the widget visible.
Alternatively (or in combination with the above) make the widget instantly visible, but implement some kind of loading widget for each tile of which you know it needs to show an image, and swap it out with the actual content.
A simpler, but naive and less efficient approach would be to mark the widget component to Tick when Offscreen or hide the widget after a frame or 2 delay (to allow it to update before making it invisible)