From 6f984ca181c9b8373fa686a8cc770d1a1f5f9ab8 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 13 May 2019 14:58:01 +0100 Subject: [PATCH] Added figure colour to shader and health component Former-commit-id: e2c23e5132991cc436a678af43782e31ffc55516 --- voxygen/src/scene/figure.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/voxygen/src/scene/figure.rs b/voxygen/src/scene/figure.rs index 39ddc2790e..9fab0d5f8b 100644 --- a/voxygen/src/scene/figure.rs +++ b/voxygen/src/scene/figure.rs @@ -396,6 +396,16 @@ impl FigureMgr { .map(|(change_by, change_time)| Rgba::new(1.0, 0.7, 0.7, 1.0)) .unwrap_or(Rgba::broadcast(1.0)); + // Change in health as color! + let col = stats + .and_then(|stats| stats.hp.last_change) + .map(|(change_by, change_time)| { + Rgba::new(1.0, 0.7, 0.7, 1.0) + }) + .unwrap_or(Rgba::broadcast(1.0)); + + state.update(renderer, pos.0, dir.0, col); + state.update(renderer, pos.0, dir.0, col); } },