Health Analyzer Uncloneable Refactor (#5330)
* Partial revert of #5310 * Refactored uncloneable out of the HealthAnalyzerScannedUserMessage BUI.
This commit is contained in:
parent
ab5d909196
commit
26db1e8f36
|
|
@ -2,6 +2,7 @@ using System.Linq;
|
|||
using System.Numerics;
|
||||
using Content.Client._DV.Traits.Assorted; // DeltaV
|
||||
using Content.Shared._DV.Traits.Assorted; // DeltaV
|
||||
using Content.Shared._DV.Medical; // DeltaV - Uncloneable
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Client.UserInterface.Controls;
|
||||
using Content.Shared._DV.MedicalRecords; // DeltaV - Medical Records
|
||||
|
|
@ -24,6 +25,7 @@ using Robust.Client.ResourceManagement;
|
|||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
|
||||
namespace Content.Client.HealthAnalyzer.UI
|
||||
{
|
||||
[GenerateTypedNameReferences]
|
||||
|
|
@ -35,6 +37,7 @@ namespace Content.Client.HealthAnalyzer.UI
|
|||
private readonly IResourceCache _cache;
|
||||
private readonly UnborgableSystem _unborgable; // DeltaV
|
||||
private readonly RedshirtSystem _redshirt; // DeltaV
|
||||
private readonly UncloneableSystem _uncloneable; // DeltaV
|
||||
|
||||
// Shitmed Change Start
|
||||
public event Action<TargetBodyPart?, EntityUid>? OnBodyPartSelected;
|
||||
|
|
@ -66,6 +69,7 @@ namespace Content.Client.HealthAnalyzer.UI
|
|||
_cache = dependencies.Resolve<IResourceCache>();
|
||||
_unborgable = _entityManager.System<UnborgableSystem>(); // DeltaV
|
||||
_redshirt = _entityManager.System<RedshirtSystem>(); // DeltaV
|
||||
_uncloneable = _entityManager.System<UncloneableSystem>(); // DeltaV
|
||||
// Shitmed Change Start
|
||||
_bodyPartControls = new Dictionary<TargetBodyPart, TextureButton>
|
||||
{
|
||||
|
|
@ -212,10 +216,13 @@ namespace Content.Client.HealthAnalyzer.UI
|
|||
DamageLabel.Text = damageable.TotalDamage.ToString();
|
||||
|
||||
// Alerts
|
||||
|
||||
var unborgable = _unborgable.IsUnborgable(_target.Value); // DeltaV
|
||||
// DeltaV traits - This is going to be horrid if we just keep adding things like this.
|
||||
var unborgable = _unborgable.IsUnborgable(_target.Value);
|
||||
var redshirt = _redshirt.IsRedshirt(_target.Value) && mobStateComponent?.CurrentState == MobState.Dead; // DeltaV - Redshirt
|
||||
var showAlerts = msg.Unrevivable == true || msg.Bleeding == true || unborgable || redshirt || msg.Uncloneable == true; // DeltaV - Unborgable/Redshirt/Uncloneable
|
||||
var uncloneable = _uncloneable.IsUncloneable(_target.Value) && mobStateComponent?.CurrentState == MobState.Dead; // DeltaV - Unclonable
|
||||
// END DeltaV
|
||||
|
||||
var showAlerts = msg.Unrevivable == true || msg.Bleeding == true || unborgable || redshirt || uncloneable; // DeltaV
|
||||
|
||||
AlertsDivider.Visible = showAlerts;
|
||||
AlertsContainer.Visible = showAlerts;
|
||||
|
|
@ -255,7 +262,7 @@ namespace Content.Client.HealthAnalyzer.UI
|
|||
MaxWidth = 300
|
||||
});
|
||||
|
||||
if (msg.Uncloneable == true) // DeltaV - Uncloneable
|
||||
if (uncloneable) // DeltaV - Uncloneable
|
||||
AlertsContainer.AddChild(new RichTextLabel
|
||||
{
|
||||
Text = Loc.GetString("health-analyzer-window-entity-uncloneable-text"),
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ public sealed partial class CryoPodSystem : SharedCryoPodSystem
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
null, // DeltaV - Uncloneable
|
||||
null // Shitmed Change
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ using System.Linq;
|
|||
// Begin DeltaV
|
||||
using Content.Server._DV.MedicalRecords;
|
||||
using Content.Shared._DV.MedicalRecords;
|
||||
using Content.Shared._DV.Traits.Assorted;
|
||||
// End DeltaV
|
||||
|
||||
namespace Content.Server.Medical;
|
||||
|
|
@ -293,7 +292,6 @@ public sealed class HealthAnalyzerSystem : EntitySystem
|
|||
var bloodAmount = float.NaN;
|
||||
var bleeding = false;
|
||||
var unrevivable = false;
|
||||
var uncloneable = false; // DeltaV - Uncloneable
|
||||
|
||||
if (TryComp<BloodstreamComponent>(target, out var bloodstream) &&
|
||||
_solutionContainerSystem.ResolveSolution(target, bloodstream.BloodSolutionName,
|
||||
|
|
@ -306,9 +304,6 @@ public sealed class HealthAnalyzerSystem : EntitySystem
|
|||
if (TryComp<UnrevivableComponent>(target, out var unrevivableComp) && unrevivableComp.Analyzable)
|
||||
unrevivable = true;
|
||||
|
||||
if (HasComp<UncloneableComponent>(target)) // DeltaV - Uncloneable
|
||||
uncloneable = true;
|
||||
|
||||
// Shitmed Change Start
|
||||
Dictionary<TargetBodyPart, TargetIntegrity>? body = null;
|
||||
if (HasComp<TargetingComponent>(target))
|
||||
|
|
@ -322,7 +317,6 @@ public sealed class HealthAnalyzerSystem : EntitySystem
|
|||
scanMode,
|
||||
bleeding,
|
||||
unrevivable,
|
||||
uncloneable, // DeltaV - Uncloneable
|
||||
// Shitmed Change
|
||||
body,
|
||||
_medicalRecords.GetMedicalRecords(target), // DeltaV - Medical Records
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using Content.Shared._DV.MedicalRecords; // DeltaV - Medical Records
|
||||
using Content.Shared._DV.Traits.Assorted;
|
||||
using Content.Shared._Shitmed.Targeting; // Shitmed Change
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
|
|
@ -17,12 +16,11 @@ public sealed class HealthAnalyzerScannedUserMessage : BoundUserInterfaceMessage
|
|||
public bool? ScanMode;
|
||||
public bool? Bleeding;
|
||||
public bool? Unrevivable;
|
||||
public bool? Uncloneable; // DeltaV - Uncloneable
|
||||
public Dictionary<TargetBodyPart, TargetIntegrity>? Body; // Shitmed Change
|
||||
public NetEntity? Part; // Shitmed Change
|
||||
public MedicalRecord? MedicalRecord; // DeltaV - Medical Records
|
||||
|
||||
public HealthAnalyzerScannedUserMessage(NetEntity? targetEntity, float temperature, float bloodLevel, bool? scanMode, bool? bleeding, bool? unrevivable, bool? uncloneable, Dictionary<TargetBodyPart, TargetIntegrity>? body, MedicalRecord? medicalRecord = null, NetEntity? part = null) // Shitmed Change // DeltaV - Medical Records
|
||||
public HealthAnalyzerScannedUserMessage(NetEntity? targetEntity, float temperature, float bloodLevel, bool? scanMode, bool? bleeding, bool? unrevivable, Dictionary<TargetBodyPart, TargetIntegrity>? body, MedicalRecord? medicalRecord = null, NetEntity? part = null) // Shitmed Change // DeltaV - Medical Records
|
||||
{
|
||||
TargetEntity = targetEntity;
|
||||
Temperature = temperature;
|
||||
|
|
@ -30,7 +28,6 @@ public sealed class HealthAnalyzerScannedUserMessage : BoundUserInterfaceMessage
|
|||
ScanMode = scanMode;
|
||||
Bleeding = bleeding;
|
||||
Unrevivable = unrevivable;
|
||||
Uncloneable = uncloneable; // DeltaV - Uncloneable
|
||||
Body = body; // Shitmed Change
|
||||
Part = part; // Shitmed Change
|
||||
MedicalRecord = medicalRecord; // DeltaV - Medical Records
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
using Content.Shared._DV.Traits.Assorted;
|
||||
using Content.Shared.Cloning.Events;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Content.Shared._DV.Medical;
|
||||
|
||||
public sealed class UncloneableSystem : EntitySystem
|
||||
{
|
||||
[PublicAPI]
|
||||
public bool IsUncloneable(Entity<UncloneableComponent?> entity)
|
||||
{
|
||||
if (!Resolve(entity, ref entity.Comp, false))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
|
|
|||
Loading…
Reference in New Issue