Added category to manual read tile key

master
Mohammad Shoaib 2022-05-10 20:47:40 +05:30
parent 7688bc0dd5
commit 78a466a010
1 changed files with 7 additions and 6 deletions

View File

@ -19,8 +19,9 @@ namespace stardew_access.Features
try try
{ {
Vector2 tile; Vector2 tile;
int x, y;
#region Get Tile #region Get Tile
int x, y;
if (!playersPosition) if (!playersPosition)
{ {
// Grab tile // Grab tile
@ -31,9 +32,9 @@ namespace stardew_access.Features
// Player's standing tile // Player's standing tile
tile = CurrentPlayer.getPosition(); tile = CurrentPlayer.getPosition();
} }
#endregion
x = (int)tile.X; x = (int)tile.X;
y = (int)tile.Y; y = (int)tile.Y;
#endregion
if (Context.IsPlayerFree) if (Context.IsPlayerFree)
{ {
@ -45,15 +46,15 @@ namespace stardew_access.Features
bool isColliding = TileInfo.isCollidingAtTile(x, y); bool isColliding = TileInfo.isCollidingAtTile(x, y);
string? toSpeak = TileInfo.getNameAtTile(tile); (string? name, string? category) info = TileInfo.getNameWithCategoryNameAtTile(tile);
#region Narrate toSpeak #region Narrate toSpeak
if (toSpeak != null) if (info.name != null)
if (MainClass.ScreenReader != null) if (MainClass.ScreenReader != null)
if (manuallyTriggered) if (manuallyTriggered)
MainClass.ScreenReader.Say(toSpeak, true); MainClass.ScreenReader.Say($"{info.name}, Category: {info.category}", true);
else else
MainClass.ScreenReader.SayWithTileQuery(toSpeak, x, y, true); MainClass.ScreenReader.SayWithTileQuery(info.name, x, y, true);
#endregion #endregion
#region Play colliding sound effect #region Play colliding sound effect