diff --git a/stardew-access/HarmonyPatches.cs b/stardew-access/HarmonyPatches.cs index c3567c9..4a4ffbd 100644 --- a/stardew-access/HarmonyPatches.cs +++ b/stardew-access/HarmonyPatches.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using stardew_access.Patches; using StardewValley; +using StardewValley.Characters; using StardewValley.Menus; using StardewValley.Minigames; @@ -306,6 +307,11 @@ namespace stardew_access original: AccessTools.Method(typeof(Game1), nameof(Game1.closeTextEntry)), prefix: new HarmonyMethod(typeof(Game1Patch), nameof(Game1Patch.CloseTextEntryPatch)) ); + + harmony.Patch( + original: AccessTools.Method(typeof(TrashBear), nameof(TrashBear.draw), new Type[] { typeof(SpriteBatch) }), + prefix: new HarmonyMethod(typeof(TrashBearPatch), nameof(TrashBearPatch.DrawPatch)) + ); } } } diff --git a/stardew-access/Patches/MiscPatches/TrashBearPatch.cs b/stardew-access/Patches/MiscPatches/TrashBearPatch.cs new file mode 100644 index 0000000..ad2592a --- /dev/null +++ b/stardew-access/Patches/MiscPatches/TrashBearPatch.cs @@ -0,0 +1,23 @@ +using StardewValley; + +namespace stardew_access.Patches +{ + internal class TrashBearPatch + { + internal static void DrawPatch(int ___itemWantedIndex, int ___showWantBubbleTimer) + { + try + { + if (___showWantBubbleTimer >= 2900) + { + string itemName = Game1.objectInformation[___itemWantedIndex].Split('/')[4]; + MainClass.ScreenReader.Say($"Trash Bear wants {itemName}!", true); + } + } + catch (Exception e) + { + MainClass.ErrorLog($"An error occured TrashBearPatch::DrawPatch():\n{e.Message}\n{e.StackTrace}"); + } + } + } +}