summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-09-15 17:36:54 +0000
committerpeter1138 <peter1138@openttd.org>2006-09-15 17:36:54 +0000
commit53e90c0628f8c13dba46a82fe607a7ae33ae1a6f (patch)
tree88c8c569de29765f3e2c7ad99604d0e0e4da6c74
parente47dd91c8b133e548aa8f19e26c78818eaa433c5 (diff)
downloadopenttd-53e90c0628f8c13dba46a82fe607a7ae33ae1a6f.tar.xz
(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.
-rw-r--r--lang/english.txt4
-rw-r--r--livery.h4
-rw-r--r--player_gui.c4
-rw-r--r--vehicle.c15
4 files changed, 21 insertions, 6 deletions
diff --git a/lang/english.txt b/lang/english.txt
index 82ae2330c..467fc8523 100644
--- a/lang/english.txt
+++ b/lang/english.txt
@@ -2174,7 +2174,9 @@ STR_LIVERY_MONORAIL :Monorail Engine
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
diff --git a/livery.h b/livery.h
index 1834f9c75..990fe87e1 100644
--- a/livery.h
+++ b/livery.h
@@ -16,7 +16,9 @@ typedef enum LiverySchemes {
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 */
diff --git a/player_gui.c b/player_gui.c
index 3041dc016..443e63c9a 100644
--- a/player_gui.c
+++ b/player_gui.c
@@ -269,7 +269,7 @@ static const StringID _colour_dropdown[] = {
/* 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 @@ static const LiveryClass livery_class[LS_END] = {
/* 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,
diff --git a/vehicle.c b/vehicle.c
index 38875a76a..6d16bf60a 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -2322,8 +2322,19 @@ static PalSpriteID GetEngineColourMap(EngineID engine_type, PlayerID player, Eng
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);