mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
76 lines
2.4 KiB
C#
76 lines
2.4 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 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;
|
|
NameLabel.Text = string.Empty;
|
|
Diagnostics.Text = string.Empty;
|
|
return;
|
|
}
|
|
|
|
Print.Disabled = (msg.PrintReadyAt > _gameTiming.CurTime);
|
|
Clear.Disabled = false;
|
|
|
|
NameLabel.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);
|
|
}
|
|
text.AppendLine();
|
|
text.AppendLine(Loc.GetString("forensic-scanner-interface-dnas"));
|
|
foreach (var dna in msg.TouchDNAs)
|
|
{
|
|
text.AppendLine(dna);
|
|
}
|
|
foreach (var dna in msg.SolutionDNAs)
|
|
{
|
|
if (msg.TouchDNAs.Contains(dna))
|
|
continue;
|
|
text.AppendLine(dna);
|
|
}
|
|
text.AppendLine();
|
|
text.AppendLine(Loc.GetString("forensic-scanner-interface-residues"));
|
|
foreach (var residue in msg.Residues)
|
|
{
|
|
text.AppendLine(residue);
|
|
}
|
|
Diagnostics.Text = text.ToString();
|
|
}
|
|
}
|
|
}
|