Added item count in inventory

master
shoaib11120 2021-12-19 22:32:05 +05:30
parent d4f73d5dd8
commit 90f9d7aba7
3 changed files with 19 additions and 1 deletions

View File

@ -106,6 +106,11 @@ namespace stardew_access
postfix: new HarmonyMethod(typeof(MenuPatch), nameof(MenuPatch.BillboardPatch)) 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 #endregion
#region Custom Commands #region Custom Commands

View File

@ -14,6 +14,19 @@ namespace stardew_access.Patches
private static string currentLetterText = " "; private static string currentLetterText = " ";
private static string currentDailyQuestText = " "; 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) internal static void BillboardPatch(Billboard __instance, bool ___dailyQuestBoard)
{ {
if (!___dailyQuestBoard) if (!___dailyQuestBoard)

View File

@ -1,7 +1,7 @@
{ {
"Name": "Stardew Access", "Name": "Stardew Access",
"Author": "Mohammad Shoaib", "Author": "Mohammad Shoaib",
"Version": "1.0.5-beta", "Version": "1.0.6-beta",
"Description": "An accessibility mod with screen reader support!", "Description": "An accessibility mod with screen reader support!",
"UniqueID": "shoaib.stardewaccess", "UniqueID": "shoaib.stardewaccess",
"EntryDll": "stardew-access.dll", "EntryDll": "stardew-access.dll",