Files
tbd-station-14/Content.Client/Forensics/ForensicScannerMenu.xaml.cs
faint 8b6996cbae DNA basics (#14724)
* DNA component

* Commit numba 2

* Added DNA into Station Records Computer

* commit numba 3

* commit numba 4

* Vomit also contain DNA component now

* fixed DNA field not clearing after scanning another item

* commit numba 10
Drinking leaves DNA on an object. Breaking glasses, bottles and beakers leave DNA and leave fingerprints/fibers with 40% chance on glass shards. + lotta fixes

* 11

* 12

* 14

* Added DNA guide entry

* FIX
2023-03-30 22:49:25 -06:00

65 lines
1.9 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);
}
text.AppendLine();
text.AppendLine(Loc.GetString("forensic-scanner-interface-dnas"));
foreach (var dna in msg.DNAs)
{
text.AppendLine(dna);
}
Diagnostics.Text = text.ToString();
}
}
}