Mine elevator menu is accessible. Use wasd!
parent
8866e4f950
commit
dda69f6b19
|
@ -74,12 +74,12 @@ namespace stardew_access
|
|||
|
||||
harmony.Patch(
|
||||
original: AccessTools.Method(typeof(TitleMenu), nameof(TitleMenu.draw), new Type[] { typeof(SpriteBatch) }),
|
||||
postfix: new HarmonyMethod(typeof(MenuPatch), nameof(TitleMenuPatches.TitleMenuPatch))
|
||||
postfix: new HarmonyMethod(typeof(TitleMenuPatches), nameof(TitleMenuPatches.TitleMenuPatch))
|
||||
);
|
||||
|
||||
harmony.Patch(
|
||||
original: AccessTools.Method(typeof(LoadGameMenu.SaveFileSlot), nameof(LoadGameMenu.SaveFileSlot.Draw), new Type[] { typeof(SpriteBatch), typeof(int) }),
|
||||
postfix: new HarmonyMethod(typeof(MenuPatch), nameof(TitleMenuPatches.LoadGameMenuPatch))
|
||||
postfix: new HarmonyMethod(typeof(TitleMenuPatches), nameof(TitleMenuPatches.LoadGameMenuPatch))
|
||||
);
|
||||
|
||||
harmony.Patch(
|
||||
|
@ -89,7 +89,7 @@ namespace stardew_access
|
|||
|
||||
harmony.Patch(
|
||||
original: AccessTools.Method(typeof(CharacterCustomization), nameof(CharacterCustomization.draw), new Type[] { typeof(SpriteBatch) }),
|
||||
postfix: new HarmonyMethod(typeof(MenuPatch), nameof(TitleMenuPatches.NewGameMenuPatch))
|
||||
postfix: new HarmonyMethod(typeof(TitleMenuPatches), nameof(TitleMenuPatches.NewGameMenuPatch))
|
||||
);
|
||||
|
||||
harmony.Patch(
|
||||
|
@ -119,12 +119,12 @@ namespace stardew_access
|
|||
|
||||
harmony.Patch(
|
||||
original: AccessTools.Method(typeof(CoopMenu), nameof(CoopMenu.update), new Type[] { typeof(GameTime) }),
|
||||
postfix: new HarmonyMethod(typeof(MenuPatch), nameof(TitleMenuPatches.CoopMenuPatch))
|
||||
postfix: new HarmonyMethod(typeof(TitleMenuPatches), nameof(TitleMenuPatches.CoopMenuPatch))
|
||||
);
|
||||
|
||||
harmony.Patch(
|
||||
original: AccessTools.Method(typeof(ChatBox), nameof(ChatBox.update), new Type[] { typeof(GameTime) }),
|
||||
postfix: new HarmonyMethod(typeof(MenuPatch), nameof(ChatManuPatches.ChatBoxPatch))
|
||||
postfix: new HarmonyMethod(typeof(ChatManuPatches), nameof(ChatManuPatches.ChatBoxPatch))
|
||||
);
|
||||
|
||||
harmony.Patch(
|
||||
|
@ -142,6 +142,11 @@ namespace stardew_access
|
|||
postfix: new HarmonyMethod(typeof(MenuPatch), nameof(MenuPatch.NamingMenuPatch))
|
||||
);
|
||||
|
||||
harmony.Patch(
|
||||
original: AccessTools.Method(typeof(MineElevatorMenu), nameof(MineElevatorMenu.draw), new Type[] { typeof(SpriteBatch) }),
|
||||
postfix: new HarmonyMethod(typeof(MenuPatch), nameof(MenuPatch.MineElevatorMenuPatch))
|
||||
);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Custom Commands
|
||||
|
|
|
@ -113,7 +113,7 @@ namespace stardew_access.Patches
|
|||
try
|
||||
{
|
||||
// Fix for delete button hover text not narrating
|
||||
if (Game1.activeClickableMenu is TitleMenuPatches && !((Game1.activeClickableMenu as TitleMenuPatches).GetChildMenu() is CharacterCustomization))
|
||||
if (Game1.activeClickableMenu is TitleMenuPatches && !((Game1.activeClickableMenu as TitleMenu).GetChildMenu() is CharacterCustomization))
|
||||
return;
|
||||
|
||||
if (Game1.activeClickableMenu is LetterViewerMenu || Game1.activeClickableMenu is QuestLog)
|
||||
|
@ -122,7 +122,7 @@ namespace stardew_access.Patches
|
|||
if (Game1.activeClickableMenu is Billboard)
|
||||
return;
|
||||
|
||||
StringBuilder toSpeak = new StringBuilder();
|
||||
StringBuilder toSpeak = new StringBuilder(" ");
|
||||
|
||||
#region Add item count before title
|
||||
if(hoveredItem != null && hoveredItem.HasBeenInInventory)
|
||||
|
@ -201,10 +201,14 @@ namespace stardew_access.Patches
|
|||
#region Narrate toSpeak
|
||||
// To prevent it from getting conflicted by two hover texts at the same time, two seperate methods are used.
|
||||
// For example, sometimes `Welcome to Pierre's` and the items in seeds shop get conflicted causing it to speak infinitely.
|
||||
if(Context.IsPlayerFree)
|
||||
|
||||
if (toSpeak.ToString() != " ")
|
||||
{
|
||||
if (Context.IsPlayerFree)
|
||||
ScreenReader.sayWithChecker(toSpeak.ToString(), true); // Normal Checker
|
||||
else
|
||||
ScreenReader.sayWithMenuChecker(toSpeak.ToString(), true); // Normal Checker
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using StardewModdingAPI;
|
||||
using StardewValley;
|
||||
using StardewValley.Menus;
|
||||
using StardewValley.Quests;
|
||||
using static StardewValley.Menus.LoadGameMenu;
|
||||
|
||||
namespace stardew_access.Patches
|
||||
{
|
||||
|
@ -14,6 +12,26 @@ namespace stardew_access.Patches
|
|||
private static string currentDailyQuestText = " ";
|
||||
private static string currentLevelUpTitle = " ";
|
||||
|
||||
internal static void MineElevatorMenuPatch(List<ClickableComponent> ___elevators)
|
||||
{
|
||||
try
|
||||
{
|
||||
int x = Game1.getMousePosition(true).X, y = Game1.getMousePosition(true).Y; // Mouse x and y position
|
||||
for (int i=0; i<___elevators.Count; i++)
|
||||
{
|
||||
if(___elevators[i].containsPoint(x, y))
|
||||
{
|
||||
ScreenReader.sayWithMenuChecker($"{___elevators[i].name} level", true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MainClass.monitor.Log($"Unable to narrate Text:\n{e.Message}\n{e.StackTrace}", LogLevel.Error);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void NamingMenuPatch(NamingMenu __instance, string title, TextBox ___textBox)
|
||||
{
|
||||
try
|
||||
|
@ -51,8 +69,6 @@ namespace stardew_access.Patches
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
internal static void OptionsPagePatch(OptionsPage __instance)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework;
|
||||
using StardewModdingAPI;
|
||||
using StardewValley;
|
||||
using StardewValley.Menus;
|
||||
|
|
Loading…
Reference in New Issue