49 lines
1.5 KiB
C#
49 lines
1.5 KiB
C#
using StardewValley;
|
|
using StardewValley.Menus;
|
|
|
|
namespace stardew_access.Patches
|
|
{
|
|
internal class ExitPagePatch
|
|
{
|
|
internal static string exitPageQueryKey = "";
|
|
|
|
internal static void DrawPatch(ExitPage __instance)
|
|
{
|
|
try
|
|
{
|
|
if (__instance.exitToTitle.visible &&
|
|
__instance.exitToTitle.containsPoint(Game1.getMouseX(true), Game1.getMouseY(true)))
|
|
{
|
|
string toSpeak = "Exit to Title Button";
|
|
if (exitPageQueryKey != toSpeak)
|
|
{
|
|
exitPageQueryKey = toSpeak;
|
|
MainClass.ScreenReader.Say(toSpeak, true);
|
|
}
|
|
return;
|
|
}
|
|
if (__instance.exitToDesktop.visible &&
|
|
__instance.exitToDesktop.containsPoint(Game1.getMouseX(true), Game1.getMouseY(true)))
|
|
{
|
|
string toSpeak = "Exit to Desktop Button";
|
|
if (exitPageQueryKey != toSpeak)
|
|
{
|
|
exitPageQueryKey = toSpeak;
|
|
MainClass.ScreenReader.Say(toSpeak, true);
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
MainClass.ErrorLog($"Unable to narrate Text:\n{e.Message}\n{e.StackTrace}");
|
|
}
|
|
}
|
|
|
|
internal static void Cleanup()
|
|
{
|
|
exitPageQueryKey = "";
|
|
}
|
|
}
|
|
}
|