1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Window Class Refactor: Invention List Drag (#17415)

* Start working on drag

* Finish moving invention drag into window class

* Refactor drag item into a window variable

* Remove rct2 comment
This commit is contained in:
Duncan
2022-06-30 10:25:18 +01:00
committed by GitHub
parent ac7331f878
commit 43562a6899
4 changed files with 139 additions and 126 deletions

View File

@@ -1620,17 +1620,23 @@ OpenRCT2String window_event_tooltip_call(rct_window* w, const rct_widgetindex wi
CursorID window_event_cursor_call(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
{
CursorID cursorId = CursorID::Arrow;
if (w->event_handlers != nullptr)
if (w->event_handlers->cursor != nullptr)
w->event_handlers->cursor(w, widgetIndex, screenCoords, &cursorId);
if (w->event_handlers == nullptr)
{
cursorId = w->OnCursor(widgetIndex, screenCoords, cursorId);
}
else if (w->event_handlers->cursor != nullptr)
w->event_handlers->cursor(w, widgetIndex, screenCoords, &cursorId);
return cursorId;
}
void window_event_moved_call(rct_window* w, const ScreenCoordsXY& screenCoords)
{
if (w->event_handlers != nullptr)
if (w->event_handlers->moved != nullptr)
w->event_handlers->moved(w, screenCoords);
if (w->event_handlers == nullptr)
{
w->OnMoved(screenCoords);
}
else if (w->event_handlers->moved != nullptr)
w->event_handlers->moved(w, screenCoords);
}
void window_event_invalidate_call(rct_window* w)