Health analyzers now show if somebody is starving (#24789)
"why are they getting cold damage" THERE YOU GO
This commit is contained in:
committed by
GitHub
parent
d061c164fa
commit
c25ddfd638
@@ -5,6 +5,7 @@ using Content.Shared.Damage.Prototypes;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Content.Shared.MedicalScanner;
|
||||
using Content.Shared.Nutrition.Components;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
@@ -12,6 +13,7 @@ using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
@@ -85,6 +87,19 @@ namespace Content.Client.HealthAnalyzer.UI
|
||||
|
||||
DrawDiagnosticGroups(damageSortedGroups, damagePerType);
|
||||
|
||||
if (_entityManager.TryGetComponent(target, out HungerComponent? hunger)
|
||||
&& hunger.StarvationDamage != null
|
||||
&& hunger.CurrentThreshold <= HungerThreshold.Starving)
|
||||
{
|
||||
var box = new Control { Margin = new Thickness(0, 0, 0, 15) };
|
||||
|
||||
box.AddChild(CreateDiagnosticGroupTitle(
|
||||
Loc.GetString("health-analyzer-window-malnutrition"),
|
||||
"malnutrition"));
|
||||
|
||||
GroupsContainer.AddChild(box);
|
||||
}
|
||||
|
||||
SetHeight = AnalyzerHeight;
|
||||
SetWidth = AnalyzerWidth;
|
||||
}
|
||||
@@ -113,7 +128,7 @@ namespace Content.Client.HealthAnalyzer.UI
|
||||
Orientation = BoxContainer.LayoutOrientation.Vertical,
|
||||
};
|
||||
|
||||
groupContainer.AddChild(CreateDiagnosticGroupTitle(groupTitleText, damageGroupId, damageAmount.Int()));
|
||||
groupContainer.AddChild(CreateDiagnosticGroupTitle(groupTitleText, damageGroupId));
|
||||
|
||||
GroupsContainer.AddChild(groupContainer);
|
||||
|
||||
@@ -166,7 +181,7 @@ namespace Content.Client.HealthAnalyzer.UI
|
||||
};
|
||||
}
|
||||
|
||||
private BoxContainer CreateDiagnosticGroupTitle(string text, string id, int damageAmount)
|
||||
private BoxContainer CreateDiagnosticGroupTitle(string text, string id)
|
||||
{
|
||||
var rootContainer = new BoxContainer
|
||||
{
|
||||
|
||||
@@ -29,3 +29,5 @@ health-analyzer-window-damage-type-Radiation = Radiation
|
||||
|
||||
health-analyzer-window-damage-group-Genetic = Genetic
|
||||
health-analyzer-window-damage-type-Cellular = Cellular
|
||||
|
||||
health-analyzer-window-malnutrition = Severely malnourished
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -5,7 +5,7 @@
|
||||
"y": 32
|
||||
},
|
||||
"license": "CC-BY-SA-3.0",
|
||||
"copyright": "airloss, brute, toxin and burn edited from /tg/station https://github.com/tgstation/tgstation/tree/master genetic edited from https://iconscout.com/free-icon/dna-2130814 with license CC BY 4.0",
|
||||
"copyright": "airloss, brute, toxin and burn edited from /tg/station https://github.com/tgstation/tgstation/tree/master genetic edited from https://iconscout.com/free-icon/dna-2130814 with license CC BY 4.0. malnutrition from https://github.com/space-wizards/space-station-14/tree/73d7837fabb31a7691a1db47ff64903cbec5dd32/Resources/Textures/Interface/Alerts/hunger.rsi",
|
||||
"states": [
|
||||
{
|
||||
"name": "airloss"
|
||||
@@ -24,6 +24,9 @@
|
||||
},
|
||||
{
|
||||
"name": "unknown"
|
||||
},
|
||||
{
|
||||
"name": "malnutrition"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user