Minor UI refactor (#11212)

This commit is contained in:
wrexbe
2022-09-11 20:42:12 -07:00
committed by GitHub
parent 56c2ad6a16
commit 35b90736b7
63 changed files with 93 additions and 147 deletions

View File

@@ -0,0 +1,30 @@
using System;
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);
}
}
}