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

Function windowWheelInput

src/OpenLoco/src/Ui/WindowManager.cpp:1265–1288  ·  view source on GitHub ↗

0x004C628E

Source from the content-addressed store, hash-verified

1263
1264 // 0x004C628E
1265 static bool windowWheelInput(Window& window, int wheel)
1266 {
1267 WidgetIndex_t widgetIndex = kWidgetIndexNull;
1268 int scrollIndex = -1;
1269 for (auto& widget : window.widgets)
1270 {
1271 widgetIndex++;
1272
1273 if (widget.type != WidgetType::scrollview)
1274 {
1275 continue;
1276 }
1277
1278 scrollIndex++;
1279 constexpr ScrollFlags scrollbarFlags = ScrollFlags::hscrollbarVisible | ScrollFlags::vscrollbarVisible;
1280 if (window.scrollAreas[scrollIndex].hasFlags(scrollbarFlags))
1281 {
1282 windowScrollWheelInput(window, widgetIndex, wheel);
1283 return true;
1284 }
1285 }
1286
1287 return false;
1288 }
1289
1290 void wheelInput(int wheel)
1291 {

Callers 1

wheelInputFunction · 0.85

Calls 2

windowScrollWheelInputFunction · 0.85
hasFlagsMethod · 0.45

Tested by

no test coverage detected