Add location button to watch window title

This commit is contained in:
dP
2021-11-09 18:50:27 +03:00
parent 760b4a16a6
commit 3c43becb61
6 changed files with 48 additions and 6 deletions
+15
View File
@@ -180,6 +180,21 @@ void ShowExtraViewportWindow(TileIndex tile)
new ExtraViewportWindow(&_extra_viewport_desc, i, tile);
}
namespace citymania {
Window *ShowExtraViewportWindow(int x, int y, int z)
{
int i = 0;
/* find next free window number for extra viewport */
while (FindWindowById(WC_EXTRA_VIEWPORT, i) != nullptr) i++;
auto w = new ExtraViewportWindow(&_extra_viewport_desc, i, INVALID_TILE);
if (w) ScrollWindowTo(x, y, 0, w);
}
} // namespace citymania
/**
* Show a new Extra Viewport window.
* Center it on the tile under the cursor, if the cursor is inside a viewport.