diff --git a/stardew-access/ModEntry.cs b/stardew-access/ModEntry.cs index e629e6b..bde5242 100644 --- a/stardew-access/ModEntry.cs +++ b/stardew-access/ModEntry.cs @@ -107,6 +107,11 @@ namespace stardew_access postfix: new HarmonyMethod(typeof(MenuPatch), nameof(MenuPatch.BillboardPatch)) ); + harmony.Patch( + original: AccessTools.Method(typeof(ShippingMenu), nameof(ShippingMenu.draw), new Type[] { typeof(SpriteBatch) }), + postfix: new HarmonyMethod(typeof(MenuPatch), nameof(MenuPatch.ShippingMenuPatch)) + ); + #endregion #region Custom Commands diff --git a/stardew-access/Patches/DialoguePatcher.cs b/stardew-access/Patches/DialoguePatcher.cs index 7113b5e..ae0d1d3 100644 --- a/stardew-access/Patches/DialoguePatcher.cs +++ b/stardew-access/Patches/DialoguePatcher.cs @@ -63,7 +63,8 @@ namespace stardew_access.Patches if (__instance.responses.Count > 0) hasResponses = true; - if (currentDialogue != __instance.getCurrentString()) { + if (currentDialogue != __instance.getCurrentString()) + { toSpeak = __instance.getCurrentString(); currentDialogue = toSpeak; } @@ -84,9 +85,8 @@ namespace stardew_access.Patches ScreenReader.sayWithChecker(toSpeak, true); } } - else if(Game1.activeClickableMenu is DialogueBox) + else if (Game1.activeClickableMenu is DialogueBox) { - MainClass.monitor.Log("hereasad ", LogLevel.Debug); // Basic dialogues like `No mails in the mail box` if (currentDialogue != __instance.getCurrentString()) { diff --git a/stardew-access/Patches/MenuPatch.cs b/stardew-access/Patches/MenuPatch.cs index 495e232..16e85cd 100644 --- a/stardew-access/Patches/MenuPatch.cs +++ b/stardew-access/Patches/MenuPatch.cs @@ -14,6 +14,28 @@ namespace stardew_access.Patches private static string currentLetterText = " "; private static string currentDailyQuestText = " "; + internal static void ShippingMenuPatch(ShippingMenu __instance, List ___categoryTotals) + { + if(__instance.currentPage == -1) + { + int total = ___categoryTotals[5]; + string toSpeak; + if(__instance.okButton.containsPoint(Game1.getMousePosition(true).X, Game1.getMousePosition(true).Y)) + { + toSpeak = $"{total}g in total. Press left mouse button to save."; + ScreenReader.sayWithChecker(toSpeak, true); + } + for (int i =0; i < __instance.categories.Count; i++) + { + if (__instance.categories[i].containsPoint(Game1.getMousePosition(true).X, Game1.getMousePosition(true).Y)) + { + toSpeak = $"Money recieved from {__instance.getCategoryName(i)}: {___categoryTotals[i]}g."; + ScreenReader.sayWithChecker(toSpeak, true); + } + } + } + } + internal static void BillboardPatch(Billboard __instance, bool ___dailyQuestBoard) { if (!___dailyQuestBoard)