Files
tbd-station-14/Content.Shared/GameObjects/Components/Medical/SharedMedicalScannerComponent.cs
SoulSloth dc77c399b9 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
2020-08-19 16:23:20 +02:00

83 lines
2.2 KiB
C#

using System;
using System.Collections.Generic;
using Content.Shared.Damage;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Components.UserInterface;
using Robust.Shared.Serialization;
namespace Content.Shared.GameObjects.Components.Medical
{
public class SharedMedicalScannerComponent : Component
{
public override string Name => "MedicalScanner";
[Serializable, NetSerializable]
public class MedicalScannerBoundUserInterfaceState : BoundUserInterfaceState
{
public readonly EntityUid? Entity;
public readonly Dictionary<DamageClass, int> DamageClasses;
public readonly Dictionary<DamageType, int> DamageTypes;
public readonly bool IsScanned;
public MedicalScannerBoundUserInterfaceState(
EntityUid? entity,
Dictionary<DamageClass, int> damageClasses,
Dictionary<DamageType, int> damageTypes,
bool isScanned)
{
Entity = entity;
DamageClasses = damageClasses;
DamageTypes = damageTypes;
IsScanned = isScanned;
}
public bool HasDamage()
{
return DamageClasses.Count > 0 || DamageTypes.Count > 0;
}
}
[Serializable, NetSerializable]
public enum MedicalScannerUiKey
{
Key
}
[Serializable, NetSerializable]
public enum MedicalScannerVisuals
{
Status
}
[Serializable, NetSerializable]
public enum MedicalScannerStatus
{
Off,
Open,
Red,
Death,
Green,
Yellow,
}
[Serializable, NetSerializable]
public enum UiButton
{
ScanDNA,
}
[Serializable, NetSerializable]
public class UiButtonPressedMessage : BoundUserInterfaceMessage
{
public readonly UiButton Button;
public UiButtonPressedMessage(UiButton button)
{
Button = button;
}
}
}
}