Health analyzer has tooltips now
This commit is contained in:
@@ -36,27 +36,37 @@
|
|||||||
|
|
||||||
<PanelContainer StyleClasses="LowDivider" />
|
<PanelContainer StyleClasses="LowDivider" />
|
||||||
|
|
||||||
<GridContainer Margin="0 5 0 0" Columns="2">
|
<GridContainer Margin="0 5 0 0" Columns="3">
|
||||||
<Label Text="{Loc 'health-analyzer-window-entity-status-text'}" />
|
<Label Text="{Loc 'health-analyzer-window-entity-status-text'}" />
|
||||||
<RichTextLabel Name="StatusLabel" />
|
<RichTextLabel Name="StatusLabel" />
|
||||||
|
<TextureButton Name="StatusButton" StyleClasses="SpeciesInfoDefault" Scale="0.3 0.3" VerticalAlignment="Center" />
|
||||||
<Label Name="BrainHealthText" Text="{Loc 'health-analyzer-window-entity-brain-health-text'}" />
|
<Label Name="BrainHealthText" Text="{Loc 'health-analyzer-window-entity-brain-health-text'}" />
|
||||||
<RichTextLabel Name="BrainHealthLabel" />
|
<RichTextLabel Name="BrainHealthLabel" />
|
||||||
|
<TextureButton Name="BrainHealthButton" StyleClasses="SpeciesInfoDefault" Scale="0.3 0.3" VerticalAlignment="Center" />
|
||||||
<Label Name="BloodPressureText" Text="{Loc 'health-analyzer-window-entity-blood-pressure-text'}" />
|
<Label Name="BloodPressureText" Text="{Loc 'health-analyzer-window-entity-blood-pressure-text'}" />
|
||||||
<RichTextLabel Name="BloodPressureLabel" />
|
<RichTextLabel Name="BloodPressureLabel" />
|
||||||
|
<TextureButton Name="BloodPressureButton" StyleClasses="SpeciesInfoDefault" Scale="0.3 0.3" VerticalAlignment="Center" />
|
||||||
<Label Name="BloodOxygenationText" Text="{Loc 'health-analyzer-window-entity-blood-oxygenation-text'}" />
|
<Label Name="BloodOxygenationText" Text="{Loc 'health-analyzer-window-entity-blood-oxygenation-text'}" />
|
||||||
<RichTextLabel Name="BloodOxygenationLabel" />
|
<RichTextLabel Name="BloodOxygenationLabel" />
|
||||||
|
<TextureButton Name="BloodOxygenationButton" StyleClasses="SpeciesInfoDefault" Scale="0.3 0.3" VerticalAlignment="Center" />
|
||||||
<Label Name="BloodFlowText" Text="{Loc 'health-analyzer-window-entity-blood-flow-text'}" />
|
<Label Name="BloodFlowText" Text="{Loc 'health-analyzer-window-entity-blood-flow-text'}" />
|
||||||
<RichTextLabel Name="BloodFlowLabel" />
|
<RichTextLabel Name="BloodFlowLabel" />
|
||||||
|
<TextureButton Name="BloodFlowButton" StyleClasses="SpeciesInfoDefault" Scale="0.3 0.3" VerticalAlignment="Center" />
|
||||||
<Label Name="HeartRateText" Text="{Loc 'health-analyzer-window-entity-heart-rate-text'}" />
|
<Label Name="HeartRateText" Text="{Loc 'health-analyzer-window-entity-heart-rate-text'}" />
|
||||||
<RichTextLabel Name="HeartRateLabel" />
|
<RichTextLabel Name="HeartRateLabel" />
|
||||||
|
<TextureButton Name="HeartRateButton" StyleClasses="SpeciesInfoDefault" Scale="0.3 0.3" VerticalAlignment="Center" />
|
||||||
<Label Name="HeartHealthText" Text="{Loc 'health-analyzer-window-entity-heart-health-text'}" />
|
<Label Name="HeartHealthText" Text="{Loc 'health-analyzer-window-entity-heart-health-text'}" />
|
||||||
<RichTextLabel Name="HeartHealthLabel" />
|
<RichTextLabel Name="HeartHealthLabel" />
|
||||||
|
<TextureButton Name="HeartHealthButton" StyleClasses="SpeciesInfoDefault" Scale="0.3 0.3" VerticalAlignment="Center" />
|
||||||
<Label Name="BloodText" Text="{Loc 'health-analyzer-window-entity-blood-level-text'}" />
|
<Label Name="BloodText" Text="{Loc 'health-analyzer-window-entity-blood-level-text'}" />
|
||||||
<RichTextLabel Name="BloodLabel" />
|
<RichTextLabel Name="BloodLabel" />
|
||||||
|
<TextureButton Name="BloodButton" StyleClasses="SpeciesInfoDefault" Scale="0.3 0.3" VerticalAlignment="Center" />
|
||||||
<Label Text="{Loc 'health-analyzer-window-entity-temperature-text'}" />
|
<Label Text="{Loc 'health-analyzer-window-entity-temperature-text'}" />
|
||||||
<RichTextLabel Name="TemperatureLabel" />
|
<RichTextLabel Name="TemperatureLabel" />
|
||||||
|
<TextureButton Name="TemperatureButton" StyleClasses="SpeciesInfoDefault" Scale="0.3 0.3" VerticalAlignment="Center" />
|
||||||
<Label Text="{Loc 'health-analyzer-window-entity-damage-total-text'}" />
|
<Label Text="{Loc 'health-analyzer-window-entity-damage-total-text'}" />
|
||||||
<RichTextLabel Name="DamageLabel" />
|
<RichTextLabel Name="DamageLabel" />
|
||||||
|
<TextureButton Name="DamageButton" StyleClasses="SpeciesInfoDefault" Scale="0.3 0.3" VerticalAlignment="Center" />
|
||||||
</GridContainer>
|
</GridContainer>
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Numerics;
|
|||||||
using Content.Client.Message;
|
using Content.Client.Message;
|
||||||
using Content.Shared.Atmos;
|
using Content.Shared.Atmos;
|
||||||
using Content.Client.UserInterface.Controls;
|
using Content.Client.UserInterface.Controls;
|
||||||
|
using Content.Shared._Offbrand.Wounds; // Offbrand
|
||||||
using Content.Shared.Alert;
|
using Content.Shared.Alert;
|
||||||
using Content.Shared.Damage;
|
using Content.Shared.Damage;
|
||||||
using Content.Shared.Damage.Prototypes;
|
using Content.Shared.Damage.Prototypes;
|
||||||
@@ -36,6 +37,19 @@ namespace Content.Client.HealthAnalyzer.UI
|
|||||||
private readonly IPrototypeManager _prototypes;
|
private readonly IPrototypeManager _prototypes;
|
||||||
private readonly IResourceCache _cache;
|
private readonly IResourceCache _cache;
|
||||||
|
|
||||||
|
// Begin Offbrand
|
||||||
|
private readonly Tooltips.StatusTooltip _statusTooltip = new();
|
||||||
|
private readonly Tooltips.BrainHealthTooltip _brainHealthTooltip = new();
|
||||||
|
private readonly Tooltips.BloodPressureTooltip _bloodPressureTooltip = new();
|
||||||
|
private readonly Tooltips.BloodOxygenationTooltip _bloodOxygenationTooltip = new();
|
||||||
|
private readonly Tooltips.HeartRateTooltip _heartRateTooltip = new();
|
||||||
|
private readonly Tooltips.HeartHealthTooltip _heartHealthTooltip = new();
|
||||||
|
private readonly Tooltips.BloodFlowTooltip _bloodFlowTooltip = new();
|
||||||
|
private readonly Tooltips.BloodTooltip _bloodTooltip = new();
|
||||||
|
private readonly Tooltips.TemperatureTooltip _temperatureTooltip = new();
|
||||||
|
private readonly Tooltips.DamageTooltip _damageTooltip = new();
|
||||||
|
// End Offbrand
|
||||||
|
|
||||||
public HealthAnalyzerWindow()
|
public HealthAnalyzerWindow()
|
||||||
{
|
{
|
||||||
RobustXamlLoader.Load(this);
|
RobustXamlLoader.Load(this);
|
||||||
@@ -45,6 +59,19 @@ namespace Content.Client.HealthAnalyzer.UI
|
|||||||
_spriteSystem = _entityManager.System<SpriteSystem>();
|
_spriteSystem = _entityManager.System<SpriteSystem>();
|
||||||
_prototypes = dependencies.Resolve<IPrototypeManager>();
|
_prototypes = dependencies.Resolve<IPrototypeManager>();
|
||||||
_cache = dependencies.Resolve<IResourceCache>();
|
_cache = dependencies.Resolve<IResourceCache>();
|
||||||
|
|
||||||
|
// Begin Offbrand
|
||||||
|
StatusButton.TooltipSupplier = _ => _statusTooltip;
|
||||||
|
BrainHealthButton.TooltipSupplier = _ => _brainHealthTooltip;
|
||||||
|
BloodPressureButton.TooltipSupplier = _ => _bloodPressureTooltip;
|
||||||
|
BloodOxygenationButton.TooltipSupplier = _ => _bloodOxygenationTooltip;
|
||||||
|
HeartRateButton.TooltipSupplier = _ => _heartRateTooltip;
|
||||||
|
BloodFlowButton.TooltipSupplier = _ => _bloodFlowTooltip;
|
||||||
|
HeartHealthButton.TooltipSupplier = _ => _heartHealthTooltip;
|
||||||
|
TemperatureButton.TooltipSupplier = _ => _temperatureTooltip;
|
||||||
|
DamageButton.TooltipSupplier = _ => _damageTooltip;
|
||||||
|
BloodButton.TooltipSupplier = _ => _bloodTooltip;
|
||||||
|
// End Offbrand
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Populate(HealthAnalyzerScannedUserMessage msg)
|
public void Populate(HealthAnalyzerScannedUserMessage msg)
|
||||||
@@ -60,6 +87,16 @@ namespace Content.Client.HealthAnalyzer.UI
|
|||||||
|
|
||||||
NoPatientDataText.Visible = false;
|
NoPatientDataText.Visible = false;
|
||||||
|
|
||||||
|
// Begin Offbrand Tooltips
|
||||||
|
_brainHealthTooltip.Update(msg);
|
||||||
|
_bloodPressureTooltip.Update(msg);
|
||||||
|
_bloodOxygenationTooltip.Update(msg, (target.Value, damageable));
|
||||||
|
_heartRateTooltip.Update(msg, (target.Value, damageable));
|
||||||
|
_bloodFlowTooltip.Update(msg);
|
||||||
|
_heartHealthTooltip.Update(msg);
|
||||||
|
_temperatureTooltip.Update(msg, (target.Value, _entityManager.GetComponentOrNull<CryostasisFactorComponent>(target)));
|
||||||
|
// End Offbrand Tooltips
|
||||||
|
|
||||||
// Scan Mode
|
// Scan Mode
|
||||||
|
|
||||||
ScanModeLabel.Text = msg.ScanMode.HasValue
|
ScanModeLabel.Text = msg.ScanMode.HasValue
|
||||||
@@ -198,30 +235,37 @@ namespace Content.Client.HealthAnalyzer.UI
|
|||||||
BrainHealthText.Visible = true;
|
BrainHealthText.Visible = true;
|
||||||
BrainHealthLabel.Visible = true;
|
BrainHealthLabel.Visible = true;
|
||||||
BrainHealthLabel.Text = Loc.GetString("health-analyzer-window-entity-brain-health-value", ("value", $"{woundable.BrainHealth * 100:F1}"), ("rating", woundable.BrainHealthRating));
|
BrainHealthLabel.Text = Loc.GetString("health-analyzer-window-entity-brain-health-value", ("value", $"{woundable.BrainHealth * 100:F1}"), ("rating", woundable.BrainHealthRating));
|
||||||
|
BrainHealthButton.Visible = true;
|
||||||
|
|
||||||
HeartHealthText.Visible = true;
|
HeartHealthText.Visible = true;
|
||||||
HeartHealthLabel.Visible = true;
|
HeartHealthLabel.Visible = true;
|
||||||
HeartHealthLabel.Text = Loc.GetString("health-analyzer-window-entity-heart-health-value", ("value", $"{woundable.HeartHealth * 100:F1}"), ("rating", woundable.HeartHealthRating));
|
HeartHealthLabel.Text = Loc.GetString("health-analyzer-window-entity-heart-health-value", ("value", $"{woundable.HeartHealth * 100:F1}"), ("rating", woundable.HeartHealthRating));
|
||||||
|
HeartHealthButton.Visible = true;
|
||||||
|
|
||||||
HeartRateText.Visible = true;
|
HeartRateText.Visible = true;
|
||||||
HeartRateLabel.Visible = true;
|
HeartRateLabel.Visible = true;
|
||||||
HeartRateLabel.Text = Loc.GetString("health-analyzer-window-entity-heart-rate-value", ("value", woundable.HeartRate), ("rating", woundable.HeartRateRating));
|
HeartRateLabel.Text = Loc.GetString("health-analyzer-window-entity-heart-rate-value", ("value", woundable.HeartRate), ("rating", woundable.HeartRateRating));
|
||||||
|
HeartRateButton.Visible = true;
|
||||||
|
|
||||||
BloodOxygenationText.Visible = true;
|
BloodOxygenationText.Visible = true;
|
||||||
BloodOxygenationLabel.Visible = true;
|
BloodOxygenationLabel.Visible = true;
|
||||||
BloodOxygenationLabel.Text = Loc.GetString("health-analyzer-window-entity-blood-oxygenation-value", ("value", $"{woundable.BloodOxygenation * 100:F1}"), ("rating", woundable.BloodOxygenationRating));
|
BloodOxygenationLabel.Text = Loc.GetString("health-analyzer-window-entity-blood-oxygenation-value", ("value", $"{woundable.BloodOxygenation * 100:F1}"), ("rating", woundable.BloodOxygenationRating));
|
||||||
|
BloodOxygenationButton.Visible = true;
|
||||||
|
|
||||||
BloodFlowText.Visible = true;
|
BloodFlowText.Visible = true;
|
||||||
BloodFlowLabel.Visible = true;
|
BloodFlowLabel.Visible = true;
|
||||||
BloodFlowLabel.Text = Loc.GetString("health-analyzer-window-entity-blood-flow-value", ("value", $"{woundable.BloodFlow * 100:F1}"), ("rating", woundable.BloodFlowRating));
|
BloodFlowLabel.Text = Loc.GetString("health-analyzer-window-entity-blood-flow-value", ("value", $"{woundable.BloodFlow * 100:F1}"), ("rating", woundable.BloodFlowRating));
|
||||||
|
BloodFlowButton.Visible = true;
|
||||||
|
|
||||||
var (systolic, diastolic) = woundable.BloodPressure;
|
var (systolic, diastolic) = woundable.BloodPressure;
|
||||||
BloodPressureText.Visible = true;
|
BloodPressureText.Visible = true;
|
||||||
BloodPressureLabel.Visible = true;
|
BloodPressureLabel.Visible = true;
|
||||||
BloodPressureLabel.Text = Loc.GetString("health-analyzer-window-entity-blood-pressure-value", ("systolic", systolic), ("diastolic", diastolic), ("rating", woundable.BloodPressureRating));
|
BloodPressureLabel.Text = Loc.GetString("health-analyzer-window-entity-blood-pressure-value", ("systolic", systolic), ("diastolic", diastolic), ("rating", woundable.BloodPressureRating));
|
||||||
|
BloodPressureButton.Visible = true;
|
||||||
|
|
||||||
BloodLabel.Visible = false;
|
BloodLabel.Visible = false;
|
||||||
BloodText.Visible = false;
|
BloodText.Visible = false;
|
||||||
|
BloodButton.Visible = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -237,9 +281,16 @@ namespace Content.Client.HealthAnalyzer.UI
|
|||||||
BloodFlowText.Visible = false;
|
BloodFlowText.Visible = false;
|
||||||
HeartRateText.Visible = false;
|
HeartRateText.Visible = false;
|
||||||
HeartHealthText.Visible = false;
|
HeartHealthText.Visible = false;
|
||||||
|
BrainHealthButton.Visible = false;
|
||||||
|
BloodPressureButton.Visible = false;
|
||||||
|
BloodOxygenationButton.Visible = false;
|
||||||
|
BloodFlowButton.Visible = false;
|
||||||
|
HeartRateButton.Visible = false;
|
||||||
|
HeartHealthButton.Visible = false;
|
||||||
|
|
||||||
BloodLabel.Visible = true;
|
BloodLabel.Visible = true;
|
||||||
BloodText.Visible = true;
|
BloodText.Visible = true;
|
||||||
|
BloodButton.Visible = true;
|
||||||
}
|
}
|
||||||
// End Offbrand
|
// End Offbrand
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<PanelContainer xmlns="https://spacestation14.io" StyleClasses="tooltipBox" MaxWidth="450">
|
||||||
|
<BoxContainer
|
||||||
|
Orientation="Vertical"
|
||||||
|
RectClipContent="True"
|
||||||
|
Margin="4">
|
||||||
|
<RichTextLabel Name="Label" HorizontalExpand="True" />
|
||||||
|
</BoxContainer>
|
||||||
|
</PanelContainer>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
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 BloodFlowTooltip : PanelContainer
|
||||||
|
{
|
||||||
|
public BloodFlowTooltip()
|
||||||
|
{
|
||||||
|
RobustXamlLoader.Load(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Update(HealthAnalyzerScannedUserMessage msg)
|
||||||
|
{
|
||||||
|
if (msg.WoundableData is not { } woundable)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Label.Text = Loc.GetString("health-analyzer-blood-flow-tooltip", ("heartrate", woundable.HeartRate), ("health", $"{woundable.HeartHealth * 100:F1}"));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<PanelContainer xmlns="https://spacestation14.io" StyleClasses="tooltipBox" MaxWidth="450">
|
||||||
|
<BoxContainer
|
||||||
|
Orientation="Vertical"
|
||||||
|
RectClipContent="True"
|
||||||
|
Margin="4">
|
||||||
|
<RichTextLabel Name="Label" HorizontalExpand="True" />
|
||||||
|
</BoxContainer>
|
||||||
|
</PanelContainer>
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
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 BloodOxygenationTooltip : PanelContainer
|
||||||
|
{
|
||||||
|
public BloodOxygenationTooltip()
|
||||||
|
{
|
||||||
|
RobustXamlLoader.Load(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Update(HealthAnalyzerScannedUserMessage msg, Entity<DamageableComponent> ent)
|
||||||
|
{
|
||||||
|
if (msg.WoundableData is not { } woundable)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var asphyxiation = FixedPoint2.Zero;
|
||||||
|
ent.Comp.Damage.DamageDict.TryGetValue("Asphyxiation", out asphyxiation);
|
||||||
|
var (systolic, diastolic) = woundable.BloodPressure;
|
||||||
|
|
||||||
|
Label.Text = Loc.GetString("health-analyzer-blood-saturation-tooltip", ("rating", woundable.BloodOxygenationRating), ("systolic", systolic), ("diastolic", diastolic), ("asphyxiation", asphyxiation));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<PanelContainer xmlns="https://spacestation14.io" StyleClasses="tooltipBox" MaxWidth="450">
|
||||||
|
<BoxContainer
|
||||||
|
Orientation="Vertical"
|
||||||
|
RectClipContent="True"
|
||||||
|
Margin="4">
|
||||||
|
<RichTextLabel Name="Label" HorizontalExpand="True" />
|
||||||
|
</BoxContainer>
|
||||||
|
</PanelContainer>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
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 BloodPressureTooltip : PanelContainer
|
||||||
|
{
|
||||||
|
public BloodPressureTooltip()
|
||||||
|
{
|
||||||
|
RobustXamlLoader.Load(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Update(HealthAnalyzerScannedUserMessage msg)
|
||||||
|
{
|
||||||
|
if (msg.WoundableData is not { } woundable)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Label.Text = Loc.GetString("health-analyzer-blood-pressure-tooltip", ("flow", $"{woundable.BloodFlow * 100:F1}"));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<PanelContainer xmlns="https://spacestation14.io" StyleClasses="tooltipBox">
|
||||||
|
<BoxContainer
|
||||||
|
Orientation="Vertical"
|
||||||
|
RectClipContent="True"
|
||||||
|
Margin="4">
|
||||||
|
<RichTextLabel Text="{Loc 'health-analyzer-blood-tooltip'}" HorizontalExpand="True" />
|
||||||
|
</BoxContainer>
|
||||||
|
</PanelContainer>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
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 BloodTooltip : PanelContainer
|
||||||
|
{
|
||||||
|
public BloodTooltip()
|
||||||
|
{
|
||||||
|
RobustXamlLoader.Load(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<PanelContainer xmlns="https://spacestation14.io" StyleClasses="tooltipBox" MaxWidth="450">
|
||||||
|
<BoxContainer
|
||||||
|
Orientation="Vertical"
|
||||||
|
RectClipContent="True"
|
||||||
|
Margin="4">
|
||||||
|
<RichTextLabel Name="Label" HorizontalExpand="True" />
|
||||||
|
</BoxContainer>
|
||||||
|
</PanelContainer>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
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}"));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<PanelContainer xmlns="https://spacestation14.io" StyleClasses="tooltipBox">
|
||||||
|
<BoxContainer
|
||||||
|
Orientation="Vertical"
|
||||||
|
RectClipContent="True"
|
||||||
|
Margin="4">
|
||||||
|
<RichTextLabel Text="{Loc 'health-analyzer-damage-tooltip'}" HorizontalExpand="True" />
|
||||||
|
</BoxContainer>
|
||||||
|
</PanelContainer>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
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 DamageTooltip : PanelContainer
|
||||||
|
{
|
||||||
|
public DamageTooltip()
|
||||||
|
{
|
||||||
|
RobustXamlLoader.Load(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<PanelContainer xmlns="https://spacestation14.io" StyleClasses="tooltipBox" MaxWidth="450">
|
||||||
|
<BoxContainer
|
||||||
|
Orientation="Vertical"
|
||||||
|
RectClipContent="True"
|
||||||
|
Margin="4">
|
||||||
|
<RichTextLabel Name="Label" HorizontalExpand="True" />
|
||||||
|
</BoxContainer>
|
||||||
|
</PanelContainer>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
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 HeartHealthTooltip : PanelContainer
|
||||||
|
{
|
||||||
|
public HeartHealthTooltip()
|
||||||
|
{
|
||||||
|
RobustXamlLoader.Load(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Update(HealthAnalyzerScannedUserMessage msg)
|
||||||
|
{
|
||||||
|
if (msg.WoundableData is not { } woundable)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Label.Text = Loc.GetString("health-analyzer-heart-health-tooltip", ("heartrate", woundable.HeartRate));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<PanelContainer xmlns="https://spacestation14.io" StyleClasses="tooltipBox" MaxWidth="450">
|
||||||
|
<BoxContainer
|
||||||
|
Orientation="Vertical"
|
||||||
|
RectClipContent="True"
|
||||||
|
Margin="4">
|
||||||
|
<RichTextLabel Name="Label" HorizontalExpand="True" />
|
||||||
|
</BoxContainer>
|
||||||
|
</PanelContainer>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
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> ent)
|
||||||
|
{
|
||||||
|
if (msg.WoundableData is not { } woundable)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var asphyxiation = FixedPoint2.Zero;
|
||||||
|
ent.Comp.Damage.DamageDict.TryGetValue("Asphyxiation", out asphyxiation);
|
||||||
|
|
||||||
|
Label.Text = Loc.GetString("health-analyzer-heart-rate-tooltip", ("asphyxiation", asphyxiation));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<PanelContainer xmlns="https://spacestation14.io" StyleClasses="tooltipBox">
|
||||||
|
<BoxContainer
|
||||||
|
Orientation="Vertical"
|
||||||
|
RectClipContent="True"
|
||||||
|
Margin="4">
|
||||||
|
<RichTextLabel Text="{Loc 'health-analyzer-status-tooltip'}" HorizontalExpand="True" />
|
||||||
|
</BoxContainer>
|
||||||
|
</PanelContainer>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
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 StatusTooltip : PanelContainer
|
||||||
|
{
|
||||||
|
public StatusTooltip()
|
||||||
|
{
|
||||||
|
RobustXamlLoader.Load(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<PanelContainer xmlns="https://spacestation14.io" StyleClasses="tooltipBox">
|
||||||
|
<BoxContainer
|
||||||
|
Orientation="Vertical"
|
||||||
|
RectClipContent="True"
|
||||||
|
Margin="4">
|
||||||
|
<RichTextLabel Name="Label" HorizontalExpand="True" />
|
||||||
|
</BoxContainer>
|
||||||
|
</PanelContainer>
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
using Content.Shared._Offbrand.Wounds;
|
||||||
|
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 TemperatureTooltip : PanelContainer
|
||||||
|
{
|
||||||
|
public TemperatureTooltip()
|
||||||
|
{
|
||||||
|
RobustXamlLoader.Load(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Update(HealthAnalyzerScannedUserMessage msg, Entity<CryostasisFactorComponent?> ent)
|
||||||
|
{
|
||||||
|
if (ent.Comp is null)
|
||||||
|
{
|
||||||
|
Label.Text = Loc.GetString("health-analyzer-plain-temperature-tooltip");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var factor = Math.Max(ent.Comp.TemperatureCoefficient * msg.Temperature + ent.Comp.TemperatureConstant, 1);
|
||||||
|
Label.Text = Loc.GetString("health-analyzer-cryostasis-temperature-tooltip", ("factor", $"{factor * 100:F1}"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,3 +32,101 @@ wound-ribcage-open = [color=red]Patient has open ribcage.[/color]
|
|||||||
wound-arterial-bleeding = [color=red]Patient has arterial bleeding.[/color]
|
wound-arterial-bleeding = [color=red]Patient has arterial bleeding.[/color]
|
||||||
|
|
||||||
health-analyzer-window-no-patient-damages = Patient has no injuries.
|
health-analyzer-window-no-patient-damages = Patient has no injuries.
|
||||||
|
|
||||||
|
health-analyzer-status-tooltip =
|
||||||
|
{"[bold]"}Alive[/bold]: The patient is alive and conscious.
|
||||||
|
{"[bold]"}Critical[/bold]: The patient is unconscious and will die without intervention.
|
||||||
|
{"[bold]"}Dead[/bold]: The patient is dead and will rot without intervention.
|
||||||
|
|
||||||
|
health-analyzer-blood-saturation-tooltip =
|
||||||
|
A measure of how much oxygen (or nitrogen, etc.) the patient's brain is getting.
|
||||||
|
|
||||||
|
{ $rating ->
|
||||||
|
[good] Your patient's brain is not at risk.
|
||||||
|
[okay] Your patient's brain may be damaged slightly.
|
||||||
|
[poor] Your patient's brain may be damaged.
|
||||||
|
[bad] Your patient's brain may be damaged substantially.
|
||||||
|
[awful] Your patient's brain is at [color=red]severe risk[/color] for fatal injury.
|
||||||
|
[dangerous] Your patient's brain is at [color=red]life-threatening risk[/color] for fatal injury.
|
||||||
|
*[other] Your patient is an enigma. Report this to developers if you see this message.
|
||||||
|
}
|
||||||
|
|
||||||
|
Relevant metrics:
|
||||||
|
{"[color=#7af396]"}Blood Pressure[/color]: {$systolic}/{$diastolic}
|
||||||
|
{"[color=#7af396]"}Asphyxiation[/color]: {$asphyxiation}
|
||||||
|
|
||||||
|
health-analyzer-blood-pressure-tooltip =
|
||||||
|
A measure of how much blood is in use by the body.
|
||||||
|
|
||||||
|
If [color=#7af396]Blood Flow[/color] is high but [color=#7af396]Blood Pressure[/color] is not, ensure your patient has adequate [color=#7af396]Blood Volume[/color].
|
||||||
|
|
||||||
|
Relevant metrics:
|
||||||
|
{"[color=#7af396]"}Blood Flow[/color]: {$flow}%
|
||||||
|
|
||||||
|
health-analyzer-blood-flow-tooltip =
|
||||||
|
A measure of how much the patient's body can circulate available blood.
|
||||||
|
|
||||||
|
This primarily depends on your patient's heart having a pulse and being in good condition.
|
||||||
|
CPR can be administered if the heart is not providing enough blood flow.
|
||||||
|
|
||||||
|
Relevant metrics:
|
||||||
|
{"[color=#7af396]"}Heart Rate[/color]: {$heartrate}bpm
|
||||||
|
{"[color=#7af396]"}Heart Health[/color]: {$health}%
|
||||||
|
|
||||||
|
health-analyzer-heart-rate-tooltip =
|
||||||
|
A measure of how fast the patient's heart is beating.
|
||||||
|
|
||||||
|
It will raise due to pain and asphyxiation.
|
||||||
|
|
||||||
|
It can stop due to severe pain, lack of blood, or severe brain damage.
|
||||||
|
|
||||||
|
{"[color=#731024]"}Inaprovaline[/color] can be administered to reduce the patient's heartrate.
|
||||||
|
|
||||||
|
Relevant metrics:
|
||||||
|
{"[color=#7af396]"}Asphyxiation[/color]: {$asphyxiation}
|
||||||
|
|
||||||
|
health-analyzer-heart-health-tooltip =
|
||||||
|
A measure of the heart's integrity.
|
||||||
|
|
||||||
|
It will decrease due to excessively high heartrate.
|
||||||
|
|
||||||
|
Relevant metrics:
|
||||||
|
{"[color=#7af396]"}Heart Rate[/color]: {$heartrate}bpm
|
||||||
|
|
||||||
|
health-analyzer-plain-temperature-tooltip =
|
||||||
|
The patient's body temperature.
|
||||||
|
|
||||||
|
health-analyzer-cryostasis-temperature-tooltip =
|
||||||
|
The patient's body temperature.
|
||||||
|
|
||||||
|
This temperature has a cryostasis factor of {$factor}%.
|
||||||
|
|
||||||
|
health-analyzer-blood-tooltip =
|
||||||
|
The patient's blood volume.
|
||||||
|
|
||||||
|
health-analyzer-damage-tooltip =
|
||||||
|
The patient's total accumulated injuries.
|
||||||
|
|
||||||
|
health-analyzer-brain-health-tooltip = { $dead ->
|
||||||
|
[true] {-health-analyzer-brain-health-tooltip-dead}
|
||||||
|
*[false] {-health-analyzer-brain-health-tooltip-alive(rating: $rating, saturation: $saturation)}
|
||||||
|
}
|
||||||
|
|
||||||
|
-health-analyzer-brain-health-tooltip-alive =
|
||||||
|
{ $rating ->
|
||||||
|
[good] Your patient is fine, and does not need any intervention.
|
||||||
|
[okay] Your patient has slight brain damage, but can likely heal it over time.
|
||||||
|
[poor] Your patient has brain damage.
|
||||||
|
[bad] Your patient has a large amount of brain damage. Administer [color=#731024]Inaprovaline[/color] to stabilize the brain before proceeding with treatment.
|
||||||
|
[awful] Your patient has a severe amount of brain damage. [bold]Administer [color=#731024]Inaprovaline[/color] to stabilize the brain immediately.[/bold] Consider moving to a cryopod or stasis bed if you do not have a treatment plan.
|
||||||
|
[dangerous] Your patient is at [color=red]severe risk of death[/color]. [bold]Administer [color=#731024]Inaprovaline[/color], and move the patient to a cryopod or stasis bed if you do not have a treatment plan.[/bold]
|
||||||
|
*[other] Your patient is an enigma. Report this to developers if you see this message.
|
||||||
|
}
|
||||||
|
|
||||||
|
{"[color=#fedb79]"}Mannitol[/color] can be administered to heal brain damage if the [color=#7af396]Blood Saturation[/color] permits.
|
||||||
|
|
||||||
|
Relevant metrics:
|
||||||
|
{"[color=#7af396]"}Blood Saturation[/color]: {$saturation}%
|
||||||
|
|
||||||
|
-health-analyzer-brain-health-tooltip-dead =
|
||||||
|
The patient has 0% brain activity and is dead.
|
||||||
|
|||||||
Reference in New Issue
Block a user