From 1adeb35e697b850f953178912b9ecfaa9a89517b Mon Sep 17 00:00:00 2001 From: Duncan Frost Date: Fri, 15 Aug 2014 16:52:18 +0100 Subject: [PATCH] Decompiled first part of left down --- src/game.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/game.c b/src/game.c index 51923944ee..38cfe90ff9 100644 --- a/src/game.c +++ b/src/game.c @@ -866,7 +866,32 @@ static void game_handle_input_mouse(int x, int y, int state) RCT2_CALLPROC_X(0x006E8DA7, x, y, state, widgetIndex, (int)w, (int)widget, 0); break; case INPUT_STATE_VIEWPORT_LEFT: - RCT2_CALLPROC_X(0x006E87B4, x, y, state, widgetIndex, (int)w, (int)widget, 0); + w = window_find_by_id(RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DRAG_WINDOWCLASS, rct_windowclass), RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DRAG_WINDOWNUMBER, rct_windownumber)); + if (!w){ + RCT2_GLOBAL(RCT2_ADDRESS_INPUT_STATE, uint8) = 0; + break; + } + + if (state == 0){ + if (!w->viewport){ + RCT2_GLOBAL(RCT2_ADDRESS_INPUT_STATE, uint8) = 0; + break; + } + + if (w->classification != RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DRAG_WINDOWCLASS, rct_windowclass) || + w->number != RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DRAG_WINDOWNUMBER, rct_windownumber) || + !(RCT2_GLOBAL(0x9DE518, uint32)&(1 << 3)))break; + + w = window_find_by_id(RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, rct_windowclass), RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWNUMBER, rct_windownumber)); + + if (!w)break; + + RCT2_CALLPROC_X(w->event_handlers[WE_TOOL_DRAG], x, y, 0, (int)RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WIDGETINDEX, uint16), (int)w, 0, 0); + } + else if (state == 2){ + //6e883b + RCT2_CALLPROC_X(0x006E87B4, x, y, state, widgetIndex, (int)w, (int)widget, 0); + } break; case INPUT_STATE_SCROLL_LEFT://0x006E8676 //RCT2_CALLPROC_X(0x006E8676, x, y, state, widgetIndex, (int)w, (int)widget, 0);