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

Method OnClick

src/object_gui.cpp:315–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313 }
314
315 void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
316 {
317 switch (widget) {
318 case WID_BO_OBJECT_SPRITE:
319 if (_object_gui.sel_type != std::numeric_limits<uint16_t>::max()) {
320 _object_gui.sel_view = this->GetWidget<NWidgetBase>(widget)->GetParentWidget<NWidgetMatrix>()->GetCurrentElement();
321 this->InvalidateData(PickerInvalidation::Position);
322 SndClickBeep();
323 }
324 break;
325
326 default:
327 this->PickerWindow::OnClick(pt, widget, click_count);
328 break;
329 }
330 }
331
332 void OnPlaceObject([[maybe_unused]] Point pt, TileIndex tile) override
333 {

Callers

nothing calls this directly

Calls 4

SndClickBeepFunction · 0.85
GetCurrentElementMethod · 0.80
InvalidateDataMethod · 0.45

Tested by

no test coverage detected