MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / OnClick

Method OnClick

src/dock_gui.cpp:460–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

458 }
459
460 void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
461 {
462 switch (widget) {
463 case WID_BDSW_LT_OFF:
464 case WID_BDSW_LT_ON:
465 this->RaiseWidget(_settings_client.gui.station_show_coverage + WID_BDSW_LT_OFF);
466 _settings_client.gui.station_show_coverage = (widget != WID_BDSW_LT_OFF);
467 this->LowerWidget(_settings_client.gui.station_show_coverage + WID_BDSW_LT_OFF);
468 SndClickBeep();
469 this->SetDirty();
470 SetViewportCatchmentStation(nullptr, true);
471 break;
472 }
473 }
474
475 void OnRealtimeTick([[maybe_unused]] uint delta_ms) override
476 {

Callers

nothing calls this directly

Calls 5

SndClickBeepFunction · 0.85
RaiseWidgetMethod · 0.80
LowerWidgetMethod · 0.80
SetDirtyMethod · 0.45

Tested by

no test coverage detected