Skip to content

Commit

Permalink
Add uncloneable health analyzer text (new-frontiers-14#2824)
Browse files Browse the repository at this point in the history
* Add uncloneable health analyzer text

* fluent: uncloneable, "cannot"->"can not"

---------

Co-authored-by: Dvir <[email protected]>
  • Loading branch information
2 people authored and percent-temp-percent committed Feb 24, 2025
1 parent 6dd7ed1 commit fae025b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
10 changes: 10 additions & 0 deletions Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ public void Populate(HealthAnalyzerScannedUserMessage msg)
MaxWidth = 300
});

// Frontier: uncloneable text
if (msg.Uncloneable == true)
AlertsContainer.AddChild(new RichTextLabel
{
Text = Loc.GetString("health-analyzer-window-entity-uncloneable-text"),
Margin = new Thickness(0, 4),
MaxWidth = 300
});
// End Frontier

if (msg.Bleeding == true)
AlertsContainer.AddChild(new RichTextLabel
{
Expand Down
3 changes: 2 additions & 1 deletion Content.Server/Medical/CryoPodSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ private void OnActivateUI(Entity<CryoPodComponent> entity, ref AfterActivatableU
: 0,
null,
null,
null
null,
null // Frontier
));
}

Expand Down
8 changes: 7 additions & 1 deletion Content.Server/Medical/HealthAnalyzerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Timing;
using Content.Server._NF.Traits.Assorted; // Frontier

namespace Content.Server.Medical;

Expand Down Expand Up @@ -198,6 +199,7 @@ public void UpdateScannedUser(EntityUid healthAnalyzer, EntityUid target, bool s
var bloodAmount = float.NaN;
var bleeding = false;
var unrevivable = false;
var uncloneable = false; // Frontier

if (TryComp<BloodstreamComponent>(target, out var bloodstream) &&
_solutionContainerSystem.ResolveSolution(target, bloodstream.BloodSolutionName,
Expand All @@ -210,13 +212,17 @@ public void UpdateScannedUser(EntityUid healthAnalyzer, EntityUid target, bool s
if (HasComp<UnrevivableComponent>(target))
unrevivable = true;

if (HasComp<UncloneableComponent>(target)) // Frontier
uncloneable = true; // Frontier

_uiSystem.ServerSendUiMessage(healthAnalyzer, HealthAnalyzerUiKey.Key, new HealthAnalyzerScannedUserMessage(
GetNetEntity(target),
bodyTemperature,
bloodAmount,
scanMode,
bleeding,
unrevivable
unrevivable,
uncloneable // Frontier
));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ public sealed class HealthAnalyzerScannedUserMessage : BoundUserInterfaceMessage
public bool? ScanMode;
public bool? Bleeding;
public bool? Unrevivable;
public bool? Uncloneable; // Frontier

public HealthAnalyzerScannedUserMessage(NetEntity? targetEntity, float temperature, float bloodLevel, bool? scanMode, bool? bleeding, bool? unrevivable)
public HealthAnalyzerScannedUserMessage(NetEntity? targetEntity, float temperature, float bloodLevel, bool? scanMode, bool? bleeding, bool? unrevivable, bool? uncloneable) // Frontier: add uncloneable
{
TargetEntity = targetEntity;
Temperature = temperature;
BloodLevel = bloodLevel;
ScanMode = scanMode;
Bleeding = bleeding;
Unrevivable = unrevivable;
Uncloneable = uncloneable; // Frontier
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
health-analyzer-window-entity-uncloneable-text = [color=yellow]Unknown genetic sequence detected! Patient can not be cloned.[/color]

0 comments on commit fae025b

Please sign in to comment.