using Content.Shared.Forensics; using Content.Shared.Forensics.Components; using JetBrains.Annotations; using Robust.Client.UserInterface; namespace Content.Client.Forensics; public sealed partial class ForensicScannerBoundUserInterface(EntityUid owner, Enum uiKey) : BoundUserInterface(owner, uiKey) { [ViewVariables] private ForensicScannerMenu? _window; protected override void Open() { base.Open(); _window = this.CreateWindow(); _window.Print.OnPressed += _ => Print(); _window.Clear.OnPressed += _ => Clear(); Update(); } private void Print() { SendPredictedMessage(new ForensicScannerPrintMessage()); } private void Clear() { SendPredictedMessage(new ForensicScannerClearMessage()); } public override void Update() { base.Update(); if (_window == null) return; if (!EntMan.TryGetComponent(Owner, out ForensicScannerComponent? scanner)) return; _window.Update(scanner); } }