Added water tiles to Read TIle

master
shoaib11120 2021-12-20 19:51:28 +05:30
parent af4b74f382
commit fdf9f7c0a8
1 changed files with 49 additions and 47 deletions

View File

@ -255,11 +255,13 @@ namespace stardew_access
if (!Equals(gt, prevTile)) if (!Equals(gt, prevTile))
{ {
prevTile = gt; prevTile = gt;
if(Game1.currentLocation.isWaterTile(x, y)){
if (Game1.currentLocation.getObjectAtTile((int)gt.X, (int)gt.Y) != null) ScreenReader.say("Water", true);
}
else if (Game1.currentLocation.getObjectAtTile(x, y) != null)
{ {
#region Objects at tile (TODO) #region Objects at tile (TODO)
StardewValley.Object obj = Game1.currentLocation.getObjectAtTile((int)gt.X, (int)gt.Y); StardewValley.Object obj = Game1.currentLocation.getObjectAtTile(x, y);
string name = obj.DisplayName; string name = obj.DisplayName;
// TODO add individual stone narration using parentSheetIndex // TODO add individual stone narration using parentSheetIndex
@ -412,55 +414,55 @@ namespace stardew_access
else else
{ {
#region Resource CLumps #region Resource CLumps
Game1.currentLocation.resourceClumps.ToList().ForEach(x => Game1.currentLocation.resourceClumps.ToList().ForEach(clump =>
{ {
if (x.occupiesTile((int)gt.X, (int)gt.Y)) if (clump.occupiesTile(x, y))
{ {
string toSpeak; string toSpeak;
int index = x.parentSheetIndex; int index = clump.parentSheetIndex;
switch (index) switch (index)
{ {
case 600: case 600:
toSpeak = "Large Stump"; toSpeak = "Large Stump";
break; break;
case 602: case 602:
toSpeak = "Hollow Log"; toSpeak = "Hollow Log";
break; break;
case 622: case 622:
toSpeak = "Meteorite"; toSpeak = "Meteorite";
break; break;
case 752: case 752:
case 754: case 754:
case 756: case 756:
case 758: case 758:
toSpeak = "Mine Rock"; toSpeak = "Mine Rock";
break; break;
case 672: case 672:
toSpeak = "Boulder"; toSpeak = "Boulder";
break; break;
default: default:
toSpeak = "Unknown"; toSpeak = "Unknown";
break; break;
} }
ScreenReader.say(toSpeak, true); ScreenReader.say(toSpeak, true);
return; return;
} }
}); });
#endregion #endregion
#region Doors #region Doors
Game1.currentLocation.doors.ToList().ForEach(x => Game1.currentLocation.doors.ToList().ForEach(item =>
{ {
x.Keys.ToList().ForEach(y => item.Keys.ToList().ForEach(ydoor =>
{ {
if (Equals((int)gt.X, y.X) && Equals((int)gt.Y, y.Y)) if (Equals(x, ydoor.X) && Equals(y, ydoor.Y))
{ {
ScreenReader.say("Door", true); ScreenReader.say("Door", true);
} }
}); });
}); });
#endregion #endregion
} }
} }