using System; using Content.Shared.Ghost.Roles; using Robust.Client.AutoGenerated; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.XAML; namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles { [GenerateTypedNameReferences] public sealed partial class GhostRolesEntry : BoxContainer { public event Action? OnRoleSelected; public event Action? OnRoleFollow; public GhostRolesEntry(string name, string description, IEnumerable roles) { RobustXamlLoader.Load(this); Title.Text = name; Description.SetMessage(description); foreach (var role in roles) { var button = new GhostRoleEntryButtons(); button.RequestButton.OnPressed += _ => OnRoleSelected?.Invoke(role); button.FollowButton.OnPressed += _ => OnRoleFollow?.Invoke(role); Buttons.AddChild(button); } } } }