From 174ce76e857e01e2028a6d3969881782d4fb46c0 Mon Sep 17 00:00:00 2001 From: Sapphire <98045970+sapphirescript@users.noreply.github.com> Date: Wed, 1 Jan 2025 18:16:49 -0600 Subject: [PATCH] Cherry Pick "Dynamic Radial Menus (#29678)" (#1393) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Cherry picks https://github.com/space-wizards/space-station-14/pull/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 ◕‿◕) ---

Media

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

--- # Changelog :cl: - fix: Fixed radial menus overlapping where there's many icons. Co-authored-by: Rinary <72972221+Rinary1@users.noreply.github.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: sleepyyapril <123355664+sleepyyapril@users.noreply.github.com> --- Content.Client/UserInterface/Controls/RadialContainer.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Content.Client/UserInterface/Controls/RadialContainer.cs b/Content.Client/UserInterface/Controls/RadialContainer.cs index be263d12772..be9b8817a06 100644 --- a/Content.Client/UserInterface/Controls/RadialContainer.cs +++ b/Content.Client/UserInterface/Controls/RadialContainer.cs @@ -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;