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

Function ShowExtraViewportWindowForTileUnderCursor

src/viewport_gui.cpp:174–180  ·  view source on GitHub ↗

* Show a new Extra Viewport window. * Center it on the tile under the cursor, if the cursor is inside a viewport. * If that fails, center it on main viewport center. */

Source from the content-addressed store, hash-verified

172 * If that fails, center it on main viewport center.
173 */
174void ShowExtraViewportWindowForTileUnderCursor()
175{
176 /* Use tile under mouse as center for new viewport.
177 * Do this before creating the window, it might appear just below the mouse. */
178 Point pt = GetTileBelowCursor();
179 ShowExtraViewportWindow(pt.x != -1 ? TileVirtXY(pt.x, pt.y) : INVALID_TILE);
180}

Callers 2

OnHotkeyMethod · 0.85
OnHotkeyMethod · 0.85

Calls 3

GetTileBelowCursorFunction · 0.85
ShowExtraViewportWindowFunction · 0.85
TileVirtXYFunction · 0.85

Tested by

no test coverage detected