From eb3353bb07f1580d05f3b4f90f7698326c719166 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 15 Apr 2024 02:32:30 +0200 Subject: [PATCH] color vitals/suit integrity red if low --- src/hud.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/hud.rs b/src/hud.rs index 367c63a..2625935 100644 --- a/src/hud.rs +++ b/src/hud.rs @@ -318,10 +318,20 @@ fn update_hud( //text.sections[11].value = format!("{adrenaline:.0}pg/mL"); let vitals = 100.0 * hp.current / hp.max; text.sections[13].value = format!("{vitals:.0}%"); + if vitals < 50.0 { + text.sections[13].style.color = Color::MAROON; + } else { + text.sections[13].style.color = Color::GRAY; + } let all_actors = query_all_actors.iter().len(); text.sections[9].value = format!("{all_actors:.0}"); let integrity = suit.integrity * 100.0; text.sections[11].value = format!("{integrity:.0}%"); + if integrity < 50.0 { + text.sections[11].style.color = Color::MAROON; + } else { + text.sections[11].style.color = Color::GRAY; + } //text.sections[17].value = format!("{speed_readable}/s / {kmh:.0}km/h / {gforce:.1}g"); // Target display