Added check for unknown recipe in crafting/cooking menu

master
Mohammad Shoaib 2022-04-05 13:13:11 +05:30
parent 53f7e3ceb0
commit 041afa68a0
2 changed files with 16 additions and 1 deletions

View File

@ -191,6 +191,9 @@ namespace stardew_access.Patches
if (Game1.activeClickableMenu is PurchaseAnimalsMenu)
return;
if (Game1.activeClickableMenu is CraftingPage)
return;
#endregion
string toSpeak = " ";

View File

@ -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;