Changeset - r4604:56d029090928
[Not reviewed]
master
0 4 0
peter1138 - 18 years ago 2006-09-15 17:36:54
peter1138@openttd.org
(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.
4 files changed with 21 insertions and 6 deletions:
0 comments (0 inline, 0 general)
lang/english.txt
Show inline comments
 
@@ -2165,25 +2165,27 @@ STR_707D_OWNED_BY                       
 
STR_707E_OWNED_BY_OWNED_BY                                      :{WHITE}({COMMA}% owned by {COMPANY}{}   {COMMA}% owned by {COMPANY})
 
STR_707F_HAS_BEEN_TAKEN_OVER_BY                                 :{BLACK}{BIGFONT}{COMPANY} has been taken over by {COMPANY}!
 
STR_7080_PROTECTED                                              :{WHITE}This company is not old enough to trade shares yet...
 

	
 
STR_LIVERY_DEFAULT                                              :Standard Livery
 
STR_LIVERY_STEAM                                                :Steam Engine
 
STR_LIVERY_DIESEL                                               :Diesel Engine
 
STR_LIVERY_ELECTRIC                                             :Electric Engine
 
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
 
STR_LIVERY_PASSENGER_SHIP                                       :Passenger Ferry
 
STR_LIVERY_FREIGHT_SHIP                                         :Freight Ship
 
STR_LIVERY_HELICOPTER                                           :Helicopter
 
STR_LIVERY_SMALL_PLANE                                          :Small Aeroplane
 
STR_LIVERY_LARGE_PLANE                                          :Large Aeroplane
 

	
 
##id 0x8000
 
STR_8000_KIRBY_PAUL_TANK_STEAM                                  :Kirby Paul Tank (Steam)
 
STR_8001_MJS_250_DIESEL                                         :MJS 250 (Diesel)
livery.h
Show inline comments
 
@@ -7,25 +7,27 @@
 
/* List of different livery schemes. */
 
typedef enum LiverySchemes {
 
	LS_DEFAULT,
 

	
 
	/* Rail vehicles */
 
	LS_STEAM,
 
	LS_DIESEL,
 
	LS_ELECTRIC,
 
	LS_MONORAIL,
 
	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 */
 
	LS_BUS,
 
	LS_TRUCK,
 

	
 
	/* Ships */
 
	LS_PASSENGER_SHIP,
 
	LS_FREIGHT_SHIP,
 

	
 
	/* Aircraft */
 
	LS_HELICOPTER,
player_gui.c
Show inline comments
 
@@ -260,34 +260,34 @@ static const StringID _colour_dropdown[]
 
	STR_00DB_MAUVE,
 
	STR_00DC_PURPLE,
 
	STR_00DD_ORANGE,
 
	STR_00DE_BROWN,
 
	STR_00DF_GREY,
 
	STR_00E0_WHITE,
 
	INVALID_STRING_ID
 
};
 

	
 
/* 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,
 
};
 

	
 
/* 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,
 
};
 

	
 
typedef struct livery_d {
 
	uint32 sel;
 
	LiveryClass livery_class;
 
} livery_d;
 
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(livery_d));
 

	
 
static void ShowColourDropDownMenu(Window *w, uint32 widget)
vehicle.c
Show inline comments
 
@@ -2313,26 +2313,37 @@ static PalSpriteID GetEngineColourMap(En
 
	if (p->livery[LS_DEFAULT].in_use) {
 
		/* Determine the livery scheme to use */
 
		switch (GetEngine(engine_type)->type) {
 
			case VEH_Train: {
 
				switch (_engine_info[engine_type].railtype) {
 
					case RAILTYPE_RAIL:
 
					case RAILTYPE_ELECTRIC:
 
					{
 
						const RailVehicleInfo *rvi = RailVehInfo(engine_type);
 

	
 
						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);
 

	
 
							switch (rvi->engclass) {
 
								case 0: scheme = LS_STEAM; break;
 
								case 1: scheme = is_mu ? LS_DMU : LS_DIESEL; break;
 
								case 2: scheme = is_mu ? LS_EMU : LS_ELECTRIC; break;
 
							}
 
						}
 
						break;
 
					}
 

	
0 comments (0 inline, 0 general)