Skip to content

Commit

Permalink
Cherry Pick "Dynamic Radial Menus (#29678)" (#1393)
Browse files Browse the repository at this point in the history
# Description

Cherry picks
space-wizards/space-station-14#29678
Needed for emotes to not be packed tightly together, 
also need this for a future PR where I will be fixing emotes in general
◕‿◕)

---

<details><summary><h1>Media</h1></summary>
<p>


![image](https://github.com/user-attachments/assets/bc58aee6-f615-4f6d-ad9a-793c482f3da6)

</p>
</details>

---

# Changelog
:cl:
- fix: Fixed radial menus overlapping where there's many icons.

Co-authored-by: Rinary <[email protected]>
Co-authored-by: metalgearsloth <[email protected]>
Co-authored-by: sleepyyapril <[email protected]>
  • Loading branch information
4 people authored Jan 2, 2025
1 parent 4a07f33 commit 174ce76
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 174ce76

Please sign in to comment.