mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
Select current target in mailing unit UI, prevent UI jumping (#37098)
This commit is contained in:
parent
2699c3f41e
commit
9a7b68de55
1 changed files with 6 additions and 5 deletions
|
|
@ -4,6 +4,7 @@ using Content.Shared.Disposal;
|
|||
using Content.Shared.Disposal.Components;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using System.Linq;
|
||||
|
||||
namespace Content.Client.Disposal.Mailing;
|
||||
|
||||
|
|
@ -70,10 +71,10 @@ public sealed class MailingUnitBoundUserInterface : BoundUserInterface
|
|||
//UnitTag.Text = state.Tag;
|
||||
MailingUnitWindow.Target.Text = entity.Comp.Target;
|
||||
|
||||
MailingUnitWindow.TargetListContainer.Clear();
|
||||
foreach (var target in entity.Comp.TargetList)
|
||||
{
|
||||
MailingUnitWindow.TargetListContainer.AddItem(target);
|
||||
}
|
||||
var entries = entity.Comp.TargetList.Select(target => new ItemList.Item(MailingUnitWindow.TargetListContainer) {
|
||||
Text = target,
|
||||
Selected = target == entity.Comp.Target
|
||||
}).ToList();
|
||||
MailingUnitWindow.TargetListContainer.SetItems(entries);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue