(svn r11899) -Cleanup: Remove ShowReplaceVehicleWindow() as it is basically a duplicate of ShowReplaceGroupVehicleWindow().
authorfrosch
Thu, 17 Jan 2008 17:35:59 +0000
changeset 8333 b01316b861c2
parent 8332 7226194fb681
child 8334 9c2b712806a5
(svn r11899) -Cleanup: Remove ShowReplaceVehicleWindow() as it is basically a duplicate of ShowReplaceGroupVehicleWindow().
src/autoreplace_gui.cpp
src/autoreplace_gui.h
src/vehicle_gui.cpp
--- a/src/autoreplace_gui.cpp	Thu Jan 17 17:13:47 2008 +0000
+++ b/src/autoreplace_gui.cpp	Thu Jan 17 17:35:59 2008 +0000
@@ -506,38 +506,6 @@
 };
 
 
-void ShowReplaceVehicleWindow(VehicleType vehicletype)
-{
-	Window *w;
-
-	DeleteWindowById(WC_REPLACE_VEHICLE, vehicletype);
-
-	switch (vehicletype) {
-		case VEH_TRAIN:
-			w = AllocateWindowDescFront(&_replace_rail_vehicle_desc, vehicletype);
-			w->vscroll.cap  = 8;
-			w->resize.step_height = 14;
-			WP(w, replaceveh_d).wagon_btnstate = true;
-			break;
-		case VEH_ROAD:
-			w = AllocateWindowDescFront(&_replace_road_vehicle_desc, vehicletype);
-			w->vscroll.cap  = 8;
-			w->resize.step_height = 14;
-			break;
-		case VEH_SHIP:
-		case VEH_AIRCRAFT:
-			w = AllocateWindowDescFront(&_replace_ship_aircraft_vehicle_desc, vehicletype);
-			w->vscroll.cap  = 4;
-			w->resize.step_height = 24;
-			break;
-		default: return;
-	}
-
-	w->caption_color = _local_player;
-	w->vscroll2.cap = w->vscroll.cap;   // these two are always the same
-	WP(w, replaceveh_d).sel_group = DEFAULT_GROUP;
- }
-
 void ShowReplaceGroupVehicleWindow(GroupID id_g, VehicleType vehicletype)
 {
 	Window *w;
--- a/src/autoreplace_gui.h	Thu Jan 17 17:13:47 2008 +0000
+++ b/src/autoreplace_gui.h	Thu Jan 17 17:35:59 2008 +0000
@@ -13,7 +13,6 @@
  */
 void AddRemoveEngineFromAutoreplaceAndBuildWindows(VehicleType type);
 void InvalidateAutoreplaceWindow(EngineID e, GroupID id_g);
-void ShowReplaceVehicleWindow(VehicleType vehicletype);
 void ShowReplaceGroupVehicleWindow(GroupID group, VehicleType veh);
 
 #endif /* AUTOREPLACE_GUI_H */
--- a/src/vehicle_gui.cpp	Thu Jan 17 17:13:47 2008 +0000
+++ b/src/vehicle_gui.cpp	Thu Jan 17 17:35:59 2008 +0000
@@ -1125,7 +1125,7 @@
 
 					switch (e->we.dropdown.index) {
 						case 0: /* Replace window */
-							ShowReplaceVehicleWindow(vl->vehicle_type);
+							ShowReplaceGroupVehicleWindow(DEFAULT_GROUP, vl->vehicle_type);
 							break;
 						case 1: /* Send for servicing */
 							DoCommandP(0, GB(w->window_number, 16, 16) /* StationID or OrderID (depending on VLW) */,