diff --git a/stardew-access/ModEntry.cs b/stardew-access/ModEntry.cs index 7eb1b1d..d43d036 100644 --- a/stardew-access/ModEntry.cs +++ b/stardew-access/ModEntry.cs @@ -106,6 +106,11 @@ namespace stardew_access postfix: new HarmonyMethod(typeof(MenuPatch), nameof(MenuPatch.BillboardPatch)) ); + harmony.Patch( + original: AccessTools.Method(typeof(InventoryMenu), nameof(InventoryMenu.hover)), + postfix: new HarmonyMethod(typeof(MenuPatch), nameof(MenuPatch.InventoryMenuPatch)) + ); + #endregion #region Custom Commands diff --git a/stardew-access/Patches/MenuPatch.cs b/stardew-access/Patches/MenuPatch.cs index f1d346f..5c95bf3 100644 --- a/stardew-access/Patches/MenuPatch.cs +++ b/stardew-access/Patches/MenuPatch.cs @@ -14,6 +14,19 @@ namespace stardew_access.Patches private static string currentLetterText = " "; private static string currentDailyQuestText = " "; + public static void InventoryMenuPatch(InventoryMenu __instance, Item __result) + { + if (__result == null) + return; + + if (__result.Stack > 1) + { + __instance.hoverTitle = $"{__result.Stack} {__result.DisplayName}"; + __instance.descriptionTitle = __result.Stack + __result.DisplayName; + } + + } + internal static void BillboardPatch(Billboard __instance, bool ___dailyQuestBoard) { if (!___dailyQuestBoard) diff --git a/stardew-access/manifest.json b/stardew-access/manifest.json index 2b1cb45..46bd186 100644 --- a/stardew-access/manifest.json +++ b/stardew-access/manifest.json @@ -1,7 +1,7 @@ { "Name": "Stardew Access", "Author": "Mohammad Shoaib", - "Version": "1.0.5-beta", + "Version": "1.0.6-beta", "Description": "An accessibility mod with screen reader support!", "UniqueID": "shoaib.stardewaccess", "EntryDll": "stardew-access.dll",