RobustToolbox
RobustToolbox copied to clipboard
Add support for overlays to draw controls
Nice feature to have, e.g. for richtext support for something like space-wizards/space-station-14/pull/28705
Overview of changes:
- Added
IUserInterfaceManager.RenderControl()for manually drawing controls.- This is basically just exposing the
IUserInterfaceManagerInternalfunctions. - Instead of having a bunch of optional arguments, I chose to use the existing public
ControlRenderArgumentsstruct, under the assumption that it is not meant to be internal/obsoleted/removed.
- This is basically just exposing the
- The
OverlayDrawArgsstruct now provides anIRenderHandleand has an internal constructor.- This is currently required for control rendering. However, I could instead have changed control rendering to take in a screen handle instead.
- I don't really understand the need for the separation of the screen/world handle, and I'd rather just allow people to use IRenderHandle which provides both, even if it is currently an unstable API that is subject to change.
- The
IClydeViewportoverlay rendering methods now take in anIRenderHandleinstead of a world/screen handle. Required for the viewports to draw overlays with the newOverlayDrawArgs.- Requires space-wizards/space-station-14/pull/28786
- Controls can now be manually restyled via
Control.InvalidateStyleSheet()andControl.DoStyleUpdate()InvalidateStyleSheet()is just the old internalStyleSheetUpdate()method, but was renamed for consistency with the measure & arrange invalidation methods.