virtual void OnPlacePresize(Point pt, TileIndex tile_from) { DiagDirection dir = GetInclinedSlopeDirection(GetTileSlope(tile_from, NULL)); TileIndex tile_to = (dir != INVALID_DIAGDIR ? TileAddByDiagDir(tile_from, ReverseDiagDir(dir)) : tile_from); VpSetPresizeRange(tile_from, tile_to); }
virtual void OnPlacePresize(Point pt, TileIndex tile_from) { TileIndex tile_to = tile_from; if (this->last_clicked_widget == WID_DT_BUILD_AQUEDUCT) { GetOtherAqueductEnd(tile_from, &tile_to); } else { DiagDirection dir = GetInclinedSlopeDirection(GetTileSlope(tile_from)); if (IsValidDiagDirection(dir)) { /* Locks and docks always select the tile "down" the slope. */ tile_to = TileAddByDiagDir(tile_from, ReverseDiagDir(dir)); /* Locks also select the tile "up" the slope. */ if (this->last_clicked_widget == WID_DT_LOCK) tile_from = TileAddByDiagDir(tile_from, dir); } } VpSetPresizeRange(tile_from, tile_to); }