(svn r6456) - Replace single colour scheme for passenger wagons with separate schemes for each of steam, diesel or electric engines. Savegames from the previous revision will not load.
authorpeter1138
Fri, 15 Sep 2006 17:36:54 +0000
changeset 4604 50d4768623b0
parent 4603 20c816f664de
child 4605 b13f553065ac
(svn r6456) - Replace single colour scheme for passenger wagons with separate schemes for each of steam, diesel or electric engines. Savegames from the previous revision will not load.
lang/english.txt
livery.h
player_gui.c
vehicle.c
--- a/lang/english.txt	Fri Sep 15 12:27:00 2006 +0000
+++ b/lang/english.txt	Fri Sep 15 17:36:54 2006 +0000
@@ -2174,7 +2174,9 @@
 STR_LIVERY_MAGLEV                                               :Maglev Engine
 STR_LIVERY_DMU                                                  :DMU
 STR_LIVERY_EMU                                                  :EMU
-STR_LIVERY_PASSENGER_WAGON                                      :Passenger Coach
+STR_LIVERY_PASSENGER_WAGON_STEAM                                :Passenger Coach (Steam)
+STR_LIVERY_PASSENGER_WAGON_DIESEL                               :Passenger Coach (Diesel)
+STR_LIVERY_PASSENGER_WAGON_ELECTRIC                             :Passenger Coach (Electric)
 STR_LIVERY_FREIGHT_WAGON                                        :Freight Wagon
 STR_LIVERY_BUS                                                  :Bus
 STR_LIVERY_TRUCK                                                :Lorry
--- a/livery.h	Fri Sep 15 12:27:00 2006 +0000
+++ b/livery.h	Fri Sep 15 17:36:54 2006 +0000
@@ -16,7 +16,9 @@
 	LS_MAGLEV,
 	LS_DMU,
 	LS_EMU,
-	LS_PASSENGER_WAGON,
+	LS_PASSENGER_WAGON_STEAM,
+	LS_PASSENGER_WAGON_DIESEL,
+	LS_PASSENGER_WAGON_ELECTRIC,
 	LS_FREIGHT_WAGON,
 
 	/* Road vehicles */
--- a/player_gui.c	Fri Sep 15 12:27:00 2006 +0000
+++ b/player_gui.c	Fri Sep 15 17:36:54 2006 +0000
@@ -269,7 +269,7 @@
 /* Association of liveries to livery classes */
 static const LiveryClass livery_class[LS_END] = {
 	LC_OTHER,
-	LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL,
+	LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL,
 	LC_ROAD, LC_ROAD,
 	LC_SHIP, LC_SHIP,
 	LC_AIRCRAFT, LC_AIRCRAFT, LC_AIRCRAFT,
@@ -278,7 +278,7 @@
 /* Number of liveries in each class, used to determine the height of the livery window */
 static const byte livery_height[] = {
 	1,
-	9,
+	11,
 	2,
 	2,
 	3,
--- a/vehicle.c	Fri Sep 15 12:27:00 2006 +0000
+++ b/vehicle.c	Fri Sep 15 17:36:54 2006 +0000
@@ -2322,8 +2322,19 @@
 
 						if (cargo_type == CT_INVALID) cargo_type = rvi->cargo_type;
 						if (rvi->flags & RVI_WAGON) {
-							scheme = (cargo_type == CT_PASSENGERS || cargo_type == CT_MAIL || cargo_type == CT_VALUABLES) ?
-								LS_PASSENGER_WAGON : LS_FREIGHT_WAGON;
+							if (cargo_type == CT_PASSENGERS || cargo_type == CT_MAIL || cargo_type == CT_VALUABLES) {
+								if (parent_engine_type == INVALID_ENGINE) {
+									scheme = LS_PASSENGER_WAGON_STEAM;
+								} else {
+									switch (RailVehInfo(parent_engine_type)->engclass) {
+										case 0: scheme = LS_PASSENGER_WAGON_STEAM; break;
+										case 1: scheme = LS_PASSENGER_WAGON_DIESEL; break;
+										case 2: scheme = LS_PASSENGER_WAGON_ELECTRIC; break;
+									}
+								}
+							} else {
+								scheme = LS_FREIGHT_WAGON;
+							}
 						} else {
 							bool is_mu = HASBIT(_engine_info[engine_type].misc_flags, EF_RAIL_IS_MU);