diff --git a/Content.Client/Administration/AdminNameOverlay.cs b/Content.Client/Administration/AdminNameOverlay.cs index 47d251910c..c6e6a75293 100644 --- a/Content.Client/Administration/AdminNameOverlay.cs +++ b/Content.Client/Administration/AdminNameOverlay.cs @@ -50,6 +50,8 @@ internal sealed class AdminNameOverlay : Overlay //TODO make this adjustable via GUI var classic = _config.GetCVar(CCVars.AdminOverlayClassic); + var playTime = _config.GetCVar(CCVars.AdminOverlayPlaytime); + var startingJob = _config.GetCVar(CCVars.AdminOverlayStartingJob); foreach (var playerInfo in _system.PlayerList) { @@ -76,25 +78,44 @@ internal sealed class AdminNameOverlay : Overlay } var uiScale = _userInterfaceManager.RootControl.UIScale; - var lineoffset = new Vector2(0f, 11f) * uiScale; + var lineoffset = new Vector2(0f, 14f) * uiScale; var screenCoordinates = _eyeManager.WorldToScreen(aabb.Center + new Angle(-_eyeManager.CurrentEye.Rotation).RotateVec( aabb.TopRight - aabb.Center)) + new Vector2(1f, 7f); + var currentOffset = Vector2.Zero; + + args.ScreenHandle.DrawString(_font, screenCoordinates + currentOffset, playerInfo.Username, uiScale, playerInfo.Connected ? Color.Yellow : Color.White); + currentOffset += lineoffset; + + args.ScreenHandle.DrawString(_font, screenCoordinates + currentOffset, playerInfo.CharacterName, uiScale, playerInfo.Connected ? Color.Aquamarine : Color.White); + currentOffset += lineoffset; + + if (!string.IsNullOrEmpty(playerInfo.PlaytimeString) && playTime) + { + args.ScreenHandle.DrawString(_font, screenCoordinates + currentOffset, playerInfo.PlaytimeString, uiScale, playerInfo.Connected ? Color.Orange : Color.White); + currentOffset += lineoffset; + } + + if (!string.IsNullOrEmpty(playerInfo.StartingJob) && startingJob) + { + args.ScreenHandle.DrawString(_font, screenCoordinates + currentOffset, Loc.GetString(playerInfo.StartingJob), uiScale, playerInfo.Connected ? Color.GreenYellow : Color.White); + currentOffset += lineoffset; + } + if (classic && playerInfo.Antag) { - args.ScreenHandle.DrawString(_font, screenCoordinates + (lineoffset * 2), _antagLabelClassic, uiScale, _antagColorClassic); + args.ScreenHandle.DrawString(_font, screenCoordinates + currentOffset, _antagLabelClassic, uiScale, Color.OrangeRed); + currentOffset += lineoffset; } - else if (!classic && _filter.Contains(playerInfo.RoleProto.ID)) + else if (!classic && _filter.Contains(playerInfo.RoleProto)) { - var label = Loc.GetString(playerInfo.RoleProto.Name).ToUpper(); - var color = playerInfo.RoleProto.Color; + var label = Loc.GetString(playerInfo.RoleProto.Name).ToUpper(); + var color = playerInfo.RoleProto.Color; - args.ScreenHandle.DrawString(_font, screenCoordinates + (lineoffset * 2), label, uiScale, color); + args.ScreenHandle.DrawString(_font, screenCoordinates + currentOffset, label, uiScale, color); + currentOffset += lineoffset; } - - args.ScreenHandle.DrawString(_font, screenCoordinates + lineoffset, playerInfo.Username, uiScale, playerInfo.Connected ? Color.Yellow : Color.White); - args.ScreenHandle.DrawString(_font, screenCoordinates, playerInfo.CharacterName, uiScale, playerInfo.Connected ? Color.Aquamarine : Color.White); } } } diff --git a/Content.Client/Advertise/Systems/SpeakOnUIClosedSystem.cs b/Content.Client/Advertise/Systems/SpeakOnUIClosedSystem.cs new file mode 100644 index 0000000000..4e82ec4d00 --- /dev/null +++ b/Content.Client/Advertise/Systems/SpeakOnUIClosedSystem.cs @@ -0,0 +1,5 @@ +using Content.Shared.Advertise.Systems; + +namespace Content.Client.Advertise.Systems; + +public sealed class SpeakOnUIClosedSystem : SharedSpeakOnUIClosedSystem; diff --git a/Content.Client/CartridgeLoader/Cartridges/LogProbeUi.cs b/Content.Client/CartridgeLoader/Cartridges/LogProbeUi.cs index d28d3228c9..12b678d5d4 100644 --- a/Content.Client/CartridgeLoader/Cartridges/LogProbeUi.cs +++ b/Content.Client/CartridgeLoader/Cartridges/LogProbeUi.cs @@ -1,4 +1,5 @@ using Content.Client.UserInterface.Fragments; +using Content.Shared.CartridgeLoader; using Content.Shared.CartridgeLoader.Cartridges; using Robust.Client.UserInterface; @@ -13,16 +14,23 @@ public sealed partial class LogProbeUi : UIFragment return _fragment!; } - public override void Setup(BoundUserInterface userInterface, EntityUid? fragmentOwner) + public override void Setup(BoundUserInterface ui, EntityUid? fragmentOwner) { _fragment = new LogProbeUiFragment(); + + _fragment.OnPrintPressed += () => + { + var ev = new LogProbePrintMessage(); + var message = new CartridgeUiMessage(ev); + ui.SendMessage(message); + }; } public override void UpdateState(BoundUserInterfaceState state) { - if (state is not LogProbeUiState logProbeUiState) + if (state is not LogProbeUiState cast) return; - _fragment?.UpdateState(logProbeUiState.PulledLogs); + _fragment?.UpdateState(cast.EntityName, cast.PulledLogs); } } diff --git a/Content.Client/CartridgeLoader/Cartridges/LogProbeUiFragment.xaml b/Content.Client/CartridgeLoader/Cartridges/LogProbeUiFragment.xaml index d12fb55cdc..cdbaf7d6ee 100644 --- a/Content.Client/CartridgeLoader/Cartridges/LogProbeUiFragment.xaml +++ b/Content.Client/CartridgeLoader/Cartridges/LogProbeUiFragment.xaml @@ -18,4 +18,9 @@ + +