* Highlights all tiles between a set of two tiles. Used in dock and tunnel placement * @param from TileIndex of the first tile to highlight * @param to TileIndex of the last tile to highlight */
| 2851 | * @param to TileIndex of the last tile to highlight |
| 2852 | */ |
| 2853 | void VpSetPresizeRange(TileIndex from, TileIndex to) |
| 2854 | { |
| 2855 | uint64_t distance = DistanceManhattan(from, to) + 1; |
| 2856 | |
| 2857 | _thd.selend.x = TileX(to) * TILE_SIZE; |
| 2858 | _thd.selend.y = TileY(to) * TILE_SIZE; |
| 2859 | _thd.selstart.x = TileX(from) * TILE_SIZE; |
| 2860 | _thd.selstart.y = TileY(from) * TILE_SIZE; |
| 2861 | _thd.next_drawstyle = HT_RECT; |
| 2862 | |
| 2863 | /* show measurement only if there is any length to speak of */ |
| 2864 | if (distance > 1) { |
| 2865 | ShowMeasurementTooltips(GetEncodedString(STR_MEASURE_LENGTH, distance)); |
| 2866 | } else { |
| 2867 | HideMeasurementTooltips(); |
| 2868 | } |
| 2869 | } |
| 2870 | |
| 2871 | static void VpStartPreSizing() |
| 2872 | { |
no test coverage detected