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

Method OnInvalidateData

src/object_gui.cpp:300–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298 }
299
300 void OnInvalidateData([[maybe_unused]] int data = 0, [[maybe_unused]] bool gui_scope = true) override
301 {
302 this->PickerWindow::OnInvalidateData(data, gui_scope);
303
304 if (!gui_scope) return;
305
306 PickerInvalidations pi(data);
307 if (pi.Test(PickerInvalidation::Position)) {
308 const auto objclass = ObjectClass::Get(_object_gui.sel_class);
309 const auto spec = objclass->GetSpec(_object_gui.sel_type);
310 _object_gui.sel_view = std::min<int>(_object_gui.sel_view, spec->views - 1);
311 this->UpdateButtons(spec);
312 }
313 }
314
315 void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
316 {

Callers

nothing calls this directly

Calls 3

UpdateButtonsMethod · 0.95
TestMethod · 0.80
GetSpecMethod · 0.45

Tested by

no test coverage detected