color vitals/suit integrity red if low
This commit is contained in:
parent
b857d46119
commit
eb3353bb07
10
src/hud.rs
10
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
|
||||
|
|
Loading…
Reference in a new issue