Issue#63 Prepend the player's name in tile viewer

master
Mohammad Shoaib Khan 2022-10-23 12:12:27 +05:30
parent 1cf4637687
commit 7a4ca89836
1 changed files with 7 additions and 0 deletions

View File

@ -174,6 +174,13 @@ namespace stardew_access.Features
Vector2 position = this.GetTileCursorPosition();
Vector2 tile = this.GetViewingTile();
String? name = TileInfo.getNameAtTile(tile);
// Prepend the player's name if the viewing tile is occupied by the player itself
if (CurrentPlayer.PositionX == tile.X && CurrentPlayer.PositionY == tile.Y)
{
name = $"{Game1.player.displayName}, {name}";
}
if (name == null)
{
// Report if a tile is empty or blocked if there is nothing on it