Grouped ghost roles and jump button (#7300)
This commit is contained in:
@@ -9,13 +9,24 @@ namespace Content.Client.Ghost.Roles.UI
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class GhostRolesEntry : BoxContainer
|
||||
{
|
||||
public GhostRolesEntry(GhostRoleInfo info, Action<BaseButton.ButtonEventArgs> requestAction)
|
||||
public event Action<GhostRoleInfo>? OnRoleSelected;
|
||||
public event Action<GhostRoleInfo>? OnRoleFollow;
|
||||
|
||||
public GhostRolesEntry(string name, string description, IEnumerable<GhostRoleInfo> roles)
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
Title.Text = info.Name;
|
||||
Description.SetMessage(info.Description);
|
||||
RequestButton.OnPressed += requestAction;
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user