Moved collections page patch

master
Mohammad Shoaib Khan 2023-02-24 14:33:03 +05:30
parent 6730fcceff
commit 2a5baa6770
No known key found for this signature in database
GPG Key ID: D8040D966320B620
3 changed files with 22 additions and 16 deletions

View File

@ -110,7 +110,7 @@ namespace stardew_access
harmony.Patch( harmony.Patch(
original: AccessTools.Method(typeof(CollectionsPage), nameof(CollectionsPage.draw), new Type[] { typeof(SpriteBatch) }), 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 #endregion

View File

@ -18,21 +18,6 @@ namespace stardew_access.Patches
internal static int currentSelectedCraftingRecipe = -1; internal static int currentSelectedCraftingRecipe = -1;
internal static bool isSelectingRecipe = false; 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<ClickableTextureComponent> ___sprites, int ___slotPosition, List<string> ___kidsNames) internal static void SocialPagePatch(SocialPage __instance, List<ClickableTextureComponent> ___sprites, int ___slotPosition, List<string> ___kidsNames)
{ {

View File

@ -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}");
}
}
}
}