From 3848594122a4b2cf6635177176cf1b413d0e55bf Mon Sep 17 00:00:00 2001 From: Monty Marz Date: Tue, 15 Sep 2020 13:11:05 +0200 Subject: [PATCH] fix SCT decimals not being absolutes --- voxygen/src/hud/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 7014eef8fe..dba179f910 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -1255,7 +1255,7 @@ impl Hud { + 100.0; // Timer sets text transparency let fade = ((crate::ecs::sys::floater::HP_SHOWTIME - timer) * 0.25) + 0.2; - if hp_damage < 10 { + if hp_damage.abs() < 10 { // Damage and heal below 10/10 are shown as decimals Text::new(&format!("{}", hp_damage.abs() as f32 / 10.0)) .font_size(font_size) @@ -1328,7 +1328,7 @@ impl Hud { + 0.2; if floater.hp_change.abs() < 10 { // Damage and heal below 10/10 are shown as decimals - Text::new(&format!("{}", (floater.hp_change as f32 / 10.0))) + Text::new(&format!("{}", (floater.hp_change.abs() as f32 / 10.0))) .font_size(font_size) .font_id(self.fonts.cyri.conrod_id) .color(if floater.hp_change < 0 { @@ -1339,7 +1339,7 @@ impl Hud { .x_y(0.0, y - 3.0) .position_ingame(ingame_pos) .set(sct_bg_id, ui_widgets); - Text::new(&format!("{}", (floater.hp_change as f32 / 10.0))) + Text::new(&format!("{}", (floater.hp_change.abs() as f32 / 10.0))) .font_size(font_size) .font_id(self.fonts.cyri.conrod_id) .x_y(0.0, y)