adds both blood level and body temp to analyzers and cryo (#16778)
* Ports temperature scanning from mining station 14 * Added blood level to analyzer * adds body temp and blood level to health analyzers and cryo * Blood and temperature will show N/A if not available
This commit is contained in:
@@ -37,6 +37,13 @@ namespace Content.Client.HealthAnalyzer.UI
|
|||||||
|
|
||||||
text.Append($"{Loc.GetString("health-analyzer-window-entity-health-text", ("entityName", entityName))}\n");
|
text.Append($"{Loc.GetString("health-analyzer-window-entity-health-text", ("entityName", entityName))}\n");
|
||||||
|
|
||||||
|
|
||||||
|
text.Append(String.Format("Temperature: {0}\n", float.IsNaN(msg.Temperature) ? "N/A" : $"{msg.Temperature - 273f:F1} °C"));
|
||||||
|
|
||||||
|
|
||||||
|
text.Append(String.Format("Blood Level: {0}\n", float.IsNaN(msg.BloodLevel) ? "N/A" : $"{msg.BloodLevel * 100:F1} %"));
|
||||||
|
|
||||||
|
|
||||||
// Damage
|
// Damage
|
||||||
text.Append($"\n{Loc.GetString("health-analyzer-window-entity-damage-total-text", ("amount", damageable.TotalDamage))}\n");
|
text.Append($"\n{Loc.GetString("health-analyzer-window-entity-damage-total-text", ("amount", damageable.TotalDamage))}\n");
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ using Content.Shared.Tools;
|
|||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
|
using Content.Server.Temperature.Components;
|
||||||
|
|
||||||
namespace Content.Server.Medical;
|
namespace Content.Server.Medical;
|
||||||
|
|
||||||
@@ -177,10 +178,14 @@ public sealed partial class CryoPodSystem: SharedCryoPodSystem
|
|||||||
|
|
||||||
private void OnActivateUI(EntityUid uid, CryoPodComponent cryoPodComponent, AfterActivatableUIOpenEvent args)
|
private void OnActivateUI(EntityUid uid, CryoPodComponent cryoPodComponent, AfterActivatableUIOpenEvent args)
|
||||||
{
|
{
|
||||||
|
TryComp<TemperatureComponent>(cryoPodComponent.BodyContainer.ContainedEntity, out var temp);
|
||||||
|
TryComp<BloodstreamComponent>(cryoPodComponent.BodyContainer.ContainedEntity, out var bloodstream);
|
||||||
|
|
||||||
_userInterfaceSystem.TrySendUiMessage(
|
_userInterfaceSystem.TrySendUiMessage(
|
||||||
uid,
|
uid,
|
||||||
HealthAnalyzerUiKey.Key,
|
HealthAnalyzerUiKey.Key,
|
||||||
new HealthAnalyzerScannedUserMessage(cryoPodComponent.BodyContainer.ContainedEntity));
|
new HealthAnalyzerScannedUserMessage(cryoPodComponent.BodyContainer.ContainedEntity,
|
||||||
|
temp != null ? temp.CurrentTemperature : 0, bloodstream != null ? bloodstream.BloodSolution.FillFraction : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnInteractUsing(EntityUid uid, CryoPodComponent cryoPodComponent, InteractUsingEvent args)
|
private void OnInteractUsing(EntityUid uid, CryoPodComponent cryoPodComponent, InteractUsingEvent args)
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ using Content.Shared.Interaction;
|
|||||||
using Content.Shared.MedicalScanner;
|
using Content.Shared.MedicalScanner;
|
||||||
using Content.Shared.Mobs.Components;
|
using Content.Shared.Mobs.Components;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
|
using Content.Server.Temperature.Components;
|
||||||
|
using Content.Server.Body.Components;
|
||||||
|
|
||||||
namespace Content.Server.Medical
|
namespace Content.Server.Medical
|
||||||
{
|
{
|
||||||
@@ -68,8 +70,13 @@ namespace Content.Server.Medical
|
|||||||
if (!HasComp<DamageableComponent>(target))
|
if (!HasComp<DamageableComponent>(target))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
TryComp<TemperatureComponent>(target, out var temp);
|
||||||
|
TryComp<BloodstreamComponent>(target, out var bloodstream);
|
||||||
|
|
||||||
OpenUserInterface(user, healthAnalyzer);
|
OpenUserInterface(user, healthAnalyzer);
|
||||||
_uiSystem.SendUiMessage(healthAnalyzer.UserInterface, new HealthAnalyzerScannedUserMessage(target));
|
|
||||||
|
_uiSystem.SendUiMessage(healthAnalyzer.UserInterface, new HealthAnalyzerScannedUserMessage(target, temp != null ? temp.CurrentTemperature : float.NaN,
|
||||||
|
bloodstream != null ? bloodstream.BloodSolution.FillFraction : float.NaN));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
|
|
||||||
namespace Content.Shared.MedicalScanner;
|
namespace Content.Shared.MedicalScanner;
|
||||||
|
|
||||||
@@ -9,10 +9,14 @@ namespace Content.Shared.MedicalScanner;
|
|||||||
public sealed class HealthAnalyzerScannedUserMessage : BoundUserInterfaceMessage
|
public sealed class HealthAnalyzerScannedUserMessage : BoundUserInterfaceMessage
|
||||||
{
|
{
|
||||||
public readonly EntityUid? TargetEntity;
|
public readonly EntityUid? TargetEntity;
|
||||||
|
public float Temperature;
|
||||||
|
public float BloodLevel;
|
||||||
|
|
||||||
public HealthAnalyzerScannedUserMessage(EntityUid? targetEntity)
|
public HealthAnalyzerScannedUserMessage(EntityUid? targetEntity, float temperature, float bloodLevel)
|
||||||
{
|
{
|
||||||
TargetEntity = targetEntity;
|
TargetEntity = targetEntity;
|
||||||
|
Temperature = temperature;
|
||||||
|
BloodLevel = bloodLevel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user