| 3306 | } |
| 3307 | |
| 3308 | EventState OnHotkey(int hotkey) override |
| 3309 | { |
| 3310 | /* If the hotkey is not for any widget in the UI (i.e. for honking) */ |
| 3311 | if (hotkey == WID_VV_HONK_HORN) { |
| 3312 | const Window *mainwindow = GetMainWindow(); |
| 3313 | const Vehicle *v = Vehicle::Get(window_number); |
| 3314 | /* Only play the sound if we're following this vehicle */ |
| 3315 | if (mainwindow->viewport->follow_vehicle == v->index) { |
| 3316 | v->PlayLeaveStationSound(true); |
| 3317 | } |
| 3318 | } |
| 3319 | return Window::OnHotkey(hotkey); |
| 3320 | } |
| 3321 | |
| 3322 | void OnQueryTextFinished(std::optional<std::string> str) override |
| 3323 | { |
nothing calls this directly
no test coverage detected