Fixed opening salvaging station not showing salvage text.

This commit is contained in:
Sam 2021-10-23 20:40:40 -04:00
parent d089a5d239
commit e70230819d
2 changed files with 14 additions and 3 deletions

View File

@ -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",

View File

@ -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,
)