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

Function stateScrollLeft

src/OpenLoco/src/Input/MouseInput.cpp:632–658  ·  view source on GitHub ↗

0x004C71F6

Source from the content-addressed store, hash-verified

630
631 // 0x004C71F6
632 static void stateScrollLeft(const MouseButton button, const WidgetIndex_t widgetIndex, Ui::Window* window, Ui::Widget* const widget, const int32_t x, const int32_t y)
633 {
634 switch (button)
635 {
636 case MouseButton::released:
637 {
638 if (widgetIndex != _pressedWidgetIndex || window->type != _pressedWindowType || window->number != _pressedWindowNumber)
639 {
640 ScrollView::clearPressedButtons(_pressedWindowType, _pressedWindowNumber, _pressedWidgetIndex);
641 return;
642 }
643 ScrollView::scrollLeftContinue(x, y, *window, widget, widgetIndex);
644
645 break;
646 }
647
648 case MouseButton::leftReleased:
649 {
650 Input::state(State::reset);
651 ScrollView::clearPressedButtons(_pressedWindowType, _pressedWindowNumber, _pressedWidgetIndex);
652 break;
653 }
654
655 default:
656 break;
657 }
658 }
659
660 // 0x004C76A7
661 // regs.cx = (uint16_t)button;

Callers 1

handleMouseFunction · 0.85

Calls 3

clearPressedButtonsFunction · 0.85
scrollLeftContinueFunction · 0.85
stateFunction · 0.50

Tested by

no test coverage detected