Added config to disable inventory verbosity
If set to true, disables speaking of 'not usable here' and 'donatable' in inventories
This commit is contained in:
		| @@ -85,9 +85,10 @@ namespace stardew_access | |||||||
|         public Boolean Warning { get; set; } = true; // Toggles the warnings feature |         public Boolean Warning { get; set; } = true; // Toggles the warnings feature | ||||||
|         public Boolean TTS { get; set; } = true; // Toggles the screen reader/tts. |         public Boolean TTS { get; set; } = true; // Toggles the screen reader/tts. | ||||||
|         public Boolean TrackDroppedItems {get; set;} = true; // Toggles detecting the dropped items. |         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 |         #endregion | ||||||
|  |  | ||||||
|         // TODO Add the exclusion and focus list too |         // TODO Add the exclusion and focus list too | ||||||
|         // public String ExclusionList { get; set; } = "test"; |         // public String ExclusionList { get; set; } = "test"; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -264,7 +264,7 @@ namespace stardew_access.Patches | |||||||
|                         else |                         else | ||||||
|                             toSpeak = $"Slot {i + 1} finished: {__instance.pieceHolders[i].item.DisplayName}"; |                             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); |                             int highlight = getPieceIndexForDonationItem(__instance.heldItem.ParentSheetIndex); | ||||||
|                             if (highlight != -1 && highlight == i) |                             if (highlight != -1 && highlight == i) | ||||||
|   | |||||||
| @@ -20,6 +20,7 @@ namespace stardew_access.Patches | |||||||
|  |  | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         internal static int narrateHoveredSlotAndReturnIndex(InventoryMenu inventoryMenu, List<ClickableComponent> inventory, IList<Item> actualInventory, int x, int y, |         internal static int narrateHoveredSlotAndReturnIndex(InventoryMenu inventoryMenu, List<ClickableComponent> inventory, IList<Item> actualInventory, int x, int y, | ||||||
|                 bool giveExtraDetails = false, int hoverPrice = -1, int extraItemToShowIndex = -1, int extraItemToShowAmount = -1, |                 bool giveExtraDetails = false, int hoverPrice = -1, int extraItemToShowIndex = -1, int extraItemToShowAmount = -1, | ||||||
|                 bool handleHighlightedItem = false, String highlightedItemPrefix = "", String highlightedItemSuffix = "") |                 bool handleHighlightedItem = false, String highlightedItemPrefix = "", String highlightedItemSuffix = "") | ||||||
| @@ -177,6 +178,7 @@ namespace stardew_access.Patches | |||||||
|  |  | ||||||
|         private static String handleHighlightedItemPrefix(bool isHighlighted, String prefix) |         private static String handleHighlightedItemPrefix(bool isHighlighted, String prefix) | ||||||
|         { |         { | ||||||
|  |             if (MainClass.Config.DisableInventoryVerbosity) return ""; | ||||||
|             if (!isHighlighted) return ""; |             if (!isHighlighted) return ""; | ||||||
|  |  | ||||||
|             return prefix; |             return prefix; | ||||||
| @@ -184,6 +186,7 @@ namespace stardew_access.Patches | |||||||
|  |  | ||||||
|         private static String handleHighlightedItemSuffix(bool isHighlighted, String suffix) |         private static String handleHighlightedItemSuffix(bool isHighlighted, String suffix) | ||||||
|         { |         { | ||||||
|  |             if (MainClass.Config.DisableInventoryVerbosity) return ""; | ||||||
|             if (!isHighlighted) return ""; |             if (!isHighlighted) return ""; | ||||||
|  |  | ||||||
|             return suffix; |             return suffix; | ||||||
| @@ -196,6 +199,7 @@ namespace stardew_access.Patches | |||||||
|             if (prevSlotIndex != hoveredInventoryIndex) |             if (prevSlotIndex != hoveredInventoryIndex) | ||||||
|                 Game1.playSound("invalid-selection"); |                 Game1.playSound("invalid-selection"); | ||||||
|  |  | ||||||
|  |             if (MainClass.Config.DisableInventoryVerbosity) return ""; | ||||||
|             return " not usable here"; |             return " not usable here"; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user