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

Method OnInvalidateData

src/waypoint_gui.cpp:166–175  ·  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

164 * @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.
165 */
166 void OnInvalidateData([[maybe_unused]] int data = 0, [[maybe_unused]] bool gui_scope = true) override
167 {
168 if (!gui_scope) return;
169 /* You can only change your own waypoints */
170 this->SetWidgetDisabledState(WID_W_RENAME, !this->wp->IsInUse() || (this->wp->owner != _local_company && this->wp->owner != OWNER_NONE));
171 /* Disable the widget for waypoints with no use */
172 this->SetWidgetDisabledState(WID_W_SHOW_VEHICLES, !this->wp->IsInUse());
173
174 ScrollWindowToTile(this->GetCenterTile(), this, true);
175 }
176
177 void OnResize() override
178 {

Callers 1

WaypointWindowMethod · 0.95

Calls 4

GetCenterTileMethod · 0.95
ScrollWindowToTileFunction · 0.85
IsInUseMethod · 0.80

Tested by

no test coverage detected