Patching tailoring menu
parent
a1a7ed9281
commit
a19186d30d
|
@ -175,6 +175,11 @@ namespace stardew_access
|
||||||
original: AccessTools.Method(typeof(ChooseFromListMenu), nameof(ChooseFromListMenu.draw), new Type[] { typeof(SpriteBatch) }),
|
original: AccessTools.Method(typeof(ChooseFromListMenu), nameof(ChooseFromListMenu.draw), new Type[] { typeof(SpriteBatch) }),
|
||||||
postfix: new HarmonyMethod(typeof(MenuPatches), nameof(MenuPatches.ChooseFromListMenuPatch))
|
postfix: new HarmonyMethod(typeof(MenuPatches), nameof(MenuPatches.ChooseFromListMenuPatch))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
harmony.Patch(
|
||||||
|
original: AccessTools.Method(typeof(TailoringMenu), nameof(TailoringMenu.draw), new Type[] { typeof(SpriteBatch) }),
|
||||||
|
postfix: new HarmonyMethod(typeof(MenuPatches), nameof(MenuPatches.TailoringMenuPatch))
|
||||||
|
);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Quest Patches
|
#region Quest Patches
|
||||||
|
|
|
@ -15,6 +15,53 @@ namespace stardew_access.Patches
|
||||||
private static string animalQueryMenuQuery = " ";
|
private static string animalQueryMenuQuery = " ";
|
||||||
public static Vector2? prevTile = null;
|
public static Vector2? prevTile = null;
|
||||||
|
|
||||||
|
internal static void TailoringMenuPatch(TailoringMenu __instance)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int x = Game1.getMouseX(true), y = Game1.getMouseY(true); // Mouse x and y position
|
||||||
|
string toSpeak = "";
|
||||||
|
|
||||||
|
if (__instance.leftIngredientSpot != null && __instance.leftIngredientSpot.containsPoint(x, y))
|
||||||
|
{
|
||||||
|
if (__instance.leftIngredientSpot.item == null)
|
||||||
|
{
|
||||||
|
toSpeak = "Input cloth here";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Item item = __instance.leftIngredientSpot.item;
|
||||||
|
toSpeak = $"Cloth slot: {item.Stack} {item.DisplayName}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (__instance.rightIngredientSpot != null && __instance.rightIngredientSpot.containsPoint(x, y))
|
||||||
|
{
|
||||||
|
if (__instance.rightIngredientSpot.item == null)
|
||||||
|
{
|
||||||
|
toSpeak = "Input ingredient here";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Item item = __instance.rightIngredientSpot.item;
|
||||||
|
toSpeak = $"Ingredient slot: {item.Stack} {item.DisplayName}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (__instance.startTailoringButton != null && __instance.startTailoringButton.containsPoint(x, y))
|
||||||
|
{
|
||||||
|
toSpeak = "Star tailoring button";
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO add other things
|
||||||
|
|
||||||
|
if (toSpeak != "")
|
||||||
|
MainClass.ScreenReader.SayWithMenuChecker(toSpeak, true);
|
||||||
|
}
|
||||||
|
catch (System.Exception e)
|
||||||
|
{
|
||||||
|
MainClass.ErrorLog($"Unable to narrate Text:\n{e.Message}\n{e.StackTrace}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal static void ChooseFromListMenuPatch(ChooseFromListMenu __instance, List<string> ___options, int ___index, bool ___isJukebox)
|
internal static void ChooseFromListMenuPatch(ChooseFromListMenu __instance, List<string> ___options, int ___index, bool ___isJukebox)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
Loading…
Reference in New Issue