From 393d113dfb79fc724e2281d379e510c0cb03f941 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 13 Oct 2026 23:02:59 +0200 Subject: [PATCH] Merchant screen: the restock tooltip over an out-of-stock result Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/game/trading.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/crates/horizon-client/src/game/trading.rs b/crates/horizon-client/src/game/trading.rs index 4f9a6e6ec..125bd332d 100644 --- a/crates/horizon-client/src/game/trading.rs +++ b/crates/horizon-client/src/game/trading.rs @@ -771,8 +771,27 @@ impl Game<'_> { tooltip = self.slot_mut(slot).clone(); } } + // An out-of-stock trade: "the villager needs to restock" over the + // result (isHovering(186, 35, 22, 21), canRestock). + let deprecated = progress + && offers.get(shop).is_some_and(MerchantOffer::out_of_stock) + && local.0 >= 186.0 + SHIFT - 1.0 + && local.0 < 186.0 + SHIFT + 22.0 + 1.0 + && local.1 >= 35.0 - 1.0 + && local.1 < 35.0 + 21.0 + 1.0; if let Some(stack) = self.carried.clone() { self.draw_item(batch, &stack, self.cursor.0 - 8.0, self.cursor.1 - 8.0); + } else if deprecated { + let text = self + .res + .stations + .enchantments + .translate("merchant.deprecated") + .unwrap_or("Villagers restock up to two times per day.") + .to_owned(); + let lines: Vec<(String, u32)> = + text.split('\n').map(|l| (l.to_owned(), u32::MAX)).collect(); + self.draw_tooltip_lines(batch, &lines, self.cursor.0, self.cursor.1); } else if let Some(stack) = tooltip { let lines = self.stack_tooltip(&stack); self.draw_tooltip_lines(batch, &lines, self.cursor.0, self.cursor.1);