* Add missing Dispose method to ForensicScannerBoundUserInterface. * Remove old code from ForensicScanner. * Prevent forensic scanner from being used on the floor and allow its window to stay open when active hand is swapped. * Use more standardized UI code for ForensicScanner. * Add a delay to ForensicScanner printing. * Show name of what was scanned on ForensicScanner UI. * Add a print sound for ForensicScanner. * Add more error reporting for ForensicScanner. * Centralize common logic in ForensicScannerSystem. * Allow ForensicScanner blank printouts. * Tweak ForensicScanner audio parameters.
59 lines
1.7 KiB
C#
59 lines
1.7 KiB
C#
using System.Text;
|
|
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.UserInterface.CustomControls;
|
|
using Robust.Client.UserInterface.XAML;
|
|
using Robust.Shared.Timing;
|
|
using Content.Shared.Forensics;
|
|
|
|
namespace Content.Client.Forensics
|
|
{
|
|
[GenerateTypedNameReferences]
|
|
public sealed partial class ForensicScannerMenu : DefaultWindow
|
|
{
|
|
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
|
|
|
public ForensicScannerMenu()
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
IoCManager.InjectDependencies(this);
|
|
}
|
|
|
|
public void UpdatePrinterState(bool disabled)
|
|
{
|
|
Print.Disabled = disabled;
|
|
}
|
|
|
|
public void UpdateState(ForensicScannerBoundUserInterfaceState msg)
|
|
{
|
|
if (string.IsNullOrEmpty(msg.LastScannedName))
|
|
{
|
|
Print.Disabled = true;
|
|
Clear.Disabled = true;
|
|
Name.Text = string.Empty;
|
|
Diagnostics.Text = string.Empty;
|
|
return;
|
|
}
|
|
|
|
Print.Disabled = (msg.PrintReadyAt > _gameTiming.CurTime);
|
|
Clear.Disabled = false;
|
|
|
|
Name.Text = msg.LastScannedName;
|
|
|
|
var text = new StringBuilder();
|
|
|
|
text.AppendLine(Loc.GetString("forensic-scanner-interface-fingerprints"));
|
|
foreach (var fingerprint in msg.Fingerprints)
|
|
{
|
|
text.AppendLine(fingerprint);
|
|
}
|
|
text.AppendLine();
|
|
text.AppendLine(Loc.GetString("forensic-scanner-interface-fibers"));
|
|
foreach (var fiber in msg.Fibers)
|
|
{
|
|
text.AppendLine(fiber);
|
|
}
|
|
Diagnostics.Text = text.ToString();
|
|
}
|
|
}
|
|
}
|