1
0
Fork 0

(svn r3222) -Feature: Right-Click-Scrolling optionally moves in the opposite direction (Requested by manx)

release/0.4.5
tron 2005-11-19 12:37:28 +00:00
parent c7683a63ce
commit f2b344084a
6 changed files with 16 additions and 5 deletions

View File

@ -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}

View File

@ -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}

View File

@ -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},

View File

@ -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},

View File

@ -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

View File

@ -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;