Geode menu is now accessible

master
shoaib11120 2022-01-06 19:08:06 +05:30
parent 12bd0bea80
commit b3657c080f
1 changed files with 25 additions and 4 deletions

View File

@ -15,6 +15,24 @@ namespace stardew_access.Patches
{
int x = Game1.getMousePosition(true).X, y = Game1.getMousePosition(true).Y; // Mouse x and y position
#region Narrate the treasure recieved on breaking the geode
if (__instance.geodeTreasure != null)
{
string name = __instance.geodeTreasure.DisplayName;
int stack = __instance.geodeTreasure.Stack;
string toSpeak = $"Recieved {stack} {name}";
if (geodeMenuQueryKey != toSpeak)
{
geodeMenuQueryKey = toSpeak;
ScreenReader.say(toSpeak, true);
}
return;
}
#endregion
#region Narrate hovered buttons in the menu
if (__instance.geodeSpot != null && __instance.geodeSpot.containsPoint(x, y))
{
string toSpeak = "Place geode here";
@ -61,7 +79,9 @@ namespace stardew_access.Patches
}
return;
}
#endregion
#region Narrate hovered item
for (int i = 0; i < __instance.inventory.inventory.Count; i++)
{
if (__instance.inventory.inventory[i].containsPoint(x, y))
@ -100,6 +120,7 @@ namespace stardew_access.Patches
return;
}
}
#endregion
}
catch (Exception e)
{