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

Method OnInvalidateData

src/newgrf_debug_gui.cpp:613–622  ·  view source on GitHub ↗

* Some data on this window has become invalid. * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */

Source from the content-addressed store, hash-verified

611 * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
612 */
613 void OnInvalidateData([[maybe_unused]] int data = 0, [[maybe_unused]] bool gui_scope = true) override
614 {
615 if (!gui_scope) return;
616 if (this->HasChainIndex()) {
617 this->ValidateChainIndex();
618 this->SetWidgetDisabledState(WID_NGRFI_VEH_PREV, this->chain_index == 0);
619 Vehicle *v = Vehicle::Get(this->GetFeatureIndex());
620 this->SetWidgetDisabledState(WID_NGRFI_VEH_NEXT, v == nullptr || v->Next() == nullptr);
621 }
622 }
623};
624
625/* static */ uint32_t NewGRFInspectWindow::var60params[GSF_FAKE_END][0x20] = { {0} }; // Use spec to have 0s in whole array

Callers 1

NewGRFInspectWindowMethod · 0.95

Calls 5

HasChainIndexMethod · 0.95
ValidateChainIndexMethod · 0.95
GetFeatureIndexMethod · 0.95
NextMethod · 0.45

Tested by

no test coverage detected