2022-06-27 20:04:53 -05:00
|
|
|
using System.Text;
|
|
|
|
|
using Robust.Client.AutoGenerated;
|
|
|
|
|
using Robust.Client.UserInterface.CustomControls;
|
|
|
|
|
using Robust.Client.UserInterface.XAML;
|
2022-11-08 16:06:09 -05:00
|
|
|
using Robust.Shared.Timing;
|
|
|
|
|
using Content.Shared.Forensics;
|
2022-06-27 20:04:53 -05:00
|
|
|
|
|
|
|
|
namespace Content.Client.Forensics
|
|
|
|
|
{
|
|
|
|
|
[GenerateTypedNameReferences]
|
|
|
|
|
public sealed partial class ForensicScannerMenu : DefaultWindow
|
|
|
|
|
{
|
2022-11-08 16:06:09 -05:00
|
|
|
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
|
|
|
|
|
2022-06-27 20:04:53 -05:00
|
|
|
public ForensicScannerMenu()
|
|
|
|
|
{
|
|
|
|
|
RobustXamlLoader.Load(this);
|
2022-11-08 16:06:09 -05:00
|
|
|
IoCManager.InjectDependencies(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdatePrinterState(bool disabled)
|
|
|
|
|
{
|
|
|
|
|
Print.Disabled = disabled;
|
2022-06-27 20:04:53 -05:00
|
|
|
}
|
|
|
|
|
|
2022-11-08 16:06:09 -05:00
|
|
|
public void UpdateState(ForensicScannerBoundUserInterfaceState msg)
|
2022-06-27 20:04:53 -05:00
|
|
|
{
|
2022-11-08 16:06:09 -05:00
|
|
|
if (string.IsNullOrEmpty(msg.LastScannedName))
|
|
|
|
|
{
|
|
|
|
|
Print.Disabled = true;
|
|
|
|
|
Clear.Disabled = true;
|
2024-02-13 22:48:39 +01:00
|
|
|
NameLabel.Text = string.Empty;
|
2022-11-08 16:06:09 -05:00
|
|
|
Diagnostics.Text = string.Empty;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Print.Disabled = (msg.PrintReadyAt > _gameTiming.CurTime);
|
|
|
|
|
Clear.Disabled = false;
|
|
|
|
|
|
2024-02-13 22:48:39 +01:00
|
|
|
NameLabel.Text = msg.LastScannedName;
|
2022-11-08 16:06:09 -05:00
|
|
|
|
2022-06-27 20:04:53 -05:00
|
|
|
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);
|
|
|
|
|
}
|
2023-03-31 07:49:25 +03:00
|
|
|
text.AppendLine();
|
|
|
|
|
text.AppendLine(Loc.GetString("forensic-scanner-interface-dnas"));
|
|
|
|
|
foreach (var dna in msg.DNAs)
|
|
|
|
|
{
|
|
|
|
|
text.AppendLine(dna);
|
|
|
|
|
}
|
2023-12-15 04:52:55 -05:00
|
|
|
text.AppendLine();
|
|
|
|
|
text.AppendLine(Loc.GetString("forensic-scanner-interface-residues"));
|
|
|
|
|
foreach (var residue in msg.Residues)
|
|
|
|
|
{
|
|
|
|
|
text.AppendLine(residue);
|
|
|
|
|
}
|
2022-06-27 20:04:53 -05:00
|
|
|
Diagnostics.Text = text.ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|