From 041afa68a0aa8efef8353f6b70622783ebf1f6f0 Mon Sep 17 00:00:00 2001 From: Mohammad Shoaib Date: Tue, 5 Apr 2022 13:13:11 +0530 Subject: [PATCH] Added check for unknown recipe in crafting/cooking menu --- stardew-access/Patches/DialoguePatches.cs | 3 +++ stardew-access/Patches/GameMenuPatches.cs | 14 +++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/stardew-access/Patches/DialoguePatches.cs b/stardew-access/Patches/DialoguePatches.cs index 21ad188..37ecb6d 100644 --- a/stardew-access/Patches/DialoguePatches.cs +++ b/stardew-access/Patches/DialoguePatches.cs @@ -191,6 +191,9 @@ namespace stardew_access.Patches if (Game1.activeClickableMenu is PurchaseAnimalsMenu) return; + + if (Game1.activeClickableMenu is CraftingPage) + return; #endregion string toSpeak = " "; diff --git a/stardew-access/Patches/GameMenuPatches.cs b/stardew-access/Patches/GameMenuPatches.cs index 062e241..742171e 100644 --- a/stardew-access/Patches/GameMenuPatches.cs +++ b/stardew-access/Patches/GameMenuPatches.cs @@ -1031,7 +1031,19 @@ namespace stardew_access.Patches #endregion #region Narrate hovered recipe - if (___hoverRecipe != null) + if (___hoverRecipe == null) + { + string query = $"unknown recipe:{__instance.getCurrentlySnappedComponent().myID}"; + + if (craftingPageQueryKey != query) + { + craftingPageQueryKey = query; + gameMenuQueryKey = ""; + hoveredItemQueryKey = ""; + MainClass.GetScreenReader().Say("unknown recipe", true); + } + } + else { string name = ___hoverRecipe.DisplayName; int numberOfProduce = ___hoverRecipe.numberProducedPerCraft;