Delete Farm pop up is accessible now

master
shoaib11120 2021-12-30 19:46:07 +05:30
parent 2806267b60
commit cb8a28fa46
1 changed files with 20 additions and 3 deletions

View File

@ -123,7 +123,6 @@ namespace stardew_access.Patches
#region Join/Host Button (Important! This should be checked before checking other buttons) #region Join/Host Button (Important! This should be checked before checking other buttons)
if (__instance.slotButtons[0].containsPoint(x, y)) if (__instance.slotButtons[0].containsPoint(x, y))
{ {
MainClass.monitor.Log($"here", LogLevel.Debug);
if (___currentTab == CoopMenu.Tab.JOIN_TAB) if (___currentTab == CoopMenu.Tab.JOIN_TAB)
toSpeak = "Join lan game"; toSpeak = "Join lan game";
if (___currentTab == CoopMenu.Tab.HOST_TAB) if (___currentTab == CoopMenu.Tab.HOST_TAB)
@ -581,17 +580,35 @@ namespace stardew_access.Patches
{ {
try try
{ {
if (___menu.slotButtons[i].containsPoint(Game1.getMousePosition(true).X, Game1.getMousePosition(true).Y)) int x = Game1.getMousePosition(true).X, y = Game1.getMousePosition(true).Y;
if (___menu.slotButtons[i].containsPoint(x, y))
{ {
if (__instance.Farmer != null) if (__instance.Farmer != null)
{ {
#region Farms #region Farms
if (Game1.activeClickableMenu is LoadGameMenu && ___menu.deleteButtons[i].containsPoint(Game1.getMousePosition(true).X, Game1.getMousePosition(true).Y)) if (___menu.deleteButtons.Count > 0 && ___menu.deleteButtons[i].containsPoint(x, y))
{ {
ScreenReader.sayWithChecker($"Delete {__instance.Farmer.farmName} Farm", true); ScreenReader.sayWithChecker($"Delete {__instance.Farmer.farmName} Farm", true);
return; return;
} }
if (___menu.deleteConfirmationScreen)
{
// Used diff. functions to narrate to prevent it from speaking the message again on selecting another button.
string message = "Really delete farm?";
ScreenReader.sayWithChecker(message, true);
if (___menu.okDeleteButton.containsPoint(x, y))
{
ScreenReader.sayWithMenuChecker("Ok Button", false);
}
else if (___menu.cancelDeleteButton.containsPoint(x, y))
{
ScreenReader.sayWithMenuChecker("Cancel Button", false);
}
return;
}
String farmerName = __instance.Farmer.displayName; String farmerName = __instance.Farmer.displayName;
String farmName = __instance.Farmer.farmName; String farmName = __instance.Farmer.farmName;
String money = __instance.Farmer.Money.ToString(); String money = __instance.Farmer.Money.ToString();