* 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. */
| 1082 | * @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. |
| 1083 | */ |
| 1084 | void OnInvalidateData([[maybe_unused]] int data = 0, [[maybe_unused]] bool gui_scope = true) override |
| 1085 | { |
| 1086 | if (!gui_scope) return; |
| 1087 | if (data == 1) { |
| 1088 | /* Sprite picker finished */ |
| 1089 | this->RaiseWidget(WID_SA_PICKER); |
| 1090 | this->vscroll->SetCount(_newgrf_debug_sprite_picker.sprites.size()); |
| 1091 | } |
| 1092 | |
| 1093 | SpriteAlignerWindow::zoom = Clamp(SpriteAlignerWindow::zoom, _settings_client.gui.zoom_min, _settings_client.gui.zoom_max); |
| 1094 | for (ZoomLevel z = ZoomLevel::Begin; z < ZoomLevel::End; z++) { |
| 1095 | this->SetWidgetsDisabledState(z < _settings_client.gui.zoom_min || z > _settings_client.gui.zoom_max, WID_SA_ZOOM + to_underlying(z)); |
| 1096 | this->SetWidgetsLoweredState(SpriteAlignerWindow::zoom == z, WID_SA_ZOOM + to_underlying(z)); |
| 1097 | } |
| 1098 | } |
| 1099 | |
| 1100 | void OnResize() override |
| 1101 | { |
nothing calls this directly
no test coverage detected