* 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. */
| 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 | { |
no test coverage detected