From 7a5b7cb4789772795a0fcd14c9b4b5472f499af7 Mon Sep 17 00:00:00 2001 From: Enrico Marconi Date: Mon, 12 Oct 2020 17:41:17 +0200 Subject: [PATCH] Fix issue #788 Missing items in the 'require' section are now shown in red. --- voxygen/src/hud/crafting.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/voxygen/src/hud/crafting.rs b/voxygen/src/hud/crafting.rs index 0532dd06d2..337e83662d 100644 --- a/voxygen/src/hud/crafting.rs +++ b/voxygen/src/hud/crafting.rs @@ -393,7 +393,7 @@ impl<'a> Widget for Crafting<'a> { for (i, (item_def, amount)) in recipe.inputs.iter().enumerate() { // Grey color for images and text if their amount is too low to craft the item let item_count_in_inventory = self.inventory.item_count(item_def); - let col = if item_count_in_inventory >= u64::from(*amount) { + let col = if item_count_in_inventory >= u64::from(*amount) && *amount != 0 { TEXT_COLOR } else { TEXT_DULL_RED_COLOR @@ -459,7 +459,7 @@ impl<'a> Widget for Crafting<'a> { .down_from(state.ids.ingredient_frame[i - 1], 20.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(14)) - .color(col) + .color(TEXT_COLOR) .set(state.ids.req_text[i], ui); Text::new(&item_def.name()) .right_from(state.ids.ingredient_frame[i], 10.0)