From c25ddfd638e2c50b541e5ebf8c2eda85778f3711 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Thu, 1 Feb 2024 07:28:17 +0100 Subject: [PATCH] Health analyzers now show if somebody is starving (#24789) "why are they getting cold damage" THERE YOU GO --- .../UI/HealthAnalyzerWindow.xaml.cs | 19 ++++++++++++++++-- .../components/health-analyzer-component.ftl | 2 ++ .../health_analyzer.rsi/malnutrition.png | Bin 0 -> 1295 bytes .../Devices/health_analyzer.rsi/meta.json | 7 +++++-- 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 Resources/Textures/Objects/Devices/health_analyzer.rsi/malnutrition.png diff --git a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs index 9e786ce436..588eb88502 100644 --- a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs +++ b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs @@ -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 { diff --git a/Resources/Locale/en-US/medical/components/health-analyzer-component.ftl b/Resources/Locale/en-US/medical/components/health-analyzer-component.ftl index 453bbdbb52..d232be5c4d 100644 --- a/Resources/Locale/en-US/medical/components/health-analyzer-component.ftl +++ b/Resources/Locale/en-US/medical/components/health-analyzer-component.ftl @@ -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 diff --git a/Resources/Textures/Objects/Devices/health_analyzer.rsi/malnutrition.png b/Resources/Textures/Objects/Devices/health_analyzer.rsi/malnutrition.png new file mode 100644 index 0000000000000000000000000000000000000000..edcfb6119b6429da582dea33e864e66d388dda78 GIT binary patch literal 1295 zcmV+q1@QWbP)Px($w@>(R9J=WmR)R9Wf;eQ1=4j}%ewB9HEIamV8O;631vf82pO2nfq*oI#CV}Z z5-+$h#>5yHW*2@&FN_)zB8d^BLl&6Xg$$)dw&e_Smd!-l)j*-!!EWm|dit?$<9Jba zvVM#VZ%oYoH|M-hp7;6x-~V%-_JtL!UlX7NH4Mb+VO z=rW(Vh>yRxj{K%3;@#aSQ`4~34xrwi&~ds~$|)pQy*0TKmqJ@ho%+hN1(Y3rfp~W} z@$PN_jOHSg{vl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oXm4-l*s)_-4tYGD zv@z1_^%xAP-~4;`?xoqg7@<&TNzqvlMKS9xu!8?B{sCp(GlJiT{uclM002ovPDHLk FV1gU{Uh4n= literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Devices/health_analyzer.rsi/meta.json b/Resources/Textures/Objects/Devices/health_analyzer.rsi/meta.json index 3fccf5c46b..bbf78c0b88 100644 --- a/Resources/Textures/Objects/Devices/health_analyzer.rsi/meta.json +++ b/Resources/Textures/Objects/Devices/health_analyzer.rsi/meta.json @@ -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" } ] -} \ No newline at end of file +}