MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / onUpdate

Method onUpdate

src/openrct2-ui/scripting/CustomWindow.cpp:447–479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445 }
446
447 void onUpdate() override
448 {
449 if (_info.Desc.Tabs.size() > static_cast<size_t>(page))
450 {
451 const auto& tab = _info.Desc.Tabs[page];
452 if (tab.imageFrameCount != 0)
453 {
454 currentFrame++;
455 if (currentFrame >= tab.imageFrameCount * tab.imageFrameDuration)
456 {
457 currentFrame = 0;
458 }
459
460 invalidateWidget(WIDX_TAB_0 + this->page);
461 }
462 }
463
464 InvokeEventHandler(_info.Owner, _info.Desc.OnUpdate);
465
466 // Since the plugin may alter widget positions and sizes during an update event,
467 // we need to force an update for all list view scrollbars
468 WidgetIndex widgetIndex = 0;
469 for (auto& widget : widgets)
470 {
471 if (widget.type == WidgetType::scroll)
472 {
473 widgetScrollUpdateThumbs(*this, widgetIndex);
474 }
475 widgetIndex++;
476 }
477
478 UpdateViewport();
479 }
480
481 void onPrepareDraw() override
482 {

Callers

nothing calls this directly

Calls 3

InvokeEventHandlerFunction · 0.85
widgetScrollUpdateThumbsFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected