src/engine_gui.cpp
changeset 10000 57463dc267a0
parent 9923 3056bf623139
equal deleted inserted replaced
9999:d88ba8e0fd38 10000:57463dc267a0
    15 #include "variables.h"
    15 #include "variables.h"
    16 #include "newgrf_engine.h"
    16 #include "newgrf_engine.h"
    17 #include "strings_func.h"
    17 #include "strings_func.h"
    18 #include "engine_gui.h"
    18 #include "engine_gui.h"
    19 #include "articulated_vehicles.h"
    19 #include "articulated_vehicles.h"
       
    20 #include "rail.h"
    20 
    21 
    21 #include "table/strings.h"
    22 #include "table/strings.h"
    22 #include "table/sprites.h"
    23 #include "table/sprites.h"
    23 
    24 
    24 StringID GetEngineCategoryName(EngineID engine)
    25 StringID GetEngineCategoryName(EngineID engine)
    27 		default: NOT_REACHED();
    28 		default: NOT_REACHED();
    28 		case VEH_ROAD:              return STR_8103_ROAD_VEHICLE;
    29 		case VEH_ROAD:              return STR_8103_ROAD_VEHICLE;
    29 		case VEH_AIRCRAFT:          return STR_8104_AIRCRAFT;
    30 		case VEH_AIRCRAFT:          return STR_8104_AIRCRAFT;
    30 		case VEH_SHIP:              return STR_8105_SHIP;
    31 		case VEH_SHIP:              return STR_8105_SHIP;
    31 		case VEH_TRAIN:
    32 		case VEH_TRAIN:
    32 			switch (RailVehInfo(engine)->railtype) {
    33 			return GetRailTypeInfo(RailVehInfo(engine)->railtype)->strings.new_loco;
    33 				default: NOT_REACHED();
       
    34 				case RAILTYPE_RAIL:     return STR_8102_RAILROAD_LOCOMOTIVE;
       
    35 				case RAILTYPE_ELECTRIC: return STR_8102_RAILROAD_LOCOMOTIVE;
       
    36 				case RAILTYPE_MONO:     return STR_8106_MONORAIL_LOCOMOTIVE;
       
    37 				case RAILTYPE_MAGLEV:   return STR_8107_MAGLEV_LOCOMOTIVE;
       
    38 			}
       
    39 	}
    34 	}
    40 }
    35 }
    41 
    36 
    42 static const Widget _engine_preview_widgets[] = {
    37 static const Widget _engine_preview_widgets[] = {
    43 {   WWT_CLOSEBOX,  RESIZE_NONE,  COLOUR_LIGHT_BLUE,    0,   10,    0,   13, STR_00C5,                                  STR_018B_CLOSE_WINDOW},
    38 {   WWT_CLOSEBOX,  RESIZE_NONE,  COLOUR_LIGHT_BLUE,    0,   10,    0,   13, STR_00C5,                                  STR_018B_CLOSE_WINDOW},