Skip to content

Commit

Permalink
Dynamic Radial Menus (#29678)
Browse files Browse the repository at this point in the history
* fix

* Clean Some Code

* Some Commentaries

* Update Content.Client/UserInterface/Controls/RadialContainer.cs

* Update Content.Client/UserInterface/Controls/RadialContainer.cs

---------

Co-authored-by: metalgearsloth <[email protected]>
  • Loading branch information
2 people authored and sapphirescript committed Jan 1, 2025
1 parent 6e6caf8 commit 92457c3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Content.Client/UserInterface/Controls/RadialContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,18 @@ public RadialContainer()
{

}

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;
Expand Down

0 comments on commit 92457c3

Please sign in to comment.