diff --git a/Content.Benchmarks/DynamicTreeBenchmark.cs b/Content.Benchmarks/DynamicTreeBenchmark.cs index 4f3dad4073..9086b4d3ac 100644 --- a/Content.Benchmarks/DynamicTreeBenchmark.cs +++ b/Content.Benchmarks/DynamicTreeBenchmark.cs @@ -44,7 +44,7 @@ namespace Content.Benchmarks for (var i = 0; i < Aabbs1.Length; i++) { var aabb = Aabbs1[i]; - _b2Tree.CreateProxy(aabb, i); + _b2Tree.CreateProxy(aabb, uint.MaxValue, i); _tree.Add(i); } } diff --git a/Content.Client/Administration/AdminNameOverlay.cs b/Content.Client/Administration/AdminNameOverlay.cs index 86c9b595f6..3c968ec17c 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.CharacterName, uiScale, playerInfo.Connected ? Color.Aquamarine : Color.White); + currentOffset += lineoffset; + + args.ScreenHandle.DrawString(_font, screenCoordinates + currentOffset, playerInfo.Username, uiScale, playerInfo.Connected ? Color.Yellow : 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)) { - 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/Administration/UI/Bwoink/BwoinkControl.xaml b/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml index 42d6f4b354..d53101f68e 100644 --- a/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml +++ b/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml @@ -2,24 +2,26 @@ xmlns="https://spacestation14.io" xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"> - - - - - - - - - - + + + diff --git a/Content.Client/CartridgeLoader/Cartridges/NanoTaskItemControl.xaml.cs b/Content.Client/CartridgeLoader/Cartridges/NanoTaskItemControl.xaml.cs new file mode 100644 index 0000000000..5edbee9d44 --- /dev/null +++ b/Content.Client/CartridgeLoader/Cartridges/NanoTaskItemControl.xaml.cs @@ -0,0 +1,33 @@ +using Robust.Client.AutoGenerated; +using Robust.Client.Graphics; +using Robust.Client.UserInterface; +using Robust.Client.UserInterface.XAML; +using Robust.Shared.Maths; +using Content.Shared.CartridgeLoader.Cartridges; + +namespace Content.Client.CartridgeLoader.Cartridges; + +/// +/// Represents a single control for a single NanoTask item +/// +[GenerateTypedNameReferences] +public sealed partial class NanoTaskItemControl : Control +{ + public Action? OnMainPressed; + public Action? OnDonePressed; + + public NanoTaskItemControl(NanoTaskItemAndId item) + { + RobustXamlLoader.Load(this); + + TaskLabel.Text = item.Data.Description; + TaskLabel.FontColorOverride = Color.White; + TaskForLabel.Text = item.Data.TaskIsFor; + + MainButton.OnPressed += _ => OnMainPressed?.Invoke(item.Id); + DoneButton.OnPressed += _ => OnDonePressed?.Invoke(item.Id); + + MainButton.Disabled = item.Data.IsTaskDone; + DoneButton.Text = item.Data.IsTaskDone ? Loc.GetString("nano-task-ui-revert-done") : Loc.GetString("nano-task-ui-done"); + } +} diff --git a/Content.Client/CartridgeLoader/Cartridges/NanoTaskItemPopup.xaml b/Content.Client/CartridgeLoader/Cartridges/NanoTaskItemPopup.xaml new file mode 100644 index 0000000000..ad72df05d9 --- /dev/null +++ b/Content.Client/CartridgeLoader/Cartridges/NanoTaskItemPopup.xaml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + +