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
This commit is contained in:
parent
d187742ea9
commit
efac8d0287
|
|
@ -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<AccessOverriderComponent>(Owner, out var accessOverrider))
|
||||
{
|
||||
accessLevels = accessOverrider.AccessLevels;
|
||||
accessLevels.Sort();
|
||||
// DeltaV - Sort Better
|
||||
accessLevels = accessOverrider.AccessLevels.OrderBy(x => _prototypeManager.TryIndex<AccessLevelPrototype>(x.Id, out var access) ? access.GetAccessLevelName() : x.Id).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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<IdCardConsoleComponent>(Owner, out var idCard))
|
||||
{
|
||||
accessLevels = idCard.AccessLevels;
|
||||
// DeltaV - Sort the access list
|
||||
accessLevels = idCard.AccessLevels.OrderBy(x => _prototypeManager.TryIndex<AccessLevelPrototype>(x.Id, out var access) ? access.GetAccessLevelName() : x.Id).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<AccessLevelPrototype>(x.Id, out var access) ? access.GetAccessLevelName() : x.Id).ToList();
|
||||
|
||||
_window?.Reset(_prototypeManager, accessLevels);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue