From 1d7ba57de7ce7cc5ae36b1b3fcb947b2ef1b6425 Mon Sep 17 00:00:00 2001 From: MohammadHasanKargar Date: Fri, 15 Oct 2021 23:54:02 +0330 Subject: [PATCH] Add auto searching in crafting menu --- voxygen/src/hud/crafting.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/voxygen/src/hud/crafting.rs b/voxygen/src/hud/crafting.rs index bd6a325981..2c2ac2656f 100644 --- a/voxygen/src/hud/crafting.rs +++ b/voxygen/src/hud/crafting.rs @@ -937,14 +937,18 @@ impl<'a> Widget for Crafting<'a> { }; frame.set(state.ids.ingredient_frame[i], ui); //Item Image - Button::image(animate_by_pulse( + if Button::image(animate_by_pulse( &self.item_imgs.img_ids_or_not_found_img((&*item_def).into()), self.pulse, )) .w_h(22.0, 22.0) .middle_of(state.ids.ingredient_frame[i]) .with_item_tooltip(self.item_tooltip_manager, &*item_def, &None, &item_tooltip) - .set(state.ids.ingredient_img[i], ui); + .set(state.ids.ingredient_img[i], ui) + .was_clicked() + { + events.push(Event::SearchRecipe(Some(item_def.name().to_string()))); + } // Ingredients text and amount // Don't show inventory amounts above 999 to avoid the widget clipping let over9k = "99+";