Made mouse follow player sprite

This commit is contained in:
shoaib11120
2021-12-15 19:45:19 +05:30
parent 2dc1b81480
commit 5fa584a75a

View File

@@ -121,6 +121,8 @@ namespace stardew_access
MenuPatch.resetGlobalVars();
SnapMouseToPlayer();
if(!isReadingTile && readTile)
ReadTile();
}
@@ -156,6 +158,14 @@ namespace stardew_access
}
}
private void SnapMouseToPlayer()
{
int x = Game1.player.GetBoundingBox().Center.X - Game1.viewport.X;
int y = Game1.player.GetBoundingBox().Center.Y - Game1.viewport.Y;
Game1.setMousePosition(x, y);
}
private static async void ReadTile()
{
isReadingTile = true;