* Add ghost role raffles * GRR: Fix dialogue sizing, fix merge * GRR: Add raffle deciders (winner picker) * GRR: Make settings prototype based with option to override * GRR: Use Raffles folder and namespace * GRR: DataFieldify and TimeSpanify * GRR: Don't actually DataFieldify HashSet<ICommonSession>s * GRR: add GetGhostRoleCount() + docs * update engine on branch * Ghost role raffles: docs, fix window size, cleanup, etc * GRR: Admin UI * GRR: Admin UI: Display initial/max/ext of selected raffle settings proto * GRR: Make a ton of roles raffled
32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using Content.Shared.Ghost.Roles;
|
|
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.GameObjects;
|
|
using Robust.Client.UserInterface.CustomControls;
|
|
using Robust.Shared.Utility;
|
|
|
|
namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
|
|
{
|
|
[GenerateTypedNameReferences]
|
|
public sealed partial class GhostRolesWindow : DefaultWindow
|
|
{
|
|
public event Action<GhostRoleInfo>? OnRoleRequestButtonClicked;
|
|
public event Action<GhostRoleInfo>? OnRoleFollow;
|
|
|
|
public void ClearEntries()
|
|
{
|
|
NoRolesMessage.Visible = true;
|
|
EntryContainer.DisposeAllChildren();
|
|
}
|
|
|
|
public void AddEntry(string name, string description, bool hasAccess, FormattedMessage? reason, IEnumerable<GhostRoleInfo> roles, SpriteSystem spriteSystem)
|
|
{
|
|
NoRolesMessage.Visible = false;
|
|
|
|
var entry = new GhostRolesEntry(name, description, hasAccess, reason, roles, spriteSystem);
|
|
entry.OnRoleSelected += OnRoleRequestButtonClicked;
|
|
entry.OnRoleFollow += OnRoleFollow;
|
|
EntryContainer.AddChild(entry);
|
|
}
|
|
}
|
|
}
|