diff src/station_gui.cpp @ 9094:a3f3038e9b9a draft

(svn r12953) -Feature: Open a new viewport when ctrl-clicking on a 'Location' button, a town/station/industry list, or some news items.
author peter1138 <peter1138@openttd.org>
date Mon, 05 May 2008 11:36:43 +0000
parents c0e03990caf0
children d48433370037
line wrap: on
line diff
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -422,7 +422,12 @@
 					const Station *st = sl->sort_list[id_v];
 					/* do not check HasStationInUse - it is slow and may be invalid */
 					assert(st->owner == owner || (st->owner == OWNER_NONE && !st->IsBuoy()));
-					ScrollMainWindowToTile(st->xy);
+
+					if (_ctrl_pressed) {
+						ShowExtraViewPortWindow(st->xy);
+					} else {
+						ScrollMainWindowToTile(st->xy);
+					}
 					break;
 				}
 
@@ -936,7 +941,11 @@
 					break;
 
 				case SVW_LOCATION:
-					ScrollMainWindowToTile(GetStation(w->window_number)->xy);
+					if (_ctrl_pressed) {
+						ShowExtraViewPortWindow(GetStation(w->window_number)->xy);
+					} else {
+						ScrollMainWindowToTile(GetStation(w->window_number)->xy);
+					}
 					break;
 
 				case SVW_RATINGS: