34 lines
887 B
C#
34 lines
887 B
C#
|
|
using Robust.Client.AutoGenerated;
|
|||
|
|
using Robust.Client.UserInterface.Controls;
|
|||
|
|
using Robust.Client.UserInterface.CustomControls;
|
|||
|
|
using Robust.Client.UserInterface.XAML;
|
|||
|
|
|
|||
|
|
namespace Content.Client.Miracle.Changeling.UI.TransformStingUI;
|
|||
|
|
|
|||
|
|
[GenerateTypedNameReferences]
|
|||
|
|
public sealed partial class TransformStingSelectorWindow : DefaultWindow
|
|||
|
|
{
|
|||
|
|
public Action<string, NetEntity>? ItemSelected;
|
|||
|
|
|
|||
|
|
public TransformStingSelectorWindow()
|
|||
|
|
{
|
|||
|
|
RobustXamlLoader.Load(this);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void PopulateList(Dictionary<string, string> items, NetEntity target)
|
|||
|
|
{
|
|||
|
|
ItemsContainer.RemoveAllChildren();
|
|||
|
|
|
|||
|
|
foreach (var item in items)
|
|||
|
|
{
|
|||
|
|
var button = new Button();
|
|||
|
|
|
|||
|
|
button.Text = item.Value;
|
|||
|
|
|
|||
|
|
button.OnPressed += _ => ItemSelected?.Invoke(item.Key, target);
|
|||
|
|
|
|||
|
|
ItemsContainer.AddChild(button);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|