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)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -239,9 +239,7 @@ public sealed partial class CrewMonitoringWindow : FancyWindow
|
||||
}
|
||||
else if (sensor.WoundableData is { } woundableSummary)
|
||||
{
|
||||
var worstRating = Math.Max((byte)woundableSummary.BloodPressureRating, Math.Max((byte)woundableSummary.BloodOxygenationRating, (byte)woundableSummary.HeartRateRating));
|
||||
var index = MathF.Round(4f * ((float)worstRating)/5f);
|
||||
specifier = new SpriteSpecifier.Rsi(new ResPath("Interface/Alerts/human_crew_monitoring.rsi"), "health" + index);
|
||||
specifier = new SpriteSpecifier.Rsi(new ResPath("Interface/Alerts/human_crew_monitoring.rsi"), $"health{(byte)woundableSummary.Ranking}");
|
||||
}
|
||||
// End Offbrand Additions
|
||||
|
||||
@@ -330,10 +328,10 @@ public sealed partial class CrewMonitoringWindow : FancyWindow
|
||||
|
||||
if (sensor.WoundableData is { } woundable)
|
||||
{
|
||||
vitalsContainer.AddChild(new RichTextLabel() { Text = Loc.GetString("offbrand-crew-monitoring-heart-rate", ("rate", woundable.HeartRate), ("rating", woundable.HeartRateRating)) });
|
||||
vitalsContainer.AddChild(new RichTextLabel() { Text = Loc.GetString("offbrand-crew-monitoring-heart-rate", ("rate", woundable.HeartRate)) });
|
||||
var (systolic, diastolic) = woundable.BloodPressure;
|
||||
vitalsContainer.AddChild(new RichTextLabel() { Text = Loc.GetString("offbrand-crew-monitoring-blood-pressure", ("systolic", systolic), ("diastolic", diastolic), ("rating", woundable.BloodPressureRating)) });
|
||||
vitalsContainer.AddChild(new RichTextLabel() { Text = Loc.GetString("offbrand-crew-monitoring-oxygenation", ("oxygenation", $"{woundable.BloodOxygenation * 100:F1}"), ("rating", woundable.BloodOxygenationRating)) });
|
||||
vitalsContainer.AddChild(new RichTextLabel() { Text = Loc.GetString("offbrand-crew-monitoring-blood-pressure", ("systolic", systolic), ("diastolic", diastolic)) });
|
||||
vitalsContainer.AddChild(new RichTextLabel() { Text = Loc.GetString("offbrand-crew-monitoring-spo2", ("value", $"{woundable.Spo2 * 100:F1}"), ("spo2", woundable.Spo2Name)) });
|
||||
}
|
||||
|
||||
mainContainer.AddChild(vitalsContainer);
|
||||
|
||||
@@ -34,7 +34,7 @@ public sealed class DamageOverlayUiController : UIController
|
||||
SubscribeLocalEvent<LocalPlayerDetachedEvent>(OnPlayerDetached);
|
||||
SubscribeLocalEvent<MobStateChangedEvent>(OnMobStateChanged);
|
||||
SubscribeLocalEvent<MobThresholdChecked>(OnThresholdCheck);
|
||||
SubscribeLocalEvent<bPotentiallyUpdateDamageOverlayEventb>(OnPotentiallyUpdateDamageOverlay); // Offbrand
|
||||
SubscribeLocalEvent<PotentiallyUpdateDamageOverlayEvent>(OnPotentiallyUpdateDamageOverlay); // Offbrand
|
||||
}
|
||||
|
||||
private void OnPlayerAttach(LocalPlayerAttachedEvent args)
|
||||
@@ -86,7 +86,7 @@ public sealed class DamageOverlayUiController : UIController
|
||||
TryUpdateWoundableOverlays(entity);
|
||||
}
|
||||
|
||||
private void OnPotentiallyUpdateDamageOverlay(ref bPotentiallyUpdateDamageOverlayEventb args)
|
||||
private void OnPotentiallyUpdateDamageOverlay(ref PotentiallyUpdateDamageOverlayEvent args)
|
||||
{
|
||||
if (args.Target != _playerManager.LocalEntity)
|
||||
return;
|
||||
@@ -113,7 +113,7 @@ public sealed class DamageOverlayUiController : UIController
|
||||
{
|
||||
_overlay.CritLevel = FixedPoint2.Clamp(brainDamage.Damage / maxBrain, 0, 1).Float();
|
||||
_overlay.PainLevel = FixedPoint2.Clamp(_pain.GetShock((entity, pain)) / maxShock, 0, 1).Float();
|
||||
_overlay.OxygenLevel = FixedPoint2.Clamp(1 - _heart.BloodOxygenation((entity, heartrate)), 0, 1).Float();
|
||||
_overlay.OxygenLevel = FixedPoint2.Clamp(1 - _heart.Spo2((entity, heartrate)), 0, 1).Float();
|
||||
_overlay.DeadLevel = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ public sealed class HeartrateOverlay : Overlay
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototype = default!;
|
||||
|
||||
private readonly HeartSystem _heart;
|
||||
private readonly SharedTransformSystem _transform;
|
||||
private readonly SpriteSystem _sprite;
|
||||
private readonly StatusIconSystem _statusIcon;
|
||||
@@ -32,6 +33,7 @@ public sealed class HeartrateOverlay : Overlay
|
||||
private static readonly SpriteSpecifier HudPoor = new SpriteSpecifier.Rsi(new("/Textures/_Offbrand/heart_rate_hud.rsi"), "hud_poor");
|
||||
private static readonly SpriteSpecifier HudBad = new SpriteSpecifier.Rsi(new("/Textures/_Offbrand/heart_rate_hud.rsi"), "hud_bad");
|
||||
private static readonly SpriteSpecifier HudDanger = new SpriteSpecifier.Rsi(new("/Textures/_Offbrand/heart_rate_hud.rsi"), "hud_danger");
|
||||
private static readonly IReadOnlyList<SpriteSpecifier> Severities = new List<SpriteSpecifier>() { HudGood, HudOkay, HudPoor, HudBad, HudDanger };
|
||||
|
||||
public HeartrateOverlay()
|
||||
{
|
||||
@@ -40,19 +42,17 @@ public sealed class HeartrateOverlay : Overlay
|
||||
_transform = _entityManager.System<SharedTransformSystem>();
|
||||
_sprite = _entityManager.System<SpriteSystem>();
|
||||
_statusIcon = _entityManager.System<StatusIconSystem>();
|
||||
_heart = _entityManager.System<HeartSystem>();
|
||||
}
|
||||
|
||||
private SpriteSpecifier GetIcon(Entity<HeartrateComponent> ent)
|
||||
{
|
||||
var strain = ent.Comp.Strain;
|
||||
return strain.Double() switch {
|
||||
_ when !ent.Comp.Running => HudStopped,
|
||||
>= 4 => HudDanger,
|
||||
>= 3 => HudBad,
|
||||
>= 2 => HudPoor,
|
||||
>= 1 => HudOkay,
|
||||
_ => HudGood,
|
||||
};
|
||||
if (!ent.Comp.Running)
|
||||
return HudStopped;
|
||||
|
||||
var max = 4;
|
||||
var severity = Math.Min((int)Math.Round(max * _heart.Strain(ent)), max);
|
||||
return Severities[severity];
|
||||
}
|
||||
|
||||
protected override void Draw(in OverlayDrawArgs args)
|
||||
Reference in New Issue
Block a user