Files
crystall-punk-14/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesWindow.xaml.cs

30 lines
948 B
C#
Raw Normal View History

2021-06-09 22:19:39 +02:00
using Content.Shared.Ghost.Roles;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
2022-09-11 20:42:12 -07:00
namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
{
[GenerateTypedNameReferences]
public sealed partial class GhostRolesWindow : DefaultWindow
{
public event Action<GhostRoleInfo>? OnRoleRequested;
public event Action<GhostRoleInfo>? OnRoleFollow;
public void ClearEntries()
{
NoRolesMessage.Visible = true;
EntryContainer.DisposeAllChildren();
}
public void AddEntry(string name, string description, IEnumerable<GhostRoleInfo> roles)
{
NoRolesMessage.Visible = false;
var entry = new GhostRolesEntry(name, description, roles);
entry.OnRoleSelected += OnRoleRequested;
entry.OnRoleFollow += OnRoleFollow;
EntryContainer.AddChild(entry);
}
}
}