diff --git a/stardew-access/HarmonyPatches.cs b/stardew-access/HarmonyPatches.cs index d0fe365..509109a 100644 --- a/stardew-access/HarmonyPatches.cs +++ b/stardew-access/HarmonyPatches.cs @@ -110,7 +110,7 @@ namespace stardew_access harmony.Patch( original: AccessTools.Method(typeof(CollectionsPage), nameof(CollectionsPage.draw), new Type[] { typeof(SpriteBatch) }), - postfix: new HarmonyMethod(typeof(GameMenuPatches), nameof(GameMenuPatches.CollectionsPagePatch)) + postfix: new HarmonyMethod(typeof(CollectionsPagePatch), nameof(CollectionsPagePatch.DrawPatch)) ); #endregion diff --git a/stardew-access/Patches/GameMenuPatches.cs b/stardew-access/Patches/GameMenuPatches.cs index d7c3891..0f7b6fb 100644 --- a/stardew-access/Patches/GameMenuPatches.cs +++ b/stardew-access/Patches/GameMenuPatches.cs @@ -18,21 +18,6 @@ namespace stardew_access.Patches internal static int currentSelectedCraftingRecipe = -1; internal static bool isSelectingRecipe = false; - internal static void CollectionsPagePatch(CollectionsPage __instance) - { - try - { - int x = Game1.getMousePosition().X, y = Game1.getMousePosition().Y; - if (__instance.letterviewerSubMenu != null) - { - DialoguePatches.NarrateLetterContent(__instance.letterviewerSubMenu); - } - } - catch (System.Exception e) - { - MainClass.ErrorLog($"Unable to narrate Text:\n{e.Message}\n{e.StackTrace}"); - } - } internal static void SocialPagePatch(SocialPage __instance, List ___sprites, int ___slotPosition, List ___kidsNames) { diff --git a/stardew-access/Patches/GameMenuPatches/CollectionsPagePatch.cs b/stardew-access/Patches/GameMenuPatches/CollectionsPagePatch.cs new file mode 100644 index 0000000..a708930 --- /dev/null +++ b/stardew-access/Patches/GameMenuPatches/CollectionsPagePatch.cs @@ -0,0 +1,21 @@ +namespace stardew_access.Patches +{ + internal class CollectionsPagePatch + { + internal static void DrawPatch(StardewValley.Menus.CollectionsPage __instance) + { + try + { + int x = StardewValley.Game1.getMousePosition().X, y = StardewValley.Game1.getMousePosition().Y; + if (__instance.letterviewerSubMenu != null) + { + DialoguePatches.NarrateLetterContent(__instance.letterviewerSubMenu); + } + } + catch (System.Exception e) + { + MainClass.ErrorLog($"Unable to narrate Text:\n{e.Message}\n{e.StackTrace}"); + } + } + } +}