MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / InputWidgetOver

Function InputWidgetOver

src/openrct2-ui/input/MouseInput.cpp:953–981  ·  view source on GitHub ↗

* * rct2: 0x006E9253 */

Source from the content-addressed store, hash-verified

951 * rct2: 0x006E9253
952 */
953 static void InputWidgetOver(const ScreenCoordsXY& screenCoords, WindowBase* w, WidgetIndex widgetIndex)
954 {
955 WindowClass windowClass = WindowClass::null;
956 WindowNumber windowNumber = 0;
957 Widget* widget = nullptr;
958
959 if (w != nullptr)
960 {
961 windowClass = w->classification;
962 windowNumber = w->number;
963 widget = widgetIndex == kWidgetIndexNull ? nullptr : &w->widgets[widgetIndex];
964 }
965
966 InputWidgetOverChangeCheck(windowClass, windowNumber, widgetIndex);
967
968 if (w != nullptr && widgetIndex != kWidgetIndexNull && widget->type == WidgetType::scroll)
969 {
970 int32_t scroll_part, scrollId;
971 ScreenCoordsXY newScreenCoords;
972 widgetScrollGetPart(*w, widget, screenCoords, newScreenCoords, &scroll_part, &scrollId);
973
974 if (scroll_part == SCROLL_PART_VIEW)
975 {
976 w->onScrollMouseOver(scrollId, newScreenCoords);
977 }
978 }
979
980 InputUpdateTooltip(w, widgetIndex, screenCoords);
981 }
982
983 /**
984 *

Callers 1

GameHandleInputMouseFunction · 0.85

Calls 4

widgetScrollGetPartFunction · 0.85
InputUpdateTooltipFunction · 0.85
onScrollMouseOverMethod · 0.45

Tested by

no test coverage detected