Added focus mode to radar feature

master
shoaib11120 2022-01-22 10:53:24 +05:30
parent c5e72d545b
commit 590fe5288f
1 changed files with 36 additions and 32 deletions

View File

@ -223,14 +223,18 @@ namespace stardew_access.Game
}
}
public void playSoundAt(Vector2 position, String? searchQuery, Type soundType)
public void playSoundAt(Vector2 position, String searchQuery, Type soundType)
{
// Skip if player is directly looking at the tile
if (CurrentPlayer.getNextTile().Equals(position))
return;
if (searchQuery == null || !exclusions.Contains(searchQuery.ToLower().Trim()))
{
if (!radarFocus && exclusions.Contains(searchQuery.ToLower().Trim()))
return;
if (radarFocus && !focus.Contains(searchQuery.ToLower().Trim()))
return;
if (MainClass.radarDebug)
MainClass.monitor.Log($"Object:{searchQuery.ToLower().Trim()}\tPosition: X={position.X} Y={position.Y}", StardewModdingAPI.LogLevel.Debug);
@ -259,7 +263,7 @@ namespace stardew_access.Game
{
Game1.currentLocation.localSoundAt(getSoundName(soundType, "bottom"), position);
}
}
}
public string getSoundName(Type soundType, string post)
@ -329,13 +333,13 @@ namespace stardew_access.Game
public void enableFocus()
{
temp_exclusions = exclusions;
temp_exclusions = exclusions.ToList();
exclusions.Clear();
}
public void disableFocus()
{
exclusions = temp_exclusions;
exclusions = temp_exclusions.ToList();
temp_exclusions.Clear();
}
}