mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
* Add VisibilityChanged virtual to Control * Defer updating invisible OutputPanels on UIScale change DebugConsole falls under this when not hidden, and it significantly improves perf of e.g. resizing the window when there's a lot of stuff in there. * Avoid redundant UI Scale updates on window resize. Window resizing can change the UI scale, due to the auto-scaling system. This system had multiple perf issues: UI scale was set and propagated even if it didn't change (system disabled, not effective, etc). This was just wasted processing. UI scale was updated for every window resize event. When the game is lagging (due to the aforementioned UI scale updates being expensive...) this means multiple window resize events in a single frame ALL cause a UI scale update, which is useless. UI scale updates from resizing now avoid doing *nothing* and are deferred until later in the frame for natural batching. * Reduce allocations/memory usage of various rich-text related things Just allocate a buncha dictionaries what could possibly go wrong. I kept to non-breaking-changes which means this couldn't as effective as it should be. There's some truly repulsive stuff here. Ugh. * Cap debug console content size. It's a CVar. OutputPanel has been switched to use a new RingBufferList datastructure to make removal of the oldest entry efficient. --------- Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>