MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / getScrollDataIndex

Method getScrollDataIndex

src/OpenLoco/src/Ui/Window.cpp:518–544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

516 }
517
518 int8_t Window::getScrollDataIndex(WidgetIndex_t targetIndex)
519 {
520 if (widgets[targetIndex].type != WidgetType::scrollview)
521 {
522 assert(false);
523 return -1;
524 }
525
526 auto widgetIndex = 0;
527 auto scrollIndex = 0;
528 for (auto& widget : widgets)
529 {
530 widgetIndex++;
531 if (widgetIndex == targetIndex)
532 {
533 return scrollIndex;
534 }
535
536 if (widget.type == WidgetType::scrollview)
537 {
538 scrollIndex++;
539 }
540 }
541
542 assert(false);
543 return -2;
544 }
545
546 // 0x004CC7CB
547 void Window::setDisabledWidgetsAndInvalidate(uint32_t _disabledWidgets)

Callers 5

updateThumbsFunction · 0.80
windowScrollWheelInputFunction · 0.80
wheelInputFunction · 0.80
scrollDragFunction · 0.80
scrollDragBeginFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected