From cd774780c4c7943ee8195d06b0d314d7904e987c Mon Sep 17 00:00:00 2001 From: Pfauenauge90 <44173739+Pfauenauge90@users.noreply.github.com> Date: Fri, 17 Jan 2020 23:16:50 +0100 Subject: [PATCH] darkened button for unavailabe charge --- voxygen/src/hud/skillbar.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/voxygen/src/hud/skillbar.rs b/voxygen/src/hud/skillbar.rs index 2422c8b3d5..2048ca37cf 100644 --- a/voxygen/src/hud/skillbar.rs +++ b/voxygen/src/hud/skillbar.rs @@ -733,7 +733,11 @@ impl<'a> Widget for Skillbar<'a> { // TODO: Changeable slot image Image::new(self.imgs.charge) .w_h(18.0 * scale, 18.0 * scale) - //.color(Some(BG_COLOR)) + .color(if self.energy.current() as f64 >= 200.0 { + Some(Color::Rgba(1.0, 1.0, 1.0, 1.0)) + } else { + Some(Color::Rgba(0.4, 0.4, 0.4, 1.0)) + }) .middle_of(state.ids.slot1_bg) .set(state.ids.slot1_icon, ui); // Slot 6 @@ -915,8 +919,8 @@ impl<'a> Widget for Skillbar<'a> { .set(state.ids.health_text, ui); let energy_text = format!( "{}/{}", - self.energy.current() as u32, - self.energy.maximum() as u32 + self.energy.current() as u32 / 10, + self.energy.maximum() as u32 / 10 ); Text::new(&energy_text) .mid_top_with_margin_on(state.ids.energybar_bg, 6.0 * scale)