Added toggle between stereo and mono sound for radar

master
shoaib11120 2022-01-21 14:58:15 +05:30
parent 8e09b9f1db
commit 94ca19f3bb
7 changed files with 24 additions and 5 deletions

View File

@ -100,9 +100,9 @@ namespace stardew_access
helper.ConsoleCommands.Add("rstereo", "Toggle stereo sound in radar feature", (string commmand, string[] args) => 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) => helper.ConsoleCommands.Add("refsr", "Refresh screen reader", (string commmand, string[] args) =>

View File

@ -19,16 +19,28 @@ namespace stardew_access
soundEffects.Add("drop_item", TYPE.Sound); soundEffects.Add("drop_item", TYPE.Sound);
soundEffects.Add("colliding", TYPE.Sound); soundEffects.Add("colliding", TYPE.Sound);
soundEffects.Add("npc_top", TYPE.Footstep); soundEffects.Add("npc_top", TYPE.Footstep);
soundEffects.Add("npc_right", TYPE.Footstep); soundEffects.Add("npc_right", TYPE.Footstep);
soundEffects.Add("npc_left", TYPE.Footstep); soundEffects.Add("npc_left", TYPE.Footstep);
soundEffects.Add("npc_bottom", TYPE.Footstep); soundEffects.Add("npc_bottom", TYPE.Footstep);
soundEffects.Add("obj_top", TYPE.Footstep); soundEffects.Add("obj_top", TYPE.Footstep);
soundEffects.Add("obj_right", TYPE.Footstep); soundEffects.Add("obj_right", TYPE.Footstep);
soundEffects.Add("obj_left", TYPE.Footstep); soundEffects.Add("obj_left", TYPE.Footstep);
soundEffects.Add("obj_bottom", 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<String, TYPE> soundEffect = soundEffects.ElementAt(i); KeyValuePair<String, TYPE> soundEffect = soundEffects.ElementAt(i);

View File

@ -257,6 +257,9 @@ namespace stardew_access.Game
{ {
string soundName = $"_{post}"; string soundName = $"_{post}";
if(MainClass.radarStereoSound)
soundName = $"_mono{soundName}";
if(soundType == typeof(Farmer)) // Villagers and farmers if(soundType == typeof(Farmer)) // Villagers and farmers
soundName = $"npc{soundName}"; soundName = $"npc{soundName}";
if (soundType == typeof(FarmAnimal)) // Farm Animals if (soundType == typeof(FarmAnimal)) // Farm Animals

View File

@ -12,8 +12,12 @@ namespace stardew_access
public class MainClass : Mod public class MainClass : Mod
{ {
private Harmony? harmony; private Harmony? harmony;
public static bool readTile = true, snapMouse = true, isNarratingHudMessage = false, radar = false, radarDebug = true; public static bool readTile = true;
public static bool monoSound = false; 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; public static IMonitor? monitor;
AutoHotkeyEngine ahk; AutoHotkeyEngine ahk;
public static string hudMessageQueryKey = ""; public static string hudMessageQueryKey = "";