changeset 10527:4009f0225cef draft

(svn r14784) -Change: don't close and reopen the vehicle order/detail windows, just refocus them instead.
author rubidium <rubidium@openttd.org>
date Fri, 02 Jan 2009 20:01:28 +0000
parents a561cbad3a1b
children faf41b99dbc3
files src/order_gui.cpp src/vehicle_gui.cpp
diffstat 2 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -1267,10 +1267,8 @@
 
 void ShowOrdersWindow(const Vehicle *v)
 {
-	VehicleID veh = v->index;
-
-	DeleteWindowById(WC_VEHICLE_ORDERS, veh);
-	DeleteWindowById(WC_VEHICLE_DETAILS, veh);
+	DeleteWindowById(WC_VEHICLE_DETAILS, v->index);
+	if (BringWindowToFrontById(WC_VEHICLE_ORDERS, v->index) != NULL) return;
 
 	if (v->owner != _local_company) {
 		new OrdersWindow(&_other_orders_desc, v);
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -1553,7 +1553,6 @@
 static void ShowVehicleDetailsWindow(const Vehicle *v)
 {
 	DeleteWindowById(WC_VEHICLE_ORDERS, v->index);
-	DeleteWindowById(WC_VEHICLE_DETAILS, v->index);
 	AllocateWindowDescFront<VehicleDetailsWindow>(&_vehicle_details_desc, v->index);
 }