Fixed bug in crafting/cooking menu

master
Mohammad Shoaib 2022-04-08 15:50:57 +05:30
parent 025956f66c
commit 8bd44fe360
1 changed files with 27 additions and 13 deletions

View File

@ -1031,19 +1031,7 @@ namespace stardew_access.Patches
#endregion
#region Narrate hovered recipe
if (___hoverRecipe == null)
{
string query = $"unknown recipe:{__instance.getCurrentlySnappedComponent().myID}";
if (craftingPageQueryKey != query)
{
craftingPageQueryKey = query;
gameMenuQueryKey = "";
hoveredItemQueryKey = "";
MainClass.GetScreenReader().Say("unknown recipe", true);
}
}
else
if (___hoverRecipe != null)
{
string name = ___hoverRecipe.DisplayName;
int numberOfProduce = ___hoverRecipe.numberProducedPerCraft;
@ -1119,6 +1107,32 @@ namespace stardew_access.Patches
}
return;
}
else
{
var isRecipeInFocus = false;
foreach (var item in __instance.pagesOfCraftingRecipes[___currentCraftingPage])
{
if (item.Key.containsPoint(x, y))
{
isRecipeInFocus = true;
break;
}
}
if (isRecipeInFocus)
{
string query = $"unknown recipe:{__instance.getCurrentlySnappedComponent().myID}";
if (craftingPageQueryKey != query)
{
craftingPageQueryKey = query;
gameMenuQueryKey = "";
hoveredItemQueryKey = "";
MainClass.GetScreenReader().Say("unknown recipe", true);
}
return;
}
}
#endregion
#region Narrate hovered item