diff --git a/Content.Client/Access/AccessOverlay.cs b/Content.Client/Access/AccessOverlay.cs index 1ba2dc613f5d31..2be3d07e90d50d 100644 --- a/Content.Client/Access/AccessOverlay.cs +++ b/Content.Client/Access/AccessOverlay.cs @@ -11,14 +11,16 @@ public sealed class AccessOverlay : Overlay { private readonly IEntityManager _entityManager; private readonly EntityLookupSystem _lookup; + private readonly SharedTransformSystem _xform; private readonly Font _font; public override OverlaySpace Space => OverlaySpace.ScreenSpace; - public AccessOverlay(IEntityManager entManager, IResourceCache cache, EntityLookupSystem lookup) + public AccessOverlay(IEntityManager entManager, IResourceCache cache, EntityLookupSystem lookup, SharedTransformSystem xform) { _entityManager = entManager; _lookup = lookup; + _xform = xform; _font = cache.GetFont("/Fonts/NotoSans/NotoSans-Regular.ttf", 12); } @@ -71,7 +73,7 @@ protected override void Draw(in OverlayDrawArgs args) textStr = ""; } - var screenPos = args.ViewportControl.WorldToScreen(xform.WorldPosition); + var screenPos = args.ViewportControl.WorldToScreen(_xform.GetWorldPosition(xform)); args.ScreenHandle.DrawString(_font, screenPos, textStr, Color.Gold); } diff --git a/Content.Client/Access/AccessSystem.cs b/Content.Client/Access/AccessSystem.cs index a5680ab937bd2c..a510d6cae73b4e 100644 --- a/Content.Client/Access/AccessSystem.cs +++ b/Content.Client/Access/AccessSystem.cs @@ -2,4 +2,6 @@ namespace Content.Client.Access; -public sealed class AccessSystem : SharedAccessSystem {} +public sealed class AccessSystem : SharedAccessSystem +{ +} diff --git a/Content.Client/Access/Commands/ShowAccessReadersCommand.cs b/Content.Client/Access/Commands/ShowAccessReadersCommand.cs index fa26df1944c0c3..7c804dd969801b 100644 --- a/Content.Client/Access/Commands/ShowAccessReadersCommand.cs +++ b/Content.Client/Access/Commands/ShowAccessReadersCommand.cs @@ -13,7 +13,8 @@ public void Execute(IConsoleShell shell, string argStr, string[] args) { var collection = IoCManager.Instance; - if (collection == null) return; + if (collection == null) + return; var overlay = collection.Resolve(); @@ -25,9 +26,10 @@ public void Execute(IConsoleShell shell, string argStr, string[] args) var entManager = collection.Resolve(); var cache = collection.Resolve(); - var system = entManager.EntitySysManager.GetEntitySystem(); + var lookup = entManager.System(); + var xform = entManager.System(); - overlay.AddOverlay(new AccessOverlay(entManager, cache, system)); + overlay.AddOverlay(new AccessOverlay(entManager, cache, lookup, xform)); shell.WriteLine($"Set access reader debug overlay to true"); } } diff --git a/Content.Client/Access/UI/AgentIDCardBoundUserInterface.cs b/Content.Client/Access/UI/AgentIDCardBoundUserInterface.cs index a7c499c12e43fb..6eae796856bb88 100644 --- a/Content.Client/Access/UI/AgentIDCardBoundUserInterface.cs +++ b/Content.Client/Access/UI/AgentIDCardBoundUserInterface.cs @@ -56,9 +56,10 @@ protected override void UpdateState(BoundUserInterfaceState state) protected override void Dispose(bool disposing) { base.Dispose(disposing); - if (!disposing) return; + if (!disposing) + return; + _window?.Dispose(); } } - } diff --git a/Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs b/Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs index f1350a21b45383..292759dc878f88 100644 --- a/Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs +++ b/Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs @@ -51,7 +51,9 @@ protected override void Open() protected override void Dispose(bool disposing) { base.Dispose(disposing); - if (!disposing) return; + if (!disposing) + return; + _window?.Dispose(); } diff --git a/Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs b/Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs index ffd949a643880a..f8450fe578f930 100644 --- a/Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs +++ b/Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs @@ -15,6 +15,8 @@ namespace Content.Client.Access.UI public sealed partial class IdCardConsoleWindow : DefaultWindow { [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly ILogManager _logManager = default!; + private readonly ISawmill _logMill = default!; private readonly IdCardConsoleBoundUserInterface _owner; @@ -30,6 +32,7 @@ public IdCardConsoleWindow(IdCardConsoleBoundUserInterface owner, IPrototypeMana { RobustXamlLoader.Load(this); IoCManager.InjectDependencies(this); + _logMill = _logManager.GetSawmill(SharedIdCardConsoleSystem.Sawmill); _owner = owner; @@ -67,7 +70,7 @@ public IdCardConsoleWindow(IdCardConsoleBoundUserInterface owner, IPrototypeMana { if (!prototypeManager.TryIndex(access, out var accessLevel)) { - Logger.ErrorS(SharedIdCardConsoleSystem.Sawmill, $"Unable to find accesslevel for {access}"); + _logMill.Error($"Unable to find accesslevel for {access}"); continue; } diff --git a/Content.Client/Administration/UI/AdminRemarks/AdminMessageEui.cs b/Content.Client/Administration/UI/AdminRemarks/AdminMessageEui.cs new file mode 100644 index 00000000000000..06eace118d7bbb --- /dev/null +++ b/Content.Client/Administration/UI/AdminRemarks/AdminMessageEui.cs @@ -0,0 +1,38 @@ +using Content.Client.Eui; +using Content.Shared.Administration.Notes; +using Content.Shared.Eui; +using JetBrains.Annotations; +using static Content.Shared.Administration.Notes.AdminMessageEuiMsg; + +namespace Content.Client.Administration.UI.AdminRemarks; + +[UsedImplicitly] +public sealed class AdminMessageEui : BaseEui +{ + private readonly AdminMessagePopupWindow _popup; + + public AdminMessageEui() + { + _popup = new AdminMessagePopupWindow(); + _popup.OnAcceptPressed += () => SendMessage(new Accept()); + _popup.OnDismissPressed += () => SendMessage(new Dismiss()); + _popup.OnClose += () => SendMessage(new CloseEuiMessage()); + } + + public override void HandleState(EuiStateBase state) + { + if (state is not AdminMessageEuiState s) + { + return; + } + + _popup.SetMessage(s.Message); + _popup.SetDetails(s.AdminName, s.AddedOn); + _popup.Timer = s.Time; + } + + public override void Opened() + { + _popup.OpenCentered(); + } +} diff --git a/Content.Client/Administration/UI/AdminRemarks/AdminMessagePopupWindow.xaml b/Content.Client/Administration/UI/AdminRemarks/AdminMessagePopupWindow.xaml new file mode 100644 index 00000000000000..eac7e37a86d712 --- /dev/null +++ b/Content.Client/Administration/UI/AdminRemarks/AdminMessagePopupWindow.xaml @@ -0,0 +1,26 @@ + + + + + + + +