changeset 6290:f4c87b957772 draft

(svn r9112) -Feature r9111: scrollwheel scrolling can now also scroll the smallmap
author bjarni <bjarni@openttd.org>
date Sun, 11 Mar 2007 11:57:11 +0000
parents 7830dc08984a
children c40a707344df
files src/window.cpp
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1707,6 +1707,11 @@
 	} else {
 		switch (click) {
 			case 1: DispatchLeftClickEvent(w, x - w->left, y - w->top);  break;
+			default:
+				if (!scrollwheel_scrolling || w == NULL || w->window_class != WC_SMALLMAP) break;
+				/* We try to use the scrollwheel to scroll since we didn't touch any of the buttons.
+				* Simulate a right button click so we can get started. */
+				/* fallthough */
 			case 2: DispatchRightClickEvent(w, x - w->left, y - w->top); break;
 		}
 	}