|
@@ -35,36 +35,34 @@ StringID GetEngineCategoryName(EngineID
|
|
|
switch (e->type) {
|
|
|
default: NOT_REACHED();
|
|
|
case VEH_ROAD: return STR_ENGINE_PREVIEW_ROAD_VEHICLE;
|
|
|
case VEH_AIRCRAFT: return STR_ENGINE_PREVIEW_AIRCRAFT;
|
|
|
case VEH_SHIP: return STR_ENGINE_PREVIEW_SHIP;
|
|
|
case VEH_TRAIN:
|
|
|
return GetRailTypeInfo(e->u.rail.railtype)->strings.new_loco;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/** Widgets used for the engine preview window */
|
|
|
enum EnginePreviewWidgets {
|
|
|
EPW_CLOSE, ///< Close button
|
|
|
EPW_CAPTION, ///< Title bar/caption
|
|
|
EPW_BACKGROUND, ///< Background
|
|
|
EPW_QUESTION, ///< The container for the question
|
|
|
EPW_NO, ///< No button
|
|
|
EPW_YES, ///< Yes button
|
|
|
};
|
|
|
|
|
|
static const NWidgetPart _nested_engine_preview_widgets[] = {
|
|
|
NWidget(NWID_HORIZONTAL),
|
|
|
NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE, EPW_CLOSE),
|
|
|
NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE, EPW_CAPTION), SetDataTip(STR_ENGINE_PREVIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
|
|
NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE),
|
|
|
NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE), SetDataTip(STR_ENGINE_PREVIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
|
|
EndContainer(),
|
|
|
NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE, EPW_BACKGROUND),
|
|
|
NWidget(WWT_EMPTY, INVALID_COLOUR, EPW_QUESTION), SetMinimalSize(300, 0), SetPadding(8, 8, 8, 8), SetFill(1, 0),
|
|
|
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(85, 10, 85),
|
|
|
NWidget(WWT_PUSHTXTBTN, COLOUR_LIGHT_BLUE, EPW_NO), SetDataTip(STR_QUIT_NO, STR_NULL), SetFill(1, 0),
|
|
|
NWidget(WWT_PUSHTXTBTN, COLOUR_LIGHT_BLUE, EPW_YES), SetDataTip(STR_QUIT_YES, STR_NULL), SetFill(1, 0),
|
|
|
EndContainer(),
|
|
|
NWidget(NWID_SPACER), SetMinimalSize(0, 8),
|
|
|
EndContainer(),
|
|
|
};
|
|
|
|
|
|
struct EnginePreviewWindow : Window {
|