engine_gui.c
changeset 460 f11659d28617
parent 193 0a7025304867
child 507 8aa8100b0b22
equal deleted inserted replaced
459:b420a5479491 460:f11659d28617
    13 void DrawShipEngineInfo(int engine, int x, int y, int maxw);
    13 void DrawShipEngineInfo(int engine, int x, int y, int maxw);
    14 
    14 
    15 
    15 
    16 StringID GetEngineCategoryName(byte engine)
    16 StringID GetEngineCategoryName(byte engine)
    17 {
    17 {
    18 	if (engine < NUM_NORMAL_RAIL_ENGINES)
    18 	if (engine < NUM_TRAIN_ENGINES) {
    19 		return STR_8102_RAILROAD_LOCOMOTIVE;
    19 		switch (_engines[engine].railtype) {
    20 
    20 			case 0:
    21 	if (engine < NUM_NORMAL_RAIL_ENGINES + NUM_MONORAIL_ENGINES)
    21 				return STR_8102_RAILROAD_LOCOMOTIVE;
    22 		return STR_8106_MONORAIL_LOCOMOTIVE;
    22 			case 1:
    23 
    23 				return STR_8106_MONORAIL_LOCOMOTIVE;
    24 	if (engine < NUM_TRAIN_ENGINES)
    24 			case 2:
    25 		return STR_8107_MAGLEV_LOCOMOTIVE;
    25 				return STR_8107_MAGLEV_LOCOMOTIVE;
       
    26 		}
       
    27 	}
    26 
    28 
    27 	if (engine < NUM_TRAIN_ENGINES + NUM_ROAD_ENGINES)
    29 	if (engine < NUM_TRAIN_ENGINES + NUM_ROAD_ENGINES)
    28 		return STR_8103_ROAD_VEHICLE;
    30 		return STR_8103_ROAD_VEHICLE;
    29 
    31 
    30 	if (engine < NUM_TRAIN_ENGINES + NUM_ROAD_ENGINES + NUM_SHIP_ENGINES)
    32 	if (engine < NUM_TRAIN_ENGINES + NUM_ROAD_ENGINES + NUM_SHIP_ENGINES)