From 709b6a9aae00ca5768b122363515d751f5d93c65 Mon Sep 17 00:00:00 2001 From: Isse Date: Sat, 21 Jan 2023 02:40:32 +0100 Subject: [PATCH] Fixed armor stat diff display --- CHANGELOG.md | 1 + voxygen/src/ui/widgets/item_tooltip.rs | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e331cb3f1..6d6512a5bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Doors - Debug hitboxes now scale with the `Scale` component - Potion quaffing no longer makes characters practically immortal. +- Stat diff now displays correctly for armor ## [0.14.0] - 2023-01-07 diff --git a/voxygen/src/ui/widgets/item_tooltip.rs b/voxygen/src/ui/widgets/item_tooltip.rs index d7c7c5d8c5..50b39a0f21 100644 --- a/voxygen/src/ui/widgets/item_tooltip.rs +++ b/voxygen/src/ui/widgets/item_tooltip.rs @@ -925,9 +925,9 @@ impl<'a> Widget for ItemTooltip<'a> { util::protec2string(p_diff) ); diff_text(text, protection_diff.1, index); - index += armor_stats.protection.is_some() as usize; } } + index += armor_stats.protection.is_some() as usize; if let Some(p_r_diff) = diff.poise_resilience { if p_r_diff != Protection::Normal(0.0) { @@ -937,34 +937,34 @@ impl<'a> Widget for ItemTooltip<'a> { util::protec2string(p_r_diff) ); diff_text(text, poise_res_diff.1, index); - index += armor_stats.poise_resilience.is_some() as usize; } } + index += armor_stats.poise_resilience.is_some() as usize; if let Some(e_m_diff) = diff.energy_max { if e_m_diff.abs() > Energy::ENERGY_EPSILON { let text = format!("{} {:.1}", &energy_max_diff.0, e_m_diff); diff_text(text, energy_max_diff.1, index); - index += armor_stats.energy_max.is_some() as usize; } } + index += armor_stats.energy_max.is_some() as usize; if let Some(e_r_diff) = diff.energy_reward { if e_r_diff.abs() > Energy::ENERGY_EPSILON { let text = format!("{} {:.1}", &energy_reward_diff.0, e_r_diff * 100.0); diff_text(text, energy_reward_diff.1, index); - index += armor_stats.energy_reward.is_some() as usize; } } + index += armor_stats.energy_reward.is_some() as usize; if let Some(c_p_diff) = diff.crit_power { if c_p_diff != 0.0_f32 { let text = format!("{} {:.3}", &crit_power_diff.0, c_p_diff); diff_text(text, crit_power_diff.1, index); - index += armor_stats.crit_power.is_some() as usize; } } + index += armor_stats.crit_power.is_some() as usize; if let Some(s_diff) = diff.stealth { if s_diff != 0.0_f32 {