25 lines
785 B
C#
25 lines
785 B
C#
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 BrainHealthTooltip : PanelContainer
|
|
{
|
|
public BrainHealthTooltip()
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
}
|
|
|
|
public void Update(HealthAnalyzerScannedUserMessage msg)
|
|
{
|
|
if (msg.WoundableData is not { } woundable)
|
|
return;
|
|
|
|
Label.Text = Loc.GetString("health-analyzer-brain-health-tooltip", ("dead", woundable.BrainHealth <= 0), ("rating", woundable.BrainHealthRating), ("saturation", $"{woundable.BloodOxygenation * 100:F1}"));
|
|
}
|
|
}
|