(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 f502c82fa5
commit 835fe2131d
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.