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

Method OnPlaceDrag

src/tree_gui.cpp:224–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222 }
223
224 void OnPlaceDrag(ViewportPlaceMethod select_method, [[maybe_unused]] ViewportDragDropSelectionProcess select_proc, [[maybe_unused]] Point pt) override
225 {
226 if (_game_mode != GM_EDITOR && this->mode == PM_NORMAL) {
227 VpSelectTilesWithMethod(pt.x, pt.y, select_method);
228 } else {
229 TileIndex tile = TileVirtXY(pt.x, pt.y);
230
231 if (this->mode == PM_NORMAL) {
232 Command<CMD_PLANT_TREE>::Post(tile, tile, this->tree_to_plant, false);
233 } else {
234 this->DoPlantForest(tile);
235 }
236 }
237 }
238
239 void OnPlaceMouseUp([[maybe_unused]] ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, [[maybe_unused]] Point pt, TileIndex start_tile, TileIndex end_tile) override
240 {

Callers

nothing calls this directly

Calls 3

DoPlantForestMethod · 0.95
VpSelectTilesWithMethodFunction · 0.85
TileVirtXYFunction · 0.85

Tested by

no test coverage detected