MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / pickupToolUpdate

Function pickupToolUpdate

src/OpenLoco/src/Ui/Windows/Vehicle.cpp:4713–4737  ·  view source on GitHub ↗

0x004B29C0

Source from the content-addressed store, hash-verified

4711
4712 // 0x004B29C0
4713 static void pickupToolUpdate(Window& self, const int16_t x, const int16_t y)
4714 {
4715 auto* head = getVehicle(self);
4716 if (head == nullptr)
4717 {
4718 return;
4719 }
4720 ToolManager::setToolCursor(kTypeToToolCursor[static_cast<uint8_t>(head->vehicleType)][getGameState().pickupDirection != 0 ? 1 : 0]);
4721
4722 switch (head->mode)
4723 {
4724 case TransportMode::rail:
4725 pickupToolUpdateLand(*head, x, y, getVehicleRailPlacementArgsFromCursor);
4726 break;
4727 case TransportMode::road:
4728 pickupToolUpdateLand(*head, x, y, getVehicleRoadPlacementArgsFromCursor);
4729 break;
4730 case TransportMode::air:
4731 pickupToolUpdateAir(*head, x, y);
4732 break;
4733 case TransportMode::water:
4734 pickupToolUpdateWater(*head, x, y);
4735 break;
4736 }
4737 }
4738
4739 // 0x004B2D8A
4740 static void pickupToolError(const Vehicles::VehicleHead& head)

Callers 1

onToolUpdateFunction · 0.85

Calls 5

getVehicleFunction · 0.85
setToolCursorFunction · 0.85
pickupToolUpdateLandFunction · 0.85
pickupToolUpdateAirFunction · 0.85
pickupToolUpdateWaterFunction · 0.85

Tested by

no test coverage detected