Made mouse follow player sprite

master
shoaib11120 2021-12-15 19:45:19 +05:30
parent 2dc1b81480
commit 5fa584a75a
1 changed files with 10 additions and 0 deletions

View File

@ -121,6 +121,8 @@ namespace stardew_access
MenuPatch.resetGlobalVars(); MenuPatch.resetGlobalVars();
SnapMouseToPlayer();
if(!isReadingTile && readTile) if(!isReadingTile && readTile)
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() private static async void ReadTile()
{ {
isReadingTile = true; isReadingTile = true;