(svn r21020) -Add: Use center of waypoint in waypoint gui, if available.

This commit is contained in:
alberth
2010-10-23 20:39:21 +00:00
parent cccbc8f418
commit 83094e5e58
3 changed files with 29 additions and 8 deletions

View File

@@ -1886,6 +1886,18 @@ bool ScrollWindowTo(int x, int y, int z, Window *w, bool instant)
return true;
}
/**
* Scrolls the viewport in a window to a given location.
* @param tile Desired tile to center on.
* @param w %Window containing the viewport.
* @param instant Jump to the location instead of slowly moving to it.
* @return Destination of the viewport was changed (to activate other actions when the viewport is already at the desired position).
*/
bool ScrollWindowToTile(TileIndex tile, Window *w, bool instant)
{
return ScrollWindowTo(TileX(tile) * TILE_SIZE, TileY(tile) * TILE_SIZE, -1, w, instant);
}
/**
* Scrolls the viewport of the main window to a given location.
* @param tile Desired tile to center on.