MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ScrollMainWindowToTile

Function ScrollMainWindowToTile

src/viewport.cpp:2592–2595  ·  view source on GitHub ↗

* Scrolls the viewport of the main window to a given location. * @param tile Desired tile to center on. * @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). */

Source from the content-addressed store, hash-verified

2590 * @return Destination of the viewport was changed (to activate other actions when the viewport is already at the desired position).
2591 */
2592bool ScrollMainWindowToTile(TileIndex tile, bool instant)
2593{
2594 return ScrollMainWindowTo(TileX(tile) * TILE_SIZE + TILE_SIZE / 2, TileY(tile) * TILE_SIZE + TILE_SIZE / 2, -1, instant);
2595}
2596
2597/**
2598 * Set a tile to display a red error square.

Callers 15

HandleClickMethod · 0.85
OnClickMethod · 0.85
OnClickMethod · 0.85
HandleClickMethod · 0.85
OnClickMethod · 0.85
OnClickMethod · 0.85
OnClickMethod · 0.85
OnClickMethod · 0.85
OnClickMethod · 0.85
CcFoundRandomTownFunction · 0.85
OnClickMethod · 0.85
OnClickMethod · 0.85

Calls 3

ScrollMainWindowToFunction · 0.85
TileXFunction · 0.85
TileYFunction · 0.85

Tested by

no test coverage detected