Add roles to Ghost Warp Menu (#7546)

This commit is contained in:
Júlio César Ueti
2022-04-15 18:41:27 -03:00
committed by GitHub
parent 4fa8a2df5a
commit 7656290831
3 changed files with 14 additions and 7 deletions

View File

@@ -1,9 +1,10 @@
<DefaultWindow xmlns="https://spacestation14.io"
Title="{Loc 'ghost-target-window-title'}"
MinSize="300 450"
SetSize="300 450">
MinSize="450 450"
SetSize="450 450">
<ScrollContainer VerticalExpand="True"
HorizontalExpand="True">
HorizontalExpand="True"
HScrollEnabled="False">
<BoxContainer Name="ButtonContainer"
Orientation="Vertical"
VerticalExpand="True"

View File

@@ -1,6 +1,7 @@
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Content.Shared.Ghost;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
@@ -54,7 +55,7 @@ namespace Content.Client.Ghost.UI
HorizontalAlignment = HAlignment.Center,
VerticalAlignment = VAlignment.Center,
SizeFlagsStretchRatio = 1,
MinSize = (230, 20),
MinSize = (340, 20),
ClipText = true,
};
@@ -83,7 +84,7 @@ namespace Content.Client.Ghost.UI
HorizontalAlignment = HAlignment.Center,
VerticalAlignment = VAlignment.Center,
SizeFlagsStretchRatio = 1,
MinSize = (230, 20),
MinSize = (340, 20),
ClipText = true,
};

View File

@@ -253,7 +253,12 @@ namespace Content.Server.Ghost
{
if (player.AttachedEntity is {Valid: true} attached)
{
players.Add(attached, EntityManager.GetComponent<MetaDataComponent>(attached).EntityName);
TryComp<MindComponent>(attached, out var mind);
string playerInfo = $"{EntityManager.GetComponent<MetaDataComponent>(attached).EntityName} ({mind?.Mind?.CurrentJob?.Name ?? "Unknown"})";
if (TryComp<MobStateComponent>(attached, out var state) && !state.IsDead())
players.Add(attached, playerInfo);
}
}