Fixed bug for Museum menu patch

master
Mohammad Shoaib Khan 2023-03-09 13:12:07 +05:30
parent 2ddebd3615
commit 8970a2c441
No known key found for this signature in database
GPG Key ID: D8040D966320B620
1 changed files with 28 additions and 23 deletions

View File

@ -88,6 +88,8 @@ namespace stardew_access.Patches
{
if (__instance.heldItem != null) return;
if (narrateHoveredButtons(__instance, x, y)) return;
int hoveredItemIndex = InventoryUtils.narrateHoveredSlotAndReturnIndex(__instance.inventory, __instance.inventory.inventory, __instance.inventory.actualInventory, x, y,
handleHighlightedItem: true, highlightedItemPrefix: "Donatable ");
if (hoveredItemIndex != -9999)
@ -99,7 +101,9 @@ namespace stardew_access.Patches
manuallyDonateItem(__instance, hoveredItemIndex);
}
}
else
}
private static bool narrateHoveredButtons(MuseumMenu __instance, int x, int y)
{
string toSpeak = "";
bool isDropItemButton = false;
@ -115,7 +119,7 @@ namespace stardew_access.Patches
}
else
{
return;
return false;
}
if (museumQueryKey != toSpeak)
@ -124,7 +128,8 @@ namespace stardew_access.Patches
MainClass.ScreenReader.Say(toSpeak, true);
if (isDropItemButton) Game1.playSound("drop_item");
}
}
return true;
}
private static void manuallyDonateItem(MuseumMenu __instance, int i)