Add 'Scan DNA' function to medical scanner (#1783)

* Add art assets for cloning

* Added a 'Scan DNA' button to the medical scanner

* Made the UI update unconditional for the medical scanner until checks for power changes are in place

* Update Medical scanner to reflect powered status and fix #1774

* added a 'scan dna' button the the medical scanner that will add the contained bodies Uid to a list in CloningSystem, fixed an issue with the menu not populating if the scanner starts in an unpowered state

* Add disabling logic to 'Scan DNA' button on medical scanner

* Removed un-used libraries

* changed scan dna button to Scan and Save DNA
This commit is contained in:
SoulSloth
2020-08-19 10:23:20 -04:00
committed by GitHub
parent cd1afb6582
commit dc77c399b9
15 changed files with 201 additions and 17 deletions

View File

@@ -12,18 +12,38 @@ namespace Content.Client.GameObjects.Components.MedicalScanner
{
public class MedicalScannerWindow : SS14Window
{
public readonly Button ScanButton;
private readonly Label _diagnostics;
protected override Vector2? CustomSize => (485, 90);
public MedicalScannerWindow()
{
Contents.AddChild(new VBoxContainer
{
Children =
{
(ScanButton = new Button
{
Text = "Scan and Save DNA"
}),
(_diagnostics = new Label
{
Text = ""
})
}
});
}
public void Populate(MedicalScannerBoundUserInterfaceState state)
{
Contents.RemoveAllChildren();
var text = new StringBuilder();
if (!state.Entity.HasValue ||
!state.HasDamage() ||
!IoCManager.Resolve<IEntityManager>().TryGetEntity(state.Entity.Value, out var entity))
{
text.Append(Loc.GetString("No patient data."));
_diagnostics.Text = Loc.GetString("No patient data.");
ScanButton.Disabled = true;
}
else
{
@@ -45,9 +65,10 @@ namespace Content.Client.GameObjects.Components.MedicalScanner
text.Append("\n");
}
}
Contents.AddChild(new Label() {Text = text.ToString()});
_diagnostics.Text = text.ToString();
ScanButton.Disabled = state.IsScanned;
}
}
}
}