Files
tbd-station-14/Content.Client/HealthAnalyzer/UI/Tooltips/HeartRateTooltip.xaml.cs
Janet Blackquill 579ea90d49 thusd refactoring
2025-10-03 12:21:48 -04:00

34 lines
1.0 KiB
C#

using Content.Shared._Offbrand.Wounds;
using Content.Shared.Damage;
using Content.Shared.FixedPoint;
using Content.Shared.MedicalScanner;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Client.UserInterface;
namespace Content.Client.HealthAnalyzer.UI.Tooltips;
[GenerateTypedNameReferences]
public sealed partial class HeartRateTooltip : PanelContainer
{
public HeartRateTooltip()
{
RobustXamlLoader.Load(this);
}
public void Update(HealthAnalyzerScannedUserMessage msg, Entity<DamageableComponent, HeartrateComponent?> ent)
{
if (msg.WoundableData is not { } woundable)
return;
if (ent.Comp2?.AsphyxiationDamage is not { } damageType)
return;
var asphyxiation = FixedPoint2.Zero;
ent.Comp1.Damage.DamageDict.TryGetValue(damageType, out asphyxiation);
Label.Text = Loc.GetString("health-analyzer-heart-rate-tooltip", ("asphyxiation", asphyxiation));
}
}