diff --git a/src/hud.rs b/src/hud.rs index 5b36a74..044f0c4 100644 --- a/src/hud.rs +++ b/src/hud.rs @@ -218,6 +218,7 @@ fn setup( TextSection::new("", style.clone()), TextSection::new("\nVitals ", style.clone()), TextSection::new("", style.clone()), + TextSection::new("", style.clone()), // Speed TextSection::new("", style.clone()), // Target ]).with_style(Style { position_type: PositionType::Absolute, @@ -451,6 +452,10 @@ fn update_hud( "".to_string() }; let gforce = gforce.gforce; + let speed = cam_v.length(); + let speed_readable = nature::readable_distance(speed); + text.sections[14].value = format!("\n{speed_readable}/s\n{gforce:.1}g{dev_speed}"); + if let Ok((clickable, _, target_v_maybe)) = q_target.get_single() { let distance = if dist_scalar.is_nan() { "UNKNOWN".to_string() @@ -466,12 +471,10 @@ fn update_hud( }; let speed_readable = nature::readable_distance(speed); let target_name = clickable.name.clone().unwrap_or("Unnamed".to_string()); - text.sections[14].value = format!("\n\nTarget: {target_name}\nDistance: {distance}\nΔv {speed_readable}/s + {gforce:.1}g{dev_speed}"); + text.sections[15].value = format!("\n\nTarget: {target_name}\nDistance: {distance}\nΔv {speed_readable}/s"); } else { - let speed = cam_v.length(); - let speed_readable = nature::readable_distance(speed); - text.sections[14].value = format!("\nv {speed_readable}/s + {gforce:.1}g{dev_speed}"); + text.sections[15].value = "".to_string(); } } }