Fixed hovered item count

master
shoaib11120 2021-12-25 06:08:09 +05:30
parent 20b822a284
commit 8fd846a5bc
3 changed files with 10 additions and 19 deletions

View File

@ -105,11 +105,6 @@ 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

View File

@ -33,7 +33,7 @@ namespace stardew_access.Patches
ScreenReader.say(toSpeak, false);
}
}
else if (__instance.isQuestion)
else if (__instance.isQuestion || __instance.responses.Count > 0)
{
// For Dialogues with responses/answers like the dialogue when we click on tv
string toSpeak = " ";
@ -89,6 +89,15 @@ namespace stardew_access.Patches
StringBuilder toSpeak = new StringBuilder();
#region Add item count before title
if(hoveredItem != null)
{
int count = hoveredItem.Stack;
if(count > 1)
toSpeak.Append($"{count} ");
}
#endregion
#region Add title if any
if (boldTitleText != null)
toSpeak.Append($"{boldTitleText}\n");

View File

@ -14,19 +14,6 @@ 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)