From 94ca19f3bb432bbc45664035ce50ed14b4daa1ce Mon Sep 17 00:00:00 2001 From: shoaib11120 Date: Fri, 21 Jan 2022 14:58:15 +0530 Subject: [PATCH] Added toggle between stereo and mono sound for radar --- stardew-access/CustomCommands.cs | 4 ++-- stardew-access/CustomSoundEffects.cs | 14 +++++++++++++- .../{ModFeatures => Features}/CurrentPlayer.cs | 0 stardew-access/{ModFeatures => Features}/Other.cs | 0 stardew-access/{ModFeatures => Features}/Radar.cs | 3 +++ .../{ModFeatures => Features}/ReadTile.cs | 0 stardew-access/ModEntry.cs | 8 ++++++-- 7 files changed, 24 insertions(+), 5 deletions(-) rename stardew-access/{ModFeatures => Features}/CurrentPlayer.cs (100%) rename stardew-access/{ModFeatures => Features}/Other.cs (100%) rename stardew-access/{ModFeatures => Features}/Radar.cs (99%) rename stardew-access/{ModFeatures => Features}/ReadTile.cs (100%) diff --git a/stardew-access/CustomCommands.cs b/stardew-access/CustomCommands.cs index 8dfad44..b44f025 100644 --- a/stardew-access/CustomCommands.cs +++ b/stardew-access/CustomCommands.cs @@ -100,9 +100,9 @@ namespace stardew_access helper.ConsoleCommands.Add("rstereo", "Toggle stereo sound in radar feature", (string commmand, string[] args) => { - MainClass.monoSound = !MainClass.monoSound; + MainClass.radarStereoSound = !MainClass.radarStereoSound; - MainClass.monitor.Log("Stereo sound is " + (MainClass.radarDebug ? "on" : "off"), LogLevel.Info); + MainClass.monitor.Log("Stereo sound is " + (MainClass.radarStereoSound ? "on" : "off"), LogLevel.Info); }); helper.ConsoleCommands.Add("refsr", "Refresh screen reader", (string commmand, string[] args) => diff --git a/stardew-access/CustomSoundEffects.cs b/stardew-access/CustomSoundEffects.cs index feddf23..61c04f9 100644 --- a/stardew-access/CustomSoundEffects.cs +++ b/stardew-access/CustomSoundEffects.cs @@ -19,16 +19,28 @@ namespace stardew_access soundEffects.Add("drop_item", TYPE.Sound); soundEffects.Add("colliding", TYPE.Sound); + soundEffects.Add("npc_top", TYPE.Footstep); soundEffects.Add("npc_right", TYPE.Footstep); soundEffects.Add("npc_left", TYPE.Footstep); soundEffects.Add("npc_bottom", TYPE.Footstep); + soundEffects.Add("obj_top", TYPE.Footstep); soundEffects.Add("obj_right", TYPE.Footstep); soundEffects.Add("obj_left", TYPE.Footstep); soundEffects.Add("obj_bottom", TYPE.Footstep); - for(int i = 0; i < soundEffects.Count; i++) + soundEffects.Add("npc_mono_top", TYPE.Footstep); + soundEffects.Add("npc_mono_right", TYPE.Footstep); + soundEffects.Add("npc_mono_left", TYPE.Footstep); + soundEffects.Add("npc_mono_bottom", TYPE.Footstep); + + soundEffects.Add("obj_mono_top", TYPE.Footstep); + soundEffects.Add("obj_mono_right", TYPE.Footstep); + soundEffects.Add("obj_mono_left", TYPE.Footstep); + soundEffects.Add("obj_mono_bottom", TYPE.Footstep); + + for (int i = 0; i < soundEffects.Count; i++) { KeyValuePair soundEffect = soundEffects.ElementAt(i); diff --git a/stardew-access/ModFeatures/CurrentPlayer.cs b/stardew-access/Features/CurrentPlayer.cs similarity index 100% rename from stardew-access/ModFeatures/CurrentPlayer.cs rename to stardew-access/Features/CurrentPlayer.cs diff --git a/stardew-access/ModFeatures/Other.cs b/stardew-access/Features/Other.cs similarity index 100% rename from stardew-access/ModFeatures/Other.cs rename to stardew-access/Features/Other.cs diff --git a/stardew-access/ModFeatures/Radar.cs b/stardew-access/Features/Radar.cs similarity index 99% rename from stardew-access/ModFeatures/Radar.cs rename to stardew-access/Features/Radar.cs index f1a5de6..9358638 100644 --- a/stardew-access/ModFeatures/Radar.cs +++ b/stardew-access/Features/Radar.cs @@ -257,6 +257,9 @@ namespace stardew_access.Game { string soundName = $"_{post}"; + if(MainClass.radarStereoSound) + soundName = $"_mono{soundName}"; + if(soundType == typeof(Farmer)) // Villagers and farmers soundName = $"npc{soundName}"; if (soundType == typeof(FarmAnimal)) // Farm Animals diff --git a/stardew-access/ModFeatures/ReadTile.cs b/stardew-access/Features/ReadTile.cs similarity index 100% rename from stardew-access/ModFeatures/ReadTile.cs rename to stardew-access/Features/ReadTile.cs diff --git a/stardew-access/ModEntry.cs b/stardew-access/ModEntry.cs index b339c65..dee50d2 100644 --- a/stardew-access/ModEntry.cs +++ b/stardew-access/ModEntry.cs @@ -12,8 +12,12 @@ namespace stardew_access public class MainClass : Mod { private Harmony? harmony; - public static bool readTile = true, snapMouse = true, isNarratingHudMessage = false, radar = false, radarDebug = true; - public static bool monoSound = false; + public static bool readTile = true; + public static bool snapMouse = true; + public static bool isNarratingHudMessage = false; + public static bool radar = false; + public static bool radarDebug = true; + public static bool radarStereoSound = true; public static IMonitor? monitor; AutoHotkeyEngine ahk; public static string hudMessageQueryKey = "";