mirror of https://github.com/OpenTTD/OpenTTD
(svn r21820) -Codechange: Concatenate both functions.
parent
a2297dc594
commit
1e7c3fd2ff
|
@ -1424,15 +1424,15 @@ static void HandlePlacePresize()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle dragging in mouse dragging mode (#WSM_DRAGDROP).
|
* Handle dragging and dropping in mouse dragging mode (#WSM_DRAGDROP).
|
||||||
* @return State of handling the event.
|
* @return State of handling the event.
|
||||||
*/
|
*/
|
||||||
static EventState HandleMouseDrag()
|
static EventState HandleMouseDragDrop()
|
||||||
{
|
{
|
||||||
Window *w;
|
Window *w;
|
||||||
|
|
||||||
if (_special_mouse_mode != WSM_DRAGDROP) return ES_NOT_HANDLED;
|
if (_special_mouse_mode != WSM_DRAGDROP) goto handle_dragdop;
|
||||||
if (!_left_button_down || (_cursor.delta.x == 0 && _cursor.delta.y == 0)) return ES_NOT_HANDLED;
|
if (!_left_button_down || (_cursor.delta.x == 0 && _cursor.delta.y == 0)) goto handle_dragdop;
|
||||||
|
|
||||||
w = _thd.GetCallbackWnd();
|
w = _thd.GetCallbackWnd();
|
||||||
|
|
||||||
|
@ -1445,18 +1445,12 @@ static EventState HandleMouseDrag()
|
||||||
}
|
}
|
||||||
|
|
||||||
return ES_HANDLED;
|
return ES_HANDLED;
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
handle_dragdop:
|
||||||
* Handle drop in mouse dragging mode (#WSM_DRAGDROP).
|
|
||||||
* @return State of handling the event.
|
|
||||||
*/
|
|
||||||
static EventState HandleDragDrop()
|
|
||||||
{
|
|
||||||
if (_special_mouse_mode != WSM_DRAGDROP) return ES_NOT_HANDLED;
|
if (_special_mouse_mode != WSM_DRAGDROP) return ES_NOT_HANDLED;
|
||||||
if (_left_button_down) return ES_HANDLED;
|
if (_left_button_down) return ES_HANDLED;
|
||||||
|
|
||||||
Window *w = _thd.GetCallbackWnd();
|
w = _thd.GetCallbackWnd();
|
||||||
|
|
||||||
if (w != NULL) {
|
if (w != NULL) {
|
||||||
/* send an event in client coordinates. */
|
/* send an event in client coordinates. */
|
||||||
|
@ -2178,8 +2172,7 @@ static void MouseLoop(MouseClick click, int mousewheel)
|
||||||
UpdateTileSelection();
|
UpdateTileSelection();
|
||||||
|
|
||||||
if (VpHandlePlaceSizingDrag() == ES_HANDLED) return;
|
if (VpHandlePlaceSizingDrag() == ES_HANDLED) return;
|
||||||
if (HandleMouseDrag() == ES_HANDLED) return;
|
if (HandleMouseDragDrop() == ES_HANDLED) return;
|
||||||
if (HandleDragDrop() == ES_HANDLED) return;
|
|
||||||
if (HandleWindowDragging() == ES_HANDLED) return;
|
if (HandleWindowDragging() == ES_HANDLED) return;
|
||||||
if (HandleScrollbarScrolling() == ES_HANDLED) return;
|
if (HandleScrollbarScrolling() == ES_HANDLED) return;
|
||||||
if (HandleViewportScroll() == ES_HANDLED) return;
|
if (HandleViewportScroll() == ES_HANDLED) return;
|
||||||
|
|
Loading…
Reference in New Issue