diff --git a/stardew-access/ModConfig.cs b/stardew-access/ModConfig.cs index d8530fd..3516999 100644 --- a/stardew-access/ModConfig.cs +++ b/stardew-access/ModConfig.cs @@ -85,9 +85,10 @@ namespace stardew_access public Boolean Warning { get; set; } = true; // Toggles the warnings feature public Boolean TTS { get; set; } = true; // Toggles the screen reader/tts. public Boolean TrackDroppedItems {get; set;} = true; // Toggles detecting the dropped items. + public Boolean DisableInventoryVerbosity {get; set;} = false; // If enabled, does not speaks 'not usable here' and 'donatable' in inventories #endregion // TODO Add the exclusion and focus list too // public String ExclusionList { get; set; } = "test"; } -} \ No newline at end of file +} diff --git a/stardew-access/Patches/DonationMenuPatches.cs b/stardew-access/Patches/DonationMenuPatches.cs index fd83808..ffffa2f 100644 --- a/stardew-access/Patches/DonationMenuPatches.cs +++ b/stardew-access/Patches/DonationMenuPatches.cs @@ -264,7 +264,7 @@ namespace stardew_access.Patches else toSpeak = $"Slot {i + 1} finished: {__instance.pieceHolders[i].item.DisplayName}"; - if (__instance.heldItem != null && __instance.pieceHolders[i].item == null) + if (!MainClass.Config.DisableInventoryVerbosity && __instance.heldItem != null && __instance.pieceHolders[i].item == null) { int highlight = getPieceIndexForDonationItem(__instance.heldItem.ParentSheetIndex); if (highlight != -1 && highlight == i) diff --git a/stardew-access/Patches/InventoryUtils.cs b/stardew-access/Patches/InventoryUtils.cs index e4d0089..5903f92 100644 --- a/stardew-access/Patches/InventoryUtils.cs +++ b/stardew-access/Patches/InventoryUtils.cs @@ -20,6 +20,7 @@ namespace stardew_access.Patches return true; } + internal static int narrateHoveredSlotAndReturnIndex(InventoryMenu inventoryMenu, List inventory, IList actualInventory, int x, int y, bool giveExtraDetails = false, int hoverPrice = -1, int extraItemToShowIndex = -1, int extraItemToShowAmount = -1, bool handleHighlightedItem = false, String highlightedItemPrefix = "", String highlightedItemSuffix = "") @@ -177,6 +178,7 @@ namespace stardew_access.Patches private static String handleHighlightedItemPrefix(bool isHighlighted, String prefix) { + if (MainClass.Config.DisableInventoryVerbosity) return ""; if (!isHighlighted) return ""; return prefix; @@ -184,6 +186,7 @@ namespace stardew_access.Patches private static String handleHighlightedItemSuffix(bool isHighlighted, String suffix) { + if (MainClass.Config.DisableInventoryVerbosity) return ""; if (!isHighlighted) return ""; return suffix; @@ -196,6 +199,7 @@ namespace stardew_access.Patches if (prevSlotIndex != hoveredInventoryIndex) Game1.playSound("invalid-selection"); + if (MainClass.Config.DisableInventoryVerbosity) return ""; return " not usable here"; } }