diff --git a/invalid-selection-license.txt b/invalid-selection-license.txt new file mode 100644 index 0000000..f1b27d8 --- /dev/null +++ b/invalid-selection-license.txt @@ -0,0 +1,32 @@ +PIXABAY LICENSE CERTIFICATE +============================================== + +This document confirms the download of an audio file pursuant to the Pixabay License as defined in the Pixabay Terms of Service available at https://https://pixabay.com/service/terms/ + +Licensor's Username: +https://pixabay.com/users/pixabay-1/ + +Licensee: +TheOneWhoKnocks + +Audio File Title: +Invalid Selection + +Audio File URL: +https://pixabay.com/sound-effects/invalid-selection-39351/ + +Audio File ID: +39351 + +Date of download: +2023-02-20 05:52:26 UTC + +Pixabay GmbH c/o Lacore Rechtsanwälte LLP +Berliner Freiheit 2, 10785 Berlin, Germany + +Pixabay is a user-contributed stock content website. The above-named Licensor is responsible for this audio file. Pixabay monitors uploaded audio files only to a reasonable extent. Pixabay cannot be held responsible for the acts or omissions of its users and does not represent or warrant that any required third-party consents or licenses have been obtained. + +For any queries related to this document please contact Pixabay via info@pixabay.com. + + +==== THIS IS NOT A TAX RECEIPT OR INVOICE ==== \ No newline at end of file diff --git a/stardew-access/CustomSoundEffects.cs b/stardew-access/CustomSoundEffects.cs index b5610e4..f4c6d43 100644 --- a/stardew-access/CustomSoundEffects.cs +++ b/stardew-access/CustomSoundEffects.cs @@ -22,6 +22,7 @@ namespace stardew_access soundEffects.Add("drop_item", TYPE.Sound); soundEffects.Add("colliding", TYPE.Sound); + soundEffects.Add("invalid-selection", TYPE.Sound); soundEffects.Add("npc_top", TYPE.Footstep); soundEffects.Add("npc_right", TYPE.Footstep); diff --git a/stardew-access/Patches/GameMenuPatches.cs b/stardew-access/Patches/GameMenuPatches.cs index e1c2d46..ead5f39 100644 --- a/stardew-access/Patches/GameMenuPatches.cs +++ b/stardew-access/Patches/GameMenuPatches.cs @@ -1,5 +1,4 @@ using StardewValley; -using StardewValley.Locations; using StardewValley.Menus; using StardewValley.Objects; @@ -21,6 +20,7 @@ namespace stardew_access.Patches internal static string profilePageQuery = ""; internal static int currentSelectedCraftingRecipe = -1; internal static bool isSelectingRecipe = false; + internal static int prevSlotIndex = -999; internal static void CollectionsPagePatch(CollectionsPage __instance) { @@ -1295,6 +1295,12 @@ namespace stardew_access.Patches if (!inventoryMenu.highlightMethod(actualInventory[i])) { name = $"{name} not usable here"; + + if (prevSlotIndex != i) + { + prevSlotIndex = i; + Game1.playSound("invalid-selection"); + } } if (giveExtraDetails) diff --git a/stardew-access/Patches/MenuPatches.cs b/stardew-access/Patches/MenuPatches.cs index 993d580..ca05742 100644 --- a/stardew-access/Patches/MenuPatches.cs +++ b/stardew-access/Patches/MenuPatches.cs @@ -16,6 +16,7 @@ namespace stardew_access.Patches internal static string pondQueryMenuQuery = " "; internal static string forgeMenuQuery = " "; internal static string itemListMenuQuery = " "; + internal static int prevSlotIndex = -999; public static Vector2? prevTile = null; internal static void ItemListMenuPatch(ItemListMenu __instance, string ___title, int ___currentTab, int ___totalValueOfItems, List ___itemsToList) @@ -143,6 +144,13 @@ namespace stardew_access.Patches { toSpeak = $"{toSpeak} not usable here"; } + + if (prevSlotIndex != i) + { + prevSlotIndex = i; + MainClass.DebugLog("here"); + Game1.playSound("invalid-selection"); + } } if (forgeMenuQuery != $"{toSpeak}:{i}") @@ -310,6 +318,13 @@ namespace stardew_access.Patches { toSpeak = $"{toSpeak} not usable here"; } + + if (prevSlotIndex != i) + { + prevSlotIndex = i; + MainClass.DebugLog("here"); + Game1.playSound("invalid-selection"); + } } if (tailoringMenuQuery != $"{toSpeak}:{i}") diff --git a/stardew-access/assets/sounds/invalid-selection.wav b/stardew-access/assets/sounds/invalid-selection.wav new file mode 100644 index 0000000..83e63ba Binary files /dev/null and b/stardew-access/assets/sounds/invalid-selection.wav differ