Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com> Co-authored-by: Jezithyr <jmaster9999@gmail.com> Co-authored-by: Jezithyr <Jezithyr@gmail.com> Co-authored-by: Visne <39844191+Visne@users.noreply.github.com> Co-authored-by: wrexbe <wrexbe@protonmail.com> Co-authored-by: wrexbe <81056464+wrexbe@users.noreply.github.com>
30 lines
948 B
C#
30 lines
948 B
C#
using Content.Shared.Ghost.Roles;
|
|
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.UserInterface.CustomControls;
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|