]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix layout on wires UI (#33714)
authorPieter-Jan Briers <pieterjan.briers+git@gmail.com>
Wed, 4 Dec 2024 10:13:22 +0000 (11:13 +0100)
committerGitHub <noreply@github.com>
Wed, 4 Dec 2024 10:13:22 +0000 (21:13 +1100)
Layout would break for machines with >6 lights because the column count was hardcoded. Uncap the UI width and fix the rows count instead.

Lights with less than 4 characters of text weren't aligned right, now they are.

Content.Client/Wires/UI/WiresMenu.cs

index 77fc3accceb34ae9f46a4007ace674e177818caa..01c88bcd0c6ae2c1c0744ef17030c3e599cc7d61 100644 (file)
@@ -206,8 +206,7 @@ namespace Content.Client.Wires.UI
                             (_statusContainer = new GridContainer
                             {
                                 Margin = new Thickness(8, 4),
-                                // TODO: automatically change columns count.
-                                Columns = 3
+                                Rows = 2
                             })
                         }
                     }
@@ -227,7 +226,8 @@ namespace Content.Client.Wires.UI
                 PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")}
             });
             CloseButton.OnPressed += _ => Close();
-            SetSize = new Vector2(320, 200);
+            SetHeight = 200;
+            MinWidth = 320;
         }
 
 
@@ -503,6 +503,8 @@ namespace Content.Client.Wires.UI
 
             public StatusLight(StatusLightData data, IResourceCache resourceCache)
             {
+                HorizontalAlignment = HAlignment.Right;
+
                 var hsv = Color.ToHsv(data.Color);
                 hsv.Z /= 2;
                 var dimColor = Color.FromHsv(hsv);