What is the best way to structure my derma code to respond to changes in game state outside of the panel itself?
For example, I have created a derma panel inside of a function, meaning the panel is local to that function and inaccessible outside of that scope. I need to alter text on that panel when the game state changes, ie. I need to call text:SetText again in order to change text content.
My problem is that I can’t simply re-draw the panel in the same way that I would use HUDPaint as that would create a new instance each frame and cause many panels to be displayed. I also can’t see a way to re-open a panel once I have called Close() on it meaning my current solution of declaring the panel once globally outside of any functions doesn’t work either.
This is probably a simpler question than how I have worded it, I just need someone to look at what I’m saying and point me at an example of what I need.
Thanks so much,