0x004B5A1A
| 3472 | |
| 3473 | // 0x004B5A1A |
| 3474 | static Ui::ViewportInteraction::InteractionArg getRouteInteractionFromCursor(Window& self, const int16_t x, const int16_t y) |
| 3475 | { |
| 3476 | auto head = Common::getVehicle(self); |
| 3477 | auto flags = ViewportInteraction::InteractionItemFlags::track |
| 3478 | | ViewportInteraction::InteractionItemFlags::roadAndTram |
| 3479 | | ViewportInteraction::InteractionItemFlags::station |
| 3480 | | ViewportInteraction::InteractionItemFlags::stationLabel; |
| 3481 | |
| 3482 | if (head->mode == TransportMode::water) |
| 3483 | { |
| 3484 | flags = ViewportInteraction::InteractionItemFlags::water |
| 3485 | | ViewportInteraction::InteractionItemFlags::station |
| 3486 | | ViewportInteraction::InteractionItemFlags::stationLabel; |
| 3487 | } |
| 3488 | auto [interaction, viewport] = ViewportInteraction::getMapCoordinatesFromPos(x, y, ~flags); |
| 3489 | |
| 3490 | switch (interaction.type) |
| 3491 | { |
| 3492 | case ViewportInteraction::InteractionItem::track: |
| 3493 | return trackAdjustedInteraction(*head, self.orderTableIndex, interaction); |
| 3494 | |
| 3495 | case ViewportInteraction::InteractionItem::road: |
| 3496 | return roadAdjustedInteraction(*head, self.orderTableIndex, interaction); |
| 3497 | |
| 3498 | case ViewportInteraction::InteractionItem::trainStation: |
| 3499 | return trainStationAdjustedInteraction(*head, self.orderTableIndex, interaction); |
| 3500 | |
| 3501 | case ViewportInteraction::InteractionItem::roadStation: |
| 3502 | return stationAdjustedInteraction(*head, self.orderTableIndex, static_cast<TileElement*>(interaction.object), interaction); |
| 3503 | |
| 3504 | case ViewportInteraction::InteractionItem::airport: |
| 3505 | case ViewportInteraction::InteractionItem::dock: |
| 3506 | return dockAirportAdjustedInteraction(*head, self.orderTableIndex, interaction); |
| 3507 | |
| 3508 | case ViewportInteraction::InteractionItem::stationLabel: |
| 3509 | return stationLabelAdjustedInteraction(*head, self.orderTableIndex, static_cast<StationId>(interaction.value), interaction); |
| 3510 | |
| 3511 | case ViewportInteraction::InteractionItem::water: |
| 3512 | return waterAdjustedInteraction(*head, interaction); |
| 3513 | |
| 3514 | default: |
| 3515 | return ViewportInteraction::kNoInteractionArg; |
| 3516 | } |
| 3517 | } |
| 3518 | |
| 3519 | // 0x004B5088 |
| 3520 | static void toolCancel(Window& self, [[maybe_unused]] const WidgetIndex_t widgetIdx, [[maybe_unused]] const WidgetId id) |
no test coverage detected