Fixed bug with tile cursor not passing exact integer tile values causing terrain features like crops to not be read out.
parent
838273b3ce
commit
332dd858a8
|
@ -65,7 +65,7 @@ namespace stardew_access.Features
|
||||||
{
|
{
|
||||||
if (!tryMoveTileView(delta)) return;
|
if (!tryMoveTileView(delta)) return;
|
||||||
Vector2 position = this.getTileCursorPosition();
|
Vector2 position = this.getTileCursorPosition();
|
||||||
Vector2 tile = position / Game1.tileSize;
|
Vector2 tile = new Vector2((float)Math.Floor(position.X / Game1.tileSize), (float)Math.Floor(position.Y / Game1.tileSize));
|
||||||
String ?name = TileInfo.getNameAtTile(tile);
|
String ?name = TileInfo.getNameAtTile(tile);
|
||||||
if (name == null)
|
if (name == null)
|
||||||
{
|
{
|
||||||
|
@ -79,7 +79,7 @@ namespace stardew_access.Features
|
||||||
}
|
}
|
||||||
if (precise)
|
if (precise)
|
||||||
{
|
{
|
||||||
MainClass.ScreenReader.Say($"{position.X}, {position.Y}", true);
|
MainClass.ScreenReader.Say($"{name}, {position.X}, {position.Y}", true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -111,6 +111,7 @@ namespace stardew_access.Features
|
||||||
|
|
||||||
public void update()
|
public void update()
|
||||||
{
|
{
|
||||||
|
//Reset the viewing cursor to the player when they turn or move. This will not reset the locked offset relative cursor position.
|
||||||
if (this.prevFacing != this.PlayerFacingVector || this.prevPlayerPosition != this.PlayerPosition)
|
if (this.prevFacing != this.PlayerFacingVector || this.prevPlayerPosition != this.PlayerPosition)
|
||||||
{
|
{
|
||||||
this.ViewingOffset = Vector2.Zero;
|
this.ViewingOffset = Vector2.Zero;
|
||||||
|
@ -119,6 +120,7 @@ namespace stardew_access.Features
|
||||||
this.prevPlayerPosition = this.PlayerPosition;
|
this.prevPlayerPosition = this.PlayerPosition;
|
||||||
if (MainClass.Config.SnapMouse)
|
if (MainClass.Config.SnapMouse)
|
||||||
this.SnapMouseToPlayer();
|
this.SnapMouseToPlayer();
|
||||||
|
|
||||||
if (MainClass.Config.TileCursorUpKey.JustPressed())
|
if (MainClass.Config.TileCursorUpKey.JustPressed())
|
||||||
{
|
{
|
||||||
this.cursorMoveInput(new Vector2(0, -Game1.tileSize));
|
this.cursorMoveInput(new Vector2(0, -Game1.tileSize));
|
||||||
|
@ -137,7 +139,6 @@ namespace stardew_access.Features
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static bool allowMouseSnap(Vector2 point)
|
private static bool allowMouseSnap(Vector2 point)
|
||||||
{
|
{
|
||||||
if (!Utility.isOnScreen(point, 0)) return false;
|
if (!Utility.isOnScreen(point, 0)) return false;
|
||||||
|
|
Loading…
Reference in New Issue