Keep PlayerTab entries until the end of the round (#5910)

This commit is contained in:
ShadowCommander
2021-12-27 03:46:38 -08:00
committed by GitHub
parent 0869aa79f7
commit e51f6ee851
5 changed files with 28 additions and 6 deletions

View File

@@ -52,7 +52,8 @@ namespace Content.Client.Administration.UI.Tabs.PlayerTab
PlayerList.AddChild(new PlayerTabEntry("Username",
"Character",
"Antagonist",
new StyleBoxFlat(altColor)));
new StyleBoxFlat(altColor),
true));
PlayerList.AddChild(new HSeparator());
var useAltColor = false;
@@ -61,7 +62,8 @@ namespace Content.Client.Administration.UI.Tabs.PlayerTab
var entry = new PlayerTabEntry(player.Username,
player.CharacterName,
player.Antag ? "YES" : "NO",
new StyleBoxFlat(useAltColor ? altColor : defaultColor));
new StyleBoxFlat(useAltColor ? altColor : defaultColor),
player.Connected);
entry.PlayerUid = player.EntityUid;
entry.OnPressed += args => OnEntryPressed?.Invoke(args);
PlayerList.AddChild(entry);

View File

@@ -11,11 +11,13 @@ public partial class PlayerTabEntry : ContainerButton
{
public EntityUid? PlayerUid;
public PlayerTabEntry(string username, string character, string antagonist, StyleBox styleBox)
public PlayerTabEntry(string username, string character, string antagonist, StyleBox styleBox, bool connected)
{
RobustXamlLoader.Load(this);
UsernameLabel.Text = username;
if (!connected)
UsernameLabel.StyleClasses.Add("Disabled");
CharacterLabel.Text = character;
AntagonistLabel.Text = antagonist;
BackgroundColorPanel.PanelOverride = styleBox;