MovingBlocks / DestinationSol

Official continuation of Destination Sol, the great fun little arcade space shooter from http://sourceforge.net/projects/destinationsol/ Modules live at https://github.com/DestinationSol/
Apache License 2.0
330 stars 122 forks source link

New NUI widgets (`EmptyIfInvisibleContainer`, `UIBackingBox` and `UILabelledIcon`) #664

Closed BenjaminAmos closed 2 years ago

BenjaminAmos commented 2 years ago

Description

This pull request adds some now NUI widgets that will be used in when porting the remaining built-in UI screens to use NUI. It also makes some minor changes to the default UILoadBar style, which was unnecesarily constraining the size of load bars.

EmptyIfInvisibleContainer

This widget acts like a standard wrapper container, with the special case that if either its contents is empty or invisible, then it will report its own size as zero.

UIBackingBox

This widget acts like a standard UIBox, with the added functionality of consuming all mouse click events targeted within its area. This prevents mouse click events from propagating to layers beneath the box.

UILabelledIcon

This widget allows the user to display an icon alongside a descriptive label, such as might be used in a HUD to display brief player statistics, The icon can be placed either to the left or the right of the label.

Testing

UIBackingBox

UILabelledIcon

Notes