Dynamic Radial Menus (#29678)
* fix * Clean Some Code * Some Commentaries * Update Content.Client/UserInterface/Controls/RadialContainer.cs * Update Content.Client/UserInterface/Controls/RadialContainer.cs --------- Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -67,11 +67,18 @@ public class RadialContainer : LayoutContainer
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected override void Draw(DrawingHandleScreen handle)
|
||||
{
|
||||
|
||||
const float baseRadius = 100f;
|
||||
const float radiusIncrement = 5f;
|
||||
|
||||
var children = ReserveSpaceForHiddenChildren ? Children : Children.Where(x => x.Visible);
|
||||
var childCount = children.Count();
|
||||
|
||||
// Add padding from the center at higher child counts so they don't overlap.
|
||||
Radius = baseRadius + (childCount * radiusIncrement);
|
||||
|
||||
// Determine the size of the arc, accounting for clockwise and anti-clockwise arrangements
|
||||
var arc = AngularRange.Y - AngularRange.X;
|
||||
|
||||
Reference in New Issue
Block a user