Skip to content

Commit

Permalink
Dynamic Radial Menus (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinary1 authored Jun 14, 2024
1 parent 700b548 commit 7dd0e47
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Content.Client/UserInterface/Controls/RadialContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,24 @@ public RadialContainer()
{

}

private void UpdateRadius()
{
const float baseRadius = 100f;
const float radiusIncrement = 5f;

var children = ReserveSpaceForHiddenChildren ? Children : Children.Where(x => x.Visible);
var childCount = children.Count();


Radius = baseRadius + (childCount * radiusIncrement);
}


protected override void Draw(DrawingHandleScreen handle)
{
UpdateRadius();

var children = ReserveSpaceForHiddenChildren ? Children : Children.Where(x => x.Visible);
var childCount = children.Count();

Expand Down

0 comments on commit 7dd0e47

Please sign in to comment.