diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index 6dca4b40c2..c3c2ec152a 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -618,7 +618,7 @@ static void InputScrollBegin(rct_window& w, WidgetIndex widgetIndex, const Scree _currentScrollArea = scroll_area; _currentScrollIndex = scroll_id; - window_event_unknown_15_call(&w, scroll_id, scroll_area); + window_event_scroll_select_call(&w, scroll_id, scroll_area); if (scroll_area == SCROLL_PART_VIEW) { window_event_scroll_mousedown_call(&w, scroll_id, scrollCoords); diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 49e20f7774..e6af4f712f 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -628,7 +628,7 @@ static WindowEventList window_ride_graphs_events([](auto& events) { events.mouse_down = &WindowRideGraphsMousedown; events.update = &WindowRideGraphsUpdate; events.get_scroll_size = &WindowRideGraphsScrollgetheight; - events.unknown_15 = &WindowRideGraphs15; + events.scroll_select = &WindowRideGraphs15; events.tooltip = &WindowRideGraphsTooltip; events.invalidate = &WindowRideGraphsInvalidate; events.paint = &WindowRideGraphsPaint; diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 6a842cd84a..25d48a962b 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -1574,11 +1574,12 @@ void window_event_viewport_rotate_call(rct_window* w) w->event_handlers->viewport_rotate(w); } -void window_event_unknown_15_call(rct_window* w, int32_t scrollIndex, int32_t scrollAreaType) +void window_event_scroll_select_call(rct_window* w, int32_t scrollIndex, int32_t scrollAreaType) { - if (w->event_handlers != nullptr) - if (w->event_handlers->unknown_15 != nullptr) - w->event_handlers->unknown_15(w, scrollIndex, scrollAreaType); + if (w->event_handlers == nullptr) + w->OnScrollSelect(scrollIndex, scrollAreaType); + else if (w->event_handlers->scroll_select != nullptr) + w->event_handlers->scroll_select(w, scrollIndex, scrollAreaType); } OpenRCT2String window_event_tooltip_call(rct_window* w, const WidgetIndex widgetIndex, const StringId fallback) diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index ae6ffd1bfe..a850da4865 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -241,7 +241,7 @@ struct WindowEventList void (*scroll_mouseover)(struct rct_window*, int32_t, const ScreenCoordsXY&){}; void (*text_input)(struct rct_window*, WidgetIndex, char*){}; void (*viewport_rotate)(struct rct_window*){}; - void (*unknown_15)(struct rct_window*, int32_t, int32_t){}; + void (*scroll_select)(struct rct_window*, int32_t, int32_t){}; OpenRCT2String (*tooltip)(struct rct_window*, const WidgetIndex, const StringId){}; void (*cursor)(struct rct_window*, WidgetIndex, const ScreenCoordsXY&, CursorID*){}; void (*moved)(struct rct_window*, const ScreenCoordsXY&){}; @@ -685,7 +685,7 @@ void window_event_scroll_mousedrag_call(rct_window* w, int32_t scrollIndex, cons void window_event_scroll_mouseover_call(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); void window_event_textinput_call(rct_window* w, WidgetIndex widgetIndex, char* text); void window_event_viewport_rotate_call(rct_window* w); -void window_event_unknown_15_call(rct_window* w, int32_t scrollIndex, int32_t scrollAreaType); +void window_event_scroll_select_call(rct_window* w, int32_t scrollIndex, int32_t scrollAreaType); OpenRCT2String window_event_tooltip_call(rct_window* w, const WidgetIndex widgetIndex, const StringId fallback); CursorID window_event_cursor_call(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); void window_event_moved_call(rct_window* w, const ScreenCoordsXY& screenCoords); diff --git a/src/openrct2/interface/Window_internal.h b/src/openrct2/interface/Window_internal.h index 2b09d0e036..b50219ee8f 100644 --- a/src/openrct2/interface/Window_internal.h +++ b/src/openrct2/interface/Window_internal.h @@ -157,6 +157,9 @@ struct rct_window { return {}; } + virtual void OnScrollSelect(int32_t scrollIndex, int32_t scrollAreaType) + { + } virtual void OnScrollMouseDrag(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) { }