From f2b344084accd953a8e26db9a4196688f07a30a5 Mon Sep 17 00:00:00 2001 From: tron Date: Sat, 19 Nov 2005 12:37:28 +0000 Subject: (svn r3222) -Feature: Right-Click-Scrolling optionally moves in the opposite direction (Requested by manx) --- lang/english.txt | 1 + lang/german.txt | 1 + settings.c | 1 + settings_gui.c | 1 + variables.h | 1 + window.c | 16 +++++++++++----- 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lang/english.txt b/lang/english.txt index 657a55c5c..678a646f9 100644 --- a/lang/english.txt +++ b/lang/english.txt @@ -998,6 +998,7 @@ STR_CONFIG_PATCHES_SNOWLINE_HEIGHT :{LTBLUE}Snow li STR_CONFIG_PATCHES_STATION_SPREAD :{LTBLUE}Max station spread: {ORANGE}{STRING1} {RED}Warning: High setting slows game STR_CONFIG_PATCHES_SERVICEATHELIPAD :{LTBLUE}Service helicopters at helipads automatically: {ORANGE}{STRING1} STR_CONFIG_PATCHES_LINK_TERRAFORM_TOOLBAR :{LTBLUE}Link landscape toolbar to rail/road/water/airport toolbars: {ORANGE}{STRING1} +STR_CONFIG_PATCHES_REVERSE_SCROLLING :{LTBLUE}When scrolling with the mouse move the view in the opposite direction: {ORANGE}{STRING1} STR_CONFIG_PATCHES_MAX_TRAINS :{LTBLUE}Max trains per player: {ORANGE}{STRING1} STR_CONFIG_PATCHES_MAX_ROADVEH :{LTBLUE}Max road vehicles per player: {ORANGE}{STRING1} diff --git a/lang/german.txt b/lang/german.txt index d3fa3ce4c..02e77f005 100644 --- a/lang/german.txt +++ b/lang/german.txt @@ -996,6 +996,7 @@ STR_CONFIG_PATCHES_INVISIBLE_TREES :{LTBLUE}Unsicht STR_CONFIG_PATCHES_SNOWLINE_HEIGHT :{LTBLUE}Höhe der Schneegrenze: {ORANGE}{STRING} STR_CONFIG_PATCHES_STATION_SPREAD :{LTBLUE}Maximale Stationsgröße: {ORANGE}{STRING} {RED}Achtung: Große Werte verlangsamen das Spiel STR_CONFIG_PATCHES_SERVICEATHELIPAD :{LTBLUE}Hubschrauber auf Helipads automatisch warten: {ORANGE}{STRING} +STR_CONFIG_PATCHES_REVERSE_SCROLLING :{LTBLUE}Beim Verschieben mit der Maus die Ansicht in die Gegenrichtung verschieben: {ORANGE}{STRING} STR_CONFIG_PATCHES_MAX_TRAINS :{LTBLUE}Maximale Anzahl der Züge pro Spieler: {ORANGE}{STRING} STR_CONFIG_PATCHES_MAX_ROADVEH :{LTBLUE}Maximale Anzahl der Straßenfahrzeuge pro Spieler: {ORANGE}{STRING} diff --git a/settings.c b/settings.c index 4456c0988..11a5832c5 100644 --- a/settings.c +++ b/settings.c @@ -842,6 +842,7 @@ static const SettingDesc patch_player_settings[] = { {"status_long_date", SDT_BOOL, (void*)true, &_patches.status_long_date, NULL}, {"show_finances", SDT_BOOL, (void*)true, &_patches.show_finances, NULL}, {"autoscroll", SDT_BOOL, (void*)false, &_patches.autoscroll, NULL}, + {"reverse_scroll", SDT_BOOL, (void*)false, &_patches.reverse_scroll, NULL}, {"errmsg_duration", SDT_UINT8, (void*)5, &_patches.errmsg_duration, NULL}, {"toolbar_pos", SDT_UINT8, (void*)0, &_patches.toolbar_pos, NULL}, {"keep_all_autosave", SDT_BOOL, (void*)false, &_patches.keep_all_autosave, NULL}, diff --git a/settings_gui.c b/settings_gui.c index 433a7799d..d34a518e9 100644 --- a/settings_gui.c +++ b/settings_gui.c @@ -666,6 +666,7 @@ static const PatchEntry _patches_ui[] = { {PE_BOOL, PF_PLAYERBASED, STR_CONFIG_PATCHES_LONGDATE, "long_date", &_patches.status_long_date, 0, 0, 0, NULL}, {PE_BOOL, PF_PLAYERBASED, STR_CONFIG_PATCHES_SHOWFINANCES, "show_finances", &_patches.show_finances, 0, 0, 0, NULL}, {PE_BOOL, PF_PLAYERBASED, STR_CONFIG_PATCHES_AUTOSCROLL, "autoscroll", &_patches.autoscroll, 0, 0, 0, NULL}, + {PE_BOOL, PF_PLAYERBASED, STR_CONFIG_PATCHES_REVERSE_SCROLLING, "reverse_scroll", &_patches.reverse_scroll, 0, 0, 0, NULL }, {PE_UINT8, PF_PLAYERBASED, STR_CONFIG_PATCHES_ERRMSG_DURATION, "errmsg_duration", &_patches.errmsg_duration, 0, 20, 1, NULL}, diff --git a/variables.h b/variables.h index 1e9bb99eb..7043d2a2d 100644 --- a/variables.h +++ b/variables.h @@ -120,6 +120,7 @@ typedef struct Patches { bool invisible_trees; // don't show trees when buildings are transparent bool no_servicing_if_no_breakdowns; // dont send vehicles to depot when breakdowns are disabled bool link_terraform_toolbar; // display terraform toolbar when displaying rail, road, water and airport toolbars + bool reverse_scroll; // Right-Click-Scrolling scrolls in the opposite direction uint8 toolbar_pos; // position of toolbars, 0=left, 1=center, 2=right uint8 window_snap_radius; // Windows snap at each other if closer than this diff --git a/window.c b/window.c index 79540e860..be2f8d408 100644 --- a/window.c +++ b/window.c @@ -1182,13 +1182,22 @@ stop_capt:; w = FindWindowFromPt(_cursor.pos.x, _cursor.pos.y); if (w == NULL) goto stop_capt; + if (_patches.reverse_scroll) { + dx = -_cursor.delta.x; + dy = -_cursor.delta.y; + } else { + dx = _cursor.delta.x; + dy = _cursor.delta.y; + } + if (w->window_class != WC_SMALLMAP) { vp = IsPtInWindowViewport(w, _cursor.pos.x, _cursor.pos.y); if (vp == NULL) goto stop_capt; - WP(w,vp_d).scrollpos_x += _cursor.delta.x << vp->zoom; - WP(w,vp_d).scrollpos_y += _cursor.delta.y << vp->zoom; + WP(w,vp_d).scrollpos_x += dx << vp->zoom; + WP(w,vp_d).scrollpos_y += dy << vp->zoom; + _cursor.delta.x = _cursor.delta.y = 0; return false; } else { @@ -1200,9 +1209,6 @@ stop_capt:; _cursor.fix_at = true; - dx = _cursor.delta.x; - dy = _cursor.delta.y; - x = WP(w,smallmap_d).scroll_x; y = WP(w,smallmap_d).scroll_y; -- cgit v1.2.3-70-g09d2