resimmed offmed
This commit is contained in:
@@ -46,18 +46,21 @@
|
||||
<Label Name="BloodPressureText" Text="{Loc 'health-analyzer-window-entity-blood-pressure-text'}" />
|
||||
<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'}" />
|
||||
<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'}" />
|
||||
<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'}" />
|
||||
<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'}" />
|
||||
<RichTextLabel Name="HeartHealthLabel" />
|
||||
<TextureButton Name="HeartHealthButton" StyleClasses="SpeciesInfoDefault" Scale="0.3 0.3" VerticalAlignment="Center" />
|
||||
<Label Name="SpO2Text" />
|
||||
<RichTextLabel Name="SpO2Label" />
|
||||
<TextureButton Name="SpO2Button" StyleClasses="SpeciesInfoDefault" Scale="0.3 0.3" VerticalAlignment="Center" />
|
||||
<Label Name="EtCO2Text" />
|
||||
<RichTextLabel Name="EtCO2Label" />
|
||||
<TextureButton Name="EtCO2Button" StyleClasses="SpeciesInfoDefault" Scale="0.3 0.3" VerticalAlignment="Center" />
|
||||
<Label Name="RespiratoryRateText" Text="{Loc 'health-analyzer-window-entity-respiratory-rate-text'}" />
|
||||
<RichTextLabel Name="RespiratoryRateLabel" />
|
||||
<TextureButton Name="RespiratoryRateButton" StyleClasses="SpeciesInfoDefault" Scale="0.3 0.3" VerticalAlignment="Center" />
|
||||
<Label Name="LungHealthText" Text="{Loc 'health-analyzer-window-entity-lung-health-text'}" />
|
||||
<RichTextLabel Name="LungHealthLabel" />
|
||||
<TextureButton Name="LungHealthButton" StyleClasses="SpeciesInfoDefault" Scale="0.3 0.3" VerticalAlignment="Center" />
|
||||
|
||||
@@ -41,14 +41,15 @@ namespace Content.Client.HealthAnalyzer.UI
|
||||
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.LungHealthTooltip _lungHealthTooltip = 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();
|
||||
private readonly Tooltips.SpO2Tooltip _spo2Tooltip = new();
|
||||
private readonly Tooltips.EtCO2Tooltip _etco2Tooltip = new();
|
||||
private readonly Tooltips.RespiratoryRateTooltip _respiratoryRateTooltip = new();
|
||||
// End Offbrand
|
||||
|
||||
public HealthAnalyzerWindow()
|
||||
@@ -65,14 +66,15 @@ namespace Content.Client.HealthAnalyzer.UI
|
||||
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;
|
||||
LungHealthButton.TooltipSupplier = _ => _lungHealthTooltip;
|
||||
SpO2Button.TooltipSupplier = _ => _spo2Tooltip;
|
||||
EtCO2Button.TooltipSupplier = _ => _etco2Tooltip;
|
||||
RespiratoryRateButton.TooltipSupplier = _ => _respiratoryRateTooltip;
|
||||
// End Offbrand
|
||||
}
|
||||
|
||||
@@ -91,12 +93,12 @@ namespace Content.Client.HealthAnalyzer.UI
|
||||
|
||||
// Begin Offbrand Tooltips
|
||||
_brainHealthTooltip.Update(msg);
|
||||
_bloodPressureTooltip.Update(msg);
|
||||
_bloodOxygenationTooltip.Update(msg, (target.Value, damageable, _entityManager.GetComponentOrNull<HeartrateComponent>(target)));
|
||||
_heartRateTooltip.Update(msg, (target.Value, damageable, _entityManager.GetComponentOrNull<HeartrateComponent>(target)));
|
||||
_bloodFlowTooltip.Update(msg);
|
||||
_heartRateTooltip.Update(msg);
|
||||
_heartHealthTooltip.Update(msg);
|
||||
_temperatureTooltip.Update(msg, (target.Value, _entityManager.GetComponentOrNull<CryostasisFactorComponent>(target)));
|
||||
_spo2Tooltip.Update(msg);
|
||||
_etco2Tooltip.Update(msg);
|
||||
_respiratoryRateTooltip.Update(msg);
|
||||
// End Offbrand Tooltips
|
||||
|
||||
// Scan Mode
|
||||
@@ -236,40 +238,47 @@ namespace Content.Client.HealthAnalyzer.UI
|
||||
}
|
||||
BrainHealthText.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}"));
|
||||
BrainHealthButton.Visible = true;
|
||||
|
||||
HeartHealthText.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}"));
|
||||
HeartHealthButton.Visible = true;
|
||||
|
||||
HeartRateText.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));
|
||||
HeartRateButton.Visible = true;
|
||||
|
||||
BloodOxygenationText.Visible = true;
|
||||
BloodOxygenationLabel.Visible = true;
|
||||
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;
|
||||
BloodFlowLabel.Visible = true;
|
||||
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;
|
||||
BloodPressureText.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));
|
||||
BloodPressureButton.Visible = true;
|
||||
|
||||
LungHealthText.Visible = true;
|
||||
LungHealthLabel.Visible = true;
|
||||
LungHealthLabel.Text = Loc.GetString("health-analyzer-window-entity-lung-health-value", ("value", $"{woundable.LungHealth * 100:F1}"), ("rating", woundable.LungHealthRating));
|
||||
LungHealthLabel.Text = Loc.GetString("health-analyzer-window-entity-lung-health-value", ("value", $"{woundable.LungHealth * 100:F1}"));
|
||||
LungHealthButton.Visible = true;
|
||||
|
||||
SpO2Text.Visible = true;
|
||||
SpO2Text.Text = Loc.GetString("health-analyzer-window-entity-spo2-text", ("spo2", woundable.Spo2Name));
|
||||
SpO2Label.Visible = true;
|
||||
SpO2Label.Text = Loc.GetString("health-analyzer-window-entity-spo2-value", ("value", $"{woundable.Spo2 * 100:F1}"));
|
||||
SpO2Button.Visible = true;
|
||||
|
||||
EtCO2Text.Visible = true;
|
||||
EtCO2Text.Text = Loc.GetString("health-analyzer-window-entity-etco2-text", ("etco2", woundable.Etco2Name));
|
||||
EtCO2Label.Visible = true;
|
||||
EtCO2Label.Text = Loc.GetString("health-analyzer-window-entity-etco2-value", ("value", $"{woundable.Etco2}"));
|
||||
EtCO2Button.Visible = true;
|
||||
|
||||
RespiratoryRateText.Visible = true;
|
||||
RespiratoryRateLabel.Visible = true;
|
||||
RespiratoryRateLabel.Text = Loc.GetString("health-analyzer-window-entity-respiratory-rate-value", ("value", $"{woundable.RespiratoryRate}"));
|
||||
RespiratoryRateButton.Visible = true;
|
||||
|
||||
BloodLabel.Visible = false;
|
||||
BloodText.Visible = false;
|
||||
BloodButton.Visible = false;
|
||||
@@ -278,25 +287,28 @@ namespace Content.Client.HealthAnalyzer.UI
|
||||
{
|
||||
BrainHealthLabel.Visible = false;
|
||||
BloodPressureLabel.Visible = false;
|
||||
BloodOxygenationLabel.Visible = false;
|
||||
HeartRateLabel.Visible = false;
|
||||
HeartHealthLabel.Visible = false;
|
||||
BloodFlowLabel.Visible = false;
|
||||
LungHealthLabel.Visible = false;
|
||||
BrainHealthText.Visible = false;
|
||||
BloodPressureText.Visible = false;
|
||||
BloodOxygenationText.Visible = false;
|
||||
BloodFlowText.Visible = false;
|
||||
HeartRateText.Visible = false;
|
||||
HeartHealthText.Visible = false;
|
||||
LungHealthText.Visible = false;
|
||||
BrainHealthButton.Visible = false;
|
||||
BloodPressureButton.Visible = false;
|
||||
BloodOxygenationButton.Visible = false;
|
||||
BloodFlowButton.Visible = false;
|
||||
HeartRateButton.Visible = false;
|
||||
HeartHealthButton.Visible = false;
|
||||
LungHealthButton.Visible = false;
|
||||
SpO2Text.Visible = false;
|
||||
SpO2Label.Visible = false;
|
||||
SpO2Button.Visible = false;
|
||||
EtCO2Text.Visible = false;
|
||||
EtCO2Label.Visible = false;
|
||||
EtCO2Button.Visible = false;
|
||||
RespiratoryRateText.Visible = false;
|
||||
RespiratoryRateLabel.Visible = false;
|
||||
RespiratoryRateButton.Visible = false;
|
||||
|
||||
BloodLabel.Visible = true;
|
||||
BloodText.Visible = true;
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
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}"));
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
<PanelContainer xmlns="https://spacestation14.io" StyleClasses="tooltipBox" MaxWidth="450">
|
||||
<BoxContainer
|
||||
Orientation="Vertical"
|
||||
RectClipContent="True"
|
||||
Margin="4">
|
||||
<RichTextLabel Name="Label" HorizontalExpand="True" />
|
||||
</BoxContainer>
|
||||
</PanelContainer>
|
||||
@@ -1,34 +0,0 @@
|
||||
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 BloodOxygenationTooltip : PanelContainer
|
||||
{
|
||||
public BloodOxygenationTooltip()
|
||||
{
|
||||
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);
|
||||
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,6 @@
|
||||
namespace Content.Client.HealthAnalyzer.UI.Tooltips;
|
||||
|
||||
public sealed partial class BloodPressureTooltip : StaticTooltip
|
||||
{
|
||||
public override LocId Text => "health-analyzer-blood-pressure-tooltip";
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
<PanelContainer xmlns="https://spacestation14.io" StyleClasses="tooltipBox" MaxWidth="450">
|
||||
<BoxContainer
|
||||
Orientation="Vertical"
|
||||
RectClipContent="True"
|
||||
Margin="4">
|
||||
<RichTextLabel Name="Label" HorizontalExpand="True" />
|
||||
</BoxContainer>
|
||||
</PanelContainer>
|
||||
@@ -1,24 +0,0 @@
|
||||
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,6 @@
|
||||
namespace Content.Client.HealthAnalyzer.UI.Tooltips;
|
||||
|
||||
public sealed partial class BloodTooltip : StaticTooltip
|
||||
{
|
||||
public override LocId Text => "health-analyzer-blood-tooltip";
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
<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>
|
||||
@@ -1,15 +0,0 @@
|
||||
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,14 @@
|
||||
using Content.Shared.MedicalScanner;
|
||||
|
||||
namespace Content.Client.HealthAnalyzer.UI.Tooltips;
|
||||
|
||||
public sealed partial class BrainHealthTooltip : UpdatableTooltip
|
||||
{
|
||||
public override void Update(HealthAnalyzerScannedUserMessage msg)
|
||||
{
|
||||
if (msg.WoundableData is not { } woundable)
|
||||
return;
|
||||
|
||||
Label.Text = Loc.GetString("health-analyzer-brain-health-tooltip", ("dead", woundable.BrainHealth <= 0), ("spo2", $"{woundable.Spo2 * 100:F1}"));
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
<PanelContainer xmlns="https://spacestation14.io" StyleClasses="tooltipBox" MaxWidth="450">
|
||||
<BoxContainer
|
||||
Orientation="Vertical"
|
||||
RectClipContent="True"
|
||||
Margin="4">
|
||||
<RichTextLabel Name="Label" HorizontalExpand="True" />
|
||||
</BoxContainer>
|
||||
</PanelContainer>
|
||||
@@ -1,24 +0,0 @@
|
||||
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,6 @@
|
||||
namespace Content.Client.HealthAnalyzer.UI.Tooltips;
|
||||
|
||||
public sealed partial class DamageTooltip : StaticTooltip
|
||||
{
|
||||
public override LocId Text => "health-analyzer-damage-tooltip";
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
<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>
|
||||
@@ -1,15 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
14
Content.Client/HealthAnalyzer/UI/Tooltips/EtCO2Tooltip.cs
Normal file
14
Content.Client/HealthAnalyzer/UI/Tooltips/EtCO2Tooltip.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Content.Shared.MedicalScanner;
|
||||
|
||||
namespace Content.Client.HealthAnalyzer.UI.Tooltips;
|
||||
|
||||
public sealed partial class EtCO2Tooltip : UpdatableTooltip
|
||||
{
|
||||
public override void Update(HealthAnalyzerScannedUserMessage msg)
|
||||
{
|
||||
if (msg.WoundableData is not { } woundable)
|
||||
return;
|
||||
|
||||
Label.Text = Loc.GetString("health-analyzer-etco2-tooltip", ("gas", woundable.Etco2GasName), ("etco2", woundable.Etco2Name));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using Content.Shared.MedicalScanner;
|
||||
|
||||
namespace Content.Client.HealthAnalyzer.UI.Tooltips;
|
||||
|
||||
public sealed partial class HeartHealthTooltip : UpdatableTooltip
|
||||
{
|
||||
public override void Update(HealthAnalyzerScannedUserMessage msg)
|
||||
{
|
||||
if (msg.WoundableData is not { } woundable)
|
||||
return;
|
||||
|
||||
Label.Text = Loc.GetString("health-analyzer-heart-health-tooltip", ("heartrate", woundable.HeartRate));
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
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,14 @@
|
||||
using Content.Shared.MedicalScanner;
|
||||
|
||||
namespace Content.Client.HealthAnalyzer.UI.Tooltips;
|
||||
|
||||
public sealed partial class HeartRateTooltip : UpdatableTooltip
|
||||
{
|
||||
public override void Update(HealthAnalyzerScannedUserMessage msg)
|
||||
{
|
||||
if (msg.WoundableData is not { } woundable)
|
||||
return;
|
||||
|
||||
Label.Text = Loc.GetString("health-analyzer-heart-rate-tooltip", ("spo2", woundable.Spo2Name));
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
<PanelContainer xmlns="https://spacestation14.io" StyleClasses="tooltipBox" MaxWidth="450">
|
||||
<BoxContainer
|
||||
Orientation="Vertical"
|
||||
RectClipContent="True"
|
||||
Margin="4">
|
||||
<RichTextLabel Name="Label" HorizontalExpand="True" />
|
||||
</BoxContainer>
|
||||
</PanelContainer>
|
||||
@@ -1,33 +0,0 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Content.Client.HealthAnalyzer.UI.Tooltips;
|
||||
|
||||
public sealed partial class LungHealthTooltip : StaticTooltip
|
||||
{
|
||||
public override LocId Text => "health-analyzer-lung-health-tooltip";
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
<PanelContainer xmlns="https://spacestation14.io" StyleClasses="tooltipBox">
|
||||
<BoxContainer
|
||||
Orientation="Vertical"
|
||||
RectClipContent="True"
|
||||
Margin="4">
|
||||
<RichTextLabel Text="{Loc 'health-analyzer-lung-health-tooltip'}" HorizontalExpand="True" />
|
||||
</BoxContainer>
|
||||
</PanelContainer>
|
||||
@@ -0,0 +1,14 @@
|
||||
using Content.Shared.MedicalScanner;
|
||||
|
||||
namespace Content.Client.HealthAnalyzer.UI.Tooltips;
|
||||
|
||||
public sealed partial class RespiratoryRateTooltip : UpdatableTooltip
|
||||
{
|
||||
public override void Update(HealthAnalyzerScannedUserMessage msg)
|
||||
{
|
||||
if (msg.WoundableData is not { } woundable)
|
||||
return;
|
||||
|
||||
Label.Text = Loc.GetString("health-analyzer-respiratory-rate-tooltip", ("etco2gas", woundable.Etco2GasName), ("etco2", woundable.Etco2Name), ("spo2gas", woundable.Spo2GasName), ("spo2", woundable.Spo2Name));
|
||||
}
|
||||
}
|
||||
14
Content.Client/HealthAnalyzer/UI/Tooltips/SpO2Tooltip.cs
Normal file
14
Content.Client/HealthAnalyzer/UI/Tooltips/SpO2Tooltip.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Content.Shared.MedicalScanner;
|
||||
|
||||
namespace Content.Client.HealthAnalyzer.UI.Tooltips;
|
||||
|
||||
public sealed partial class SpO2Tooltip : UpdatableTooltip
|
||||
{
|
||||
public override void Update(HealthAnalyzerScannedUserMessage msg)
|
||||
{
|
||||
if (msg.WoundableData is not { } woundable)
|
||||
return;
|
||||
|
||||
Label.Text = Loc.GetString("health-analyzer-spo2-tooltip", ("gas", woundable.Spo2GasName), ("spo2", woundable.Spo2Name));
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using Content.Shared.MedicalScanner;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
@@ -6,10 +7,14 @@ using Robust.Client.UserInterface;
|
||||
namespace Content.Client.HealthAnalyzer.UI.Tooltips;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class LungHealthTooltip : PanelContainer
|
||||
[Virtual]
|
||||
public partial class StaticTooltip : PanelContainer
|
||||
{
|
||||
public LungHealthTooltip()
|
||||
public StaticTooltip()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
Label.Text = Loc.GetString(Text);
|
||||
}
|
||||
|
||||
public virtual LocId Text => throw new NotImplementedException();
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Content.Client.HealthAnalyzer.UI.Tooltips;
|
||||
|
||||
public sealed partial class StatusTooltip : StaticTooltip
|
||||
{
|
||||
public override LocId Text => "health-analyzer-status-tooltip";
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
<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>
|
||||
@@ -3,6 +3,6 @@
|
||||
Orientation="Vertical"
|
||||
RectClipContent="True"
|
||||
Margin="4">
|
||||
<RichTextLabel Name="Label" HorizontalExpand="True" />
|
||||
<RichTextLabel Access="Protected" Name="Label" HorizontalExpand="True" />
|
||||
</BoxContainer>
|
||||
</PanelContainer>
|
||||
@@ -1,3 +1,4 @@
|
||||
using Content.Shared.MedicalScanner;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
@@ -6,10 +7,15 @@ using Robust.Client.UserInterface;
|
||||
namespace Content.Client.HealthAnalyzer.UI.Tooltips;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class StatusTooltip : PanelContainer
|
||||
[Virtual]
|
||||
public partial class UpdatableTooltip : PanelContainer
|
||||
{
|
||||
public StatusTooltip()
|
||||
public UpdatableTooltip()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public virtual void Update(HealthAnalyzerScannedUserMessage msg)
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user