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

Function clearPressedButtons

src/OpenLoco/src/Ui/ScrollView.cpp:505–518  ·  view source on GitHub ↗

0x004C72ED

Source from the content-addressed store, hash-verified

503
504 // 0x004C72ED
505 void clearPressedButtons(const WindowType type, const WindowNumber_t number, const WidgetIndex_t widgetIndex)
506 {
507 auto window = WindowManager::find(type, number);
508 if (window == nullptr)
509 {
510 return;
511 }
512
513 constexpr ScrollFlags horizontalFlags = ScrollFlags::hscrollbarThumbPressed | ScrollFlags::hscrollbarLeftPressed | ScrollFlags::hscrollbarRightPressed;
514 constexpr ScrollFlags verticalFlags = ScrollFlags::vscrollbarThumbPressed | ScrollFlags::vscrollbarUpPressed | ScrollFlags::vscrollbarDownPressed;
515
516 window->scrollAreas[_currentScrollIndex].flags &= ~(verticalFlags | horizontalFlags);
517 WindowManager::invalidateWidget(type, number, widgetIndex);
518 }
519
520 // 0x004C7236
521 void scrollLeftContinue(const int16_t x, const int16_t y, Ui::Window& window, Ui::Widget* const widget, const WidgetIndex_t widgetIndex)

Callers 2

scrollLeftContinueFunction · 0.85
stateScrollLeftFunction · 0.85

Calls 2

findFunction · 0.85
invalidateWidgetFunction · 0.85

Tested by

no test coverage detected