From e70230819de04955c868e6ac9d8be5dbe317e9f5 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 23 Oct 2021 20:40:40 -0400 Subject: [PATCH] Fixed opening salvaging station not showing salvage text. --- common/src/comp/inventory/item/mod.rs | 4 ++-- voxygen/src/hud/crafting.rs | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index 19a38f3a00..7919bb4852 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -184,13 +184,13 @@ impl Material { | Material::Hardwood | Material::Ironwood | Material::Frostwood - | Material::Eldwood => unreachable!(), + | Material::Eldwood => unimplemented!(), Material::Rock | Material::Granite | Material::Bone | Material::Basalt | Material::Obsidian - | Material::Velorite => unreachable!(), + | Material::Velorite => unimplemented!(), Material::Linen => "common.items.crafting_ing.cloth.linen", Material::Wool => "common.items.crafting_ing.cloth.wool", Material::Silk => "common.items.crafting_ing.cloth.silk", diff --git a/voxygen/src/hud/crafting.rs b/voxygen/src/hud/crafting.rs index c83b14d9a5..e548c60a00 100644 --- a/voxygen/src/hud/crafting.rs +++ b/voxygen/src/hud/crafting.rs @@ -583,6 +583,11 @@ impl<'a> Widget for Crafting<'a> { if state.selected_recipe.as_ref() == Some(name) { state.update(|s| s.selected_recipe = None); } else { + if matches!(self.show.crafting_tab, CraftingTab::Dismantle) { + // If current tab is dismantle, and recipe is selected, change to general + // tab, as in dismantle tab recipe gets deselected + events.push(Event::ChangeCraftingTab(CraftingTab::All)); + } state.update(|s| s.selected_recipe = Some(name.clone())); } } @@ -641,6 +646,12 @@ impl<'a> Widget for Crafting<'a> { } } + // Deselect recipe if current tab is dismantle, elsewhere if recipe selected + // while dismantling, tab is changed to general + if matches!(self.show.crafting_tab, CraftingTab::Dismantle) { + state.update(|s| s.selected_recipe = None); + } + // Selected Recipe if let Some((recipe_name, recipe)) = state .selected_recipe @@ -959,7 +970,7 @@ impl<'a> Widget for Crafting<'a> { .hover_image(self.imgs.wpn_icon_border_mo) .with_item_tooltip( self.item_tooltip_manager, - vec![&*item_def], + core::iter::once(&*item_def as &dyn ItemDesc), &None, &item_tooltip, )