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

Function hButtonRight

src/OpenLoco/src/Ui/ScrollView.cpp:344–356  ·  view source on GitHub ↗

0x004C89AE

Source from the content-addressed store, hash-verified

342
343 // 0x004C89AE
344 static void hButtonRight(Ui::Window& window, const size_t scrollAreaIndex, const WidgetIndex_t widgetIndex)
345 {
346 window.scrollAreas[scrollAreaIndex].flags |= ScrollFlags::hscrollbarRightPressed;
347 int16_t trackWidth = window.widgets[widgetIndex].width() - 2;
348 if (window.scrollAreas[scrollAreaIndex].hasFlags(ScrollFlags::vscrollbarVisible))
349 {
350 trackWidth -= kScrollbarSize;
351 }
352 int16_t widgetContentWidth = std::max(window.scrollAreas[scrollAreaIndex].contentWidth - trackWidth, 0);
353 window.scrollAreas[scrollAreaIndex].contentOffsetX = std::min<int16_t>(window.scrollAreas[scrollAreaIndex].contentOffsetX + kButtonClickStep, widgetContentWidth);
354 ScrollView::updateThumbs(window, widgetIndex);
355 WindowManager::invalidateWidget(window.type, window.number, widgetIndex);
356 }
357
358 // 0x004C8A36
359 static void hTrackLeft(Ui::Window& window, const size_t scrollAreaIndex, const WidgetIndex_t widgetIndex)

Callers 2

scrollLeftBeginFunction · 0.85
scrollLeftContinueFunction · 0.85

Calls 4

updateThumbsFunction · 0.85
invalidateWidgetFunction · 0.85
widthMethod · 0.45
hasFlagsMethod · 0.45

Tested by

no test coverage detected