From e49ff28640c5858c12b365feb6197699c079f9f9 Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 2 Apr 2024 07:17:56 +0200 Subject: [PATCH] better display of coordinates --- src/hud.rs | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/hud.rs b/src/hud.rs index 9725855..d3fa90f 100644 --- a/src/hud.rs +++ b/src/hud.rs @@ -164,6 +164,24 @@ fn setup( ..default() } ), + TextSection::new( + "\n木星中心 ", + TextStyle { + font: asset_server.load(FONT), + font_size: settings.font_size_hud, + color: Color::GRAY, + ..default() + }, + ), + TextSection::new( + "", + TextStyle { + font: asset_server.load(FONT), + font_size: settings.font_size_hud, + color: Color::GRAY, + ..default() + } + ), TextSection::new( "\n氧 OXYGEN ", TextStyle { @@ -218,24 +236,6 @@ fn setup( ..default() } ), - TextSection::new( - "\n位置 ", - TextStyle { - font: asset_server.load(FONT), - font_size: settings.font_size_hud, - color: Color::GRAY, - ..default() - }, - ), - TextSection::new( - "", - TextStyle { - font: asset_server.load(FONT), - font_size: settings.font_size_hud, - color: Color::GRAY, - ..default() - } - ), TextSection::new( "\nSuit Integrity ", TextStyle { @@ -416,17 +416,17 @@ fn update( // the remaining oxygen hud info ignores leaking suits from low integrity if suit.oxygen > nature::OXY_H { let oxy_hour = suit.oxygen / nature::OXY_H; - text.sections[5].value = format!("{oxy_percent:.1}% [{oxy_total:.0}mg] [lasts {oxy_hour:.1} hours]"); + text.sections[7].value = format!("{oxy_percent:.1}% [{oxy_total:.0}mg] [lasts {oxy_hour:.1} hours]"); } else { let oxy_min = suit.oxygen / nature::OXY_M; - text.sections[5].value = format!("{oxy_percent:.1}% [{oxy_total:.0}mg] [lasts {oxy_min:.1} min]"); + text.sections[7].value = format!("{oxy_percent:.1}% [{oxy_total:.0}mg] [lasts {oxy_min:.1} min]"); } let adrenaline = lifeform.adrenaline * 990.0 + 10.0; - text.sections[7].value = format!("{adrenaline:.0}pg/mL"); + text.sections[9].value = format!("{adrenaline:.0}pg/mL"); let all_actors = query_all_actors.iter().len(); - text.sections[9].value = format!("{all_actors:.0}"); - let (x, y, z) = (pos.x, pos.y, pos.z); - text.sections[11].value = format!("{x:.0}|{z:.0}|{y:.0}"); + text.sections[11].value = format!("{all_actors:.0}"); + let (x, y, z) = (pos.x / 1.0e3, pos.y / 1.0e3, pos.z / 1.0e3); + text.sections[5].value = format!("{x:.0}km / {z:.0}km / {y:.0}km"); let integrity = suit.integrity * 100.0; text.sections[13].value = format!("{integrity:.0}%"); let speed = cam_v.length();