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

Method OnInvalidateData

src/newgrf_debug_gui.cpp:1084–1098  ·  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

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 {

Callers

nothing calls this directly

Calls 7

ClampFunction · 0.85
to_underlyingFunction · 0.85
RaiseWidgetMethod · 0.80
SetCountMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected