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

Function scrollMouseDown

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

0x004B3B54

Source from the content-addressed store, hash-verified

1427
1428 // 0x004B3B54
1429 static void scrollMouseDown(Window& self, [[maybe_unused]] const int16_t x, const int16_t y, [[maybe_unused]] const uint8_t scrollIndex)
1430 {
1431 auto head = Common::getVehicle(self);
1432 if (head == nullptr)
1433 {
1434 return;
1435 }
1436 if (head->owner != CompanyManager::getControllingId())
1437 {
1438 return;
1439 }
1440
1441 auto car = Common::getCarFromScrollView(self, y);
1442 if (!car)
1443 {
1444 return;
1445 }
1446
1447 OpenLoco::Vehicles::Vehicle train{ *head };
1448 for (auto c : train.cars)
1449 {
1450 if (c.front == car->front)
1451 {
1452 if (isPaintToolActive(self))
1453 {
1454 paintToolDownScroll(self, c, x);
1455 return;
1456 }
1457 DragVehiclePart::open(c);
1458 break;
1459 }
1460 }
1461 }
1462
1463 // 0x004B399E
1464 static void scrollMouseOver(Window& self, [[maybe_unused]] const int16_t x, const int16_t y, [[maybe_unused]] const uint8_t scrollIndex)

Callers

nothing calls this directly

Calls 15

getVehicleFunction · 0.85
getControllingIdFunction · 0.85
getCarFromScrollViewFunction · 0.85
isPaintToolActiveFunction · 0.85
paintToolDownScrollFunction · 0.85
getOrderTableFunction · 0.85
toolGetActiveWindowFunction · 0.85
playSoundFunction · 0.85
getDragLastLocationFunction · 0.85
addNewOrderFunction · 0.85
bringToFrontFunction · 0.85
getMainWindowFunction · 0.85

Tested by

no test coverage detected