From efac8d02876f1aecec948ae1dc94cf78aea5ed9c Mon Sep 17 00:00:00 2001 From: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Date: Fri, 19 Dec 2025 04:31:12 -0600 Subject: [PATCH] Sort Accesses and Jukebox UIs (#4998) * Sorted the ID card computer's buttons. * Sorted the Jukebox song list * Sorted the jukebox entries. * Sorted access config. * Forgot a comment. * Changed collection expression * Also updated Door electronics bound interface. * Used the existing method now that I can lol --- .../Access/UI/AccessOverriderBoundUserInterface.cs | 5 +++-- Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs | 4 +++- Content.Client/Audio/Jukebox/JukeboxMenu.xaml.cs | 3 ++- .../Doors/Electronics/DoorElectronicsBoundUserInterface.cs | 5 ++++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Content.Client/Access/UI/AccessOverriderBoundUserInterface.cs b/Content.Client/Access/UI/AccessOverriderBoundUserInterface.cs index d80c600c03..234341f2c4 100644 --- a/Content.Client/Access/UI/AccessOverriderBoundUserInterface.cs +++ b/Content.Client/Access/UI/AccessOverriderBoundUserInterface.cs @@ -1,3 +1,4 @@ +using System.Linq; // DeltaV using Content.Shared.Access; using Content.Shared.Access.Components; using Content.Shared.Access.Systems; @@ -50,8 +51,8 @@ namespace Content.Client.Access.UI if (EntMan.TryGetComponent(Owner, out var accessOverrider)) { - accessLevels = accessOverrider.AccessLevels; - accessLevels.Sort(); + // DeltaV - Sort Better + accessLevels = accessOverrider.AccessLevels.OrderBy(x => _prototypeManager.TryIndex(x.Id, out var access) ? access.GetAccessLevelName() : x.Id).ToList(); } else { diff --git a/Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs b/Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs index a53c1369fe..f93541e0e5 100644 --- a/Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs +++ b/Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs @@ -1,3 +1,4 @@ +using System.Linq; // DeltaV using Content.Shared.Access; using Content.Shared.Access.Components; using Content.Shared.Access.Systems; @@ -37,7 +38,8 @@ namespace Content.Client.Access.UI if (EntMan.TryGetComponent(Owner, out var idCard)) { - accessLevels = idCard.AccessLevels; + // DeltaV - Sort the access list + accessLevels = idCard.AccessLevels.OrderBy(x => _prototypeManager.TryIndex(x.Id, out var access) ? access.GetAccessLevelName() : x.Id).ToList(); } else { diff --git a/Content.Client/Audio/Jukebox/JukeboxMenu.xaml.cs b/Content.Client/Audio/Jukebox/JukeboxMenu.xaml.cs index e0904eece8..c16c3065ad 100644 --- a/Content.Client/Audio/Jukebox/JukeboxMenu.xaml.cs +++ b/Content.Client/Audio/Jukebox/JukeboxMenu.xaml.cs @@ -1,3 +1,4 @@ +using System.Linq; // DeltaV using Content.Shared.Audio.Jukebox; using Robust.Client.Audio; using Robust.Client.AutoGenerated; @@ -88,7 +89,7 @@ public sealed partial class JukeboxMenu : FancyWindow { MusicList.Clear(); - foreach (var entry in jukeboxProtos) + foreach (var entry in jukeboxProtos.OrderBy(x => x.Name)) // DeltaV - Sort the jukebox list { MusicList.AddItem(entry.Name, metadata: entry.ID); } diff --git a/Content.Client/Doors/Electronics/DoorElectronicsBoundUserInterface.cs b/Content.Client/Doors/Electronics/DoorElectronicsBoundUserInterface.cs index 9b7e23c03a..e1168539f4 100644 --- a/Content.Client/Doors/Electronics/DoorElectronicsBoundUserInterface.cs +++ b/Content.Client/Doors/Electronics/DoorElectronicsBoundUserInterface.cs @@ -1,3 +1,4 @@ +using System.Linq; // DeltaV using Content.Shared.Access; using Content.Shared.Doors.Electronics; using Robust.Client.GameObjects; @@ -46,7 +47,9 @@ public sealed class DoorElectronicsBoundUserInterface : BoundUserInterface } } - accessLevels.Sort(); + // DeltaV - Sort Better + accessLevels = accessLevels.OrderBy(x => _prototypeManager.TryIndex(x.Id, out var access) ? access.GetAccessLevelName() : x.Id).ToList(); + _window?.Reset(_prototypeManager, accessLevels); }