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;