From f346624affc75ec5987bb716a19b5f94ee1d7cd4 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 1 Apr 2024 15:41:45 +0200 Subject: [PATCH] more compact hud --- src/hud.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hud.rs b/src/hud.rs index 05b41b3..dbd5c17 100644 --- a/src/hud.rs +++ b/src/hud.rs @@ -129,7 +129,7 @@ fn setup( }; let mut bundle_fps = TextBundle::from_sections([ TextSection::new( - "帧率 ", + "OutFly Augmented Reality 电量 ", TextStyle { font: asset_server.load(FONT), font_size: settings.font_size_hud, @@ -147,7 +147,7 @@ fn setup( } ), TextSection::new( - "\n电量 ", + " 帧率 ", TextStyle { font: asset_server.load(FONT), font_size: settings.font_size_hud, @@ -387,11 +387,11 @@ fn update( if let Some(fps) = diagnostics.get(&FrameTimeDiagnosticsPlugin::FPS) { if let Some(value) = fps.smoothed() { // Update the value of the second section - text.sections[1].value = format!("{value:.0}"); + text.sections[3].value = format!("{value:.0}"); } } - let power = suit.power; - text.sections[3].value = format!("{power:}Wh"); + let power = suit.power / suit.power_max * 100.0; + text.sections[1].value = format!("{power:}%"); let oxy_percent = suit.oxygen / suit.oxygen_max * 100.0; let oxy_total = suit.oxygen * 1e6;