0x004B399E
| 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) |
| 1465 | { |
| 1466 | Ui::ToolTip::setTooltipTimeout(2000); |
| 1467 | self.flags &= ~WindowFlags::notScrollView; |
| 1468 | auto car = Common::getCarFromScrollView(self, y); |
| 1469 | StringId tooltipFormat = StringIds::null; |
| 1470 | EntityId tooltipContent = EntityId::null; |
| 1471 | if (car) |
| 1472 | { |
| 1473 | tooltipFormat = StringIds::buffer_337; |
| 1474 | tooltipContent = car->front->id; |
| 1475 | } |
| 1476 | if (EntityId(self.rowHover) != tooltipContent) |
| 1477 | { |
| 1478 | self.rowHover = enumValue(tooltipContent); |
| 1479 | self.invalidate(); |
| 1480 | } |
| 1481 | |
| 1482 | char* buffer = const_cast<char*>(StringManager::getString(StringIds::buffer_337)); |
| 1483 | if (StringManager::locoStrlen(buffer) != 0) |
| 1484 | { |
| 1485 | if (self.widgets[widx::carList].tooltip == tooltipFormat && self.var_85C == enumValue(tooltipContent)) |
| 1486 | { |
| 1487 | return; |
| 1488 | } |
| 1489 | } |
| 1490 | |
| 1491 | self.widgets[widx::carList].tooltip = tooltipFormat; |
| 1492 | self.var_85C = enumValue(tooltipContent); |
| 1493 | ToolTip::closeAndReset(); |
| 1494 | |
| 1495 | if (tooltipContent == EntityId::null) |
| 1496 | { |
| 1497 | return; |
| 1498 | } |
| 1499 | |
| 1500 | Ui::ToolTip::set_52336E(true); |
| 1501 | |
| 1502 | auto vehicleObj = ObjectManager::get<VehicleObject>(car->front->objectId); |
| 1503 | { |
| 1504 | FormatArguments args{}; |
| 1505 | args.push(vehicleObj->name); |
| 1506 | buffer = StringManager::formatString(buffer, StringIds::tooltip_stringid, args); |
| 1507 | } |
| 1508 | |
| 1509 | { |
| 1510 | FormatArguments args{}; |
| 1511 | args.push(car->front->creationDay); |
| 1512 | buffer = StringManager::formatString(buffer, StringIds::vehicle_details_tooltip_built, args); |
| 1513 | } |
| 1514 | |
| 1515 | if (vehicleObj->power != 0 && (vehicleObj->mode == TransportMode::road || vehicleObj->mode == TransportMode::rail)) |
| 1516 | { |
| 1517 | FormatArguments args{}; |
| 1518 | args.push(vehicleObj->power); |
| 1519 | buffer = StringManager::formatString(buffer, StringIds::vehicle_details_tooltip_power, args); |
| 1520 | } |
| 1521 |
nothing calls this directly
no test coverage detected