Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update. #119

Merged
merged 14 commits into from
Oct 27, 2024
Merged
3 changes: 1 addition & 2 deletions Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@

<PanelContainer Name="AlertsDivider" Visible="False" StyleClasses="LowDivider" />

<BoxContainer Name="AlertsContainer" Visible="False" Margin="0 5" Orientation="Horizontal"
HorizontalExpand="True" HorizontalAlignment="Center">
<BoxContainer Name="AlertsContainer" Visible="False" Margin="0 5" Orientation="Vertical" HorizontalAlignment="Center">

</BoxContainer>

Expand Down
25 changes: 18 additions & 7 deletions Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,29 @@ public void Populate(HealthAnalyzerScannedUserMessage msg)

// Alerts

AlertsDivider.Visible = msg.Bleeding == true;
AlertsContainer.Visible = msg.Bleeding == true;
var showAlerts = msg.Unrevivable == true || msg.Bleeding == true;

if (msg.Bleeding == true)
{
AlertsDivider.Visible = showAlerts;
AlertsContainer.Visible = showAlerts;

if (showAlerts)
AlertsContainer.DisposeAllChildren();
AlertsContainer.AddChild(new Label

if (msg.Unrevivable == true)
AlertsContainer.AddChild(new RichTextLabel
{
Text = Loc.GetString("health-analyzer-window-entity-unrevivable-text"),
Margin = new Thickness(0, 4),
MaxWidth = 300
});

if (msg.Bleeding == true)
AlertsContainer.AddChild(new RichTextLabel
{
Text = Loc.GetString("health-analyzer-window-entity-bleeding-text"),
FontColorOverride = Color.Red,
Margin = new Thickness(0, 4),
MaxWidth = 300
});
}

// Damage Groups

Expand Down
1 change: 1 addition & 0 deletions Content.Server/Medical/CryoPodSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ private void OnActivateUI(Entity<CryoPodComponent> entity, ref AfterActivatableU
? bloodSolution.FillFraction
: 0,
null,
null,
null
));
}
Expand Down
8 changes: 7 additions & 1 deletion Content.Server/Medical/HealthAnalyzerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Server.Medical.Components;
using Content.Server.PowerCell;
using Content.Server.Temperature.Components;
using Content.Server.Traits.Assorted;
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Damage;
using Content.Shared.DoAfter;
Expand Down Expand Up @@ -196,6 +197,7 @@ public void UpdateScannedUser(EntityUid healthAnalyzer, EntityUid target, bool s

var bloodAmount = float.NaN;
var bleeding = false;
var unrevivable = false;

if (TryComp<BloodstreamComponent>(target, out var bloodstream) &&
_solutionContainerSystem.ResolveSolution(target, bloodstream.BloodSolutionName,
Expand All @@ -205,12 +207,16 @@ public void UpdateScannedUser(EntityUid healthAnalyzer, EntityUid target, bool s
bleeding = bloodstream.BleedAmount > 0;
}

if (HasComp<UnrevivableComponent>(target))
unrevivable = true;

_uiSystem.ServerSendUiMessage(healthAnalyzer, HealthAnalyzerUiKey.Key, new HealthAnalyzerScannedUserMessage(
GetNetEntity(target),
bodyTemperature,
bloodAmount,
scanMode,
bleeding
bleeding,
unrevivable
));
}
}
4 changes: 3 additions & 1 deletion Content.Server/Nutrition/EntitySystems/CreamPieSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ public override void Initialize()

protected override void SplattedCreamPie(EntityUid uid, CreamPieComponent creamPie)
{
_audio.PlayPvs(_audio.GetSound(creamPie.Sound), uid, AudioParams.Default.WithVariation(0.125f));
// The entity is deleted, so play the sound at its position rather than parenting
var coordinates = Transform(uid).Coordinates;
_audio.PlayPvs(_audio.GetSound(creamPie.Sound), coordinates, AudioParams.Default.WithVariation(0.125f));

if (EntityManager.TryGetComponent(uid, out FoodComponent? foodComp))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ public sealed class HealthAnalyzerScannedUserMessage : BoundUserInterfaceMessage
public float BloodLevel;
public bool? ScanMode;
public bool? Bleeding;
public bool? Unrevivable;

public HealthAnalyzerScannedUserMessage(NetEntity? targetEntity, float temperature, float bloodLevel, bool? scanMode, bool? bleeding)
public HealthAnalyzerScannedUserMessage(NetEntity? targetEntity, float temperature, float bloodLevel, bool? scanMode, bool? bleeding, bool? unrevivable)
{
TargetEntity = targetEntity;
Temperature = temperature;
BloodLevel = bloodLevel;
ScanMode = scanMode;
Bleeding = bleeding;
Unrevivable = unrevivable;
}
}

14 changes: 14 additions & 0 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3961,3 +3961,17 @@
id: 7554
time: '2024-10-26T04:00:49.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/32819
- author: SaphireLattice
changes:
- message: Added a warning about unrevivability in the health analyzer UI.
type: Add
id: 7555
time: '2024-10-26T17:22:09.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/32636
- author: slarticodefast
changes:
- message: Fixed pie throwing sound not playing.
type: Fix
id: 7556
time: '2024-10-27T04:25:55.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/33017
2 changes: 1 addition & 1 deletion Resources/Credits/GitHub.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ health-analyzer-window-entity-damage-total-text = Total Damage:
health-analyzer-window-damage-group-text = {$damageGroup}: {$amount}
health-analyzer-window-damage-type-text = {$damageType}: {$amount}

health-analyzer-window-entity-bleeding-text = Patient is bleeding!
health-analyzer-window-entity-unrevivable-text = [color=red]Unique body composition detected! Patient can not be resuscitated by normal means![/color]
health-analyzer-window-entity-bleeding-text = [color=red]Patient is bleeding![/color]

health-analyzer-window-scan-mode-text = Scan Mode:
health-analyzer-window-scan-mode-active = Active
Expand Down
1 change: 0 additions & 1 deletion Resources/Prototypes/Datasets/Names/last.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@
- Howe
- Huey
- Hughes
- Hujsak
- Hunt
- Hunter
- Hussain
Expand Down
Loading