From 576e88bd8ce7ceeb3cf9d032fcfb841ed2771f55 Mon Sep 17 00:00:00 2001 From: rdbtCVS <87152661+rdbtCVS@users.noreply.github.com> Date: Wed, 14 Oct 2026 23:29:29 +0100 Subject: [PATCH] Zero-pad inventory effect duration fields --- crates/horizon-client/src/inventory_effects.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/horizon-client/src/inventory_effects.rs b/crates/horizon-client/src/inventory_effects.rs index 02a533867..86dca9963 100644 --- a/crates/horizon-client/src/inventory_effects.rs +++ b/crates/horizon-client/src/inventory_effects.rs @@ -60,9 +60,9 @@ pub fn panels( let seconds = (effect.duration as f32 / tick_rate) as i32; let (hours, minutes, seconds) = (seconds / 3600, seconds / 60 % 60, seconds % 60); if hours > 0 { - format!("{hours}:{minutes:02}:{seconds:02}") + format!("{hours:02}:{minutes:02}:{seconds:02}") } else { - format!("{minutes}:{seconds:02}") + format!("{minutes:02}:{seconds:02}") } }; let width = max_width.min(39 + text_width(&name).max(text_width(&duration))); @@ -207,7 +207,7 @@ mod tests { // Natural order puts shorter durations before infinite effects. assert_eq!( (&p[0].name, &p[0].duration), - (&"Speed II".into(), &"0:22".into()) + (&"Speed II".into(), &"00:22".into()) ); assert_eq!( (&p[1].name, &p[1].duration), @@ -248,7 +248,7 @@ mod tests { let p = panels(640, [222, 43], 195, &effects, 10.0, &|_| None, &|_| 60); assert_eq!((p[0].x, p[0].y), (419, 43)); assert_eq!(p[0].name, "speed"); - assert_eq!(p[0].duration, "2:00:00"); + assert_eq!(p[0].duration, "02:00:00"); let p = panels(480, [149, 37], 176, &effects, 20.0, &|_| None, &|_| 150); assert_eq!((p[0].x, p[0].width), (327, 146)); }