OpenTTD Source
20241120-master-g6d3adc6169
|
GUI to show engine related information. More...
#include "stdafx.h"
#include "window_gui.h"
#include "engine_base.h"
#include "command_func.h"
#include "strings_func.h"
#include "engine_gui.h"
#include "articulated_vehicles.h"
#include "vehicle_func.h"
#include "company_func.h"
#include "rail.h"
#include "road.h"
#include "settings_type.h"
#include "train.h"
#include "roadveh.h"
#include "ship.h"
#include "aircraft.h"
#include "engine_cmd.h"
#include "zoom_func.h"
#include "widgets/engine_widget.h"
#include "table/strings.h"
#include "safeguards.h"
Go to the source code of this file.
Data Structures | |
struct | EnginePreviewWindow |
Functions | |
StringID | GetEngineCategoryName (EngineID engine) |
Return the category of an engine. More... | |
void | ShowEnginePreviewWindow (EngineID engine) |
uint | GetTotalCapacityOfArticulatedParts (EngineID engine) |
Get the capacity of an engine with articulated parts. More... | |
static StringID | GetTrainEngineInfoString (const Engine *e) |
static StringID | GetAircraftEngineInfoString (const Engine *e) |
static StringID | GetRoadVehEngineInfoString (const Engine *e) |
static StringID | GetShipEngineInfoString (const Engine *e) |
StringID | GetEngineInfoString (EngineID engine) |
Get a multi-line string with some technical data, describing the engine. More... | |
void | DrawVehicleEngine (int left, int right, int preferred_x, int y, EngineID engine, PaletteID pal, EngineImageType image_type) |
Draw an engine. More... | |
void | EngList_Sort (GUIEngineList &el, EngList_SortTypeFunction compare) |
Sort all items using quick sort and given 'CompareItems' function. More... | |
void | EngList_SortPartial (GUIEngineList &el, EngList_SortTypeFunction compare, size_t begin, size_t num_items) |
Sort selected range of items (on indices @ <begin, begin+num_items-1>) More... | |
Variables | |
static constexpr NWidgetPart | _nested_engine_preview_widgets [] |
static WindowDesc | _engine_preview_desc (WDP_CENTER, nullptr, 0, 0, WC_ENGINE_PREVIEW, WC_NONE, WDF_CONSTRUCTION, _nested_engine_preview_widgets) |
GUI to show engine related information.
Definition in file engine_gui.cpp.
void DrawVehicleEngine | ( | int | left, |
int | right, | ||
int | preferred_x, | ||
int | y, | ||
EngineID | engine, | ||
PaletteID | pal, | ||
EngineImageType | image_type | ||
) |
Draw an engine.
left | Minimum horizontal position to use for drawing the engine |
right | Maximum horizontal position to use for drawing the engine |
preferred_x | Horizontal position to use for drawing the engine. |
y | Vertical position to use for drawing the engine. |
engine | Engine to draw. |
pal | Palette to use for drawing. |
Definition at line 303 of file engine_gui.cpp.
void EngList_Sort | ( | GUIEngineList & | el, |
EngList_SortTypeFunction | compare | ||
) |
Sort all items using quick sort and given 'CompareItems' function.
el | list to be sorted |
compare | function for evaluation of the quicksort |
Definition at line 333 of file engine_gui.cpp.
Referenced by ReplaceVehicleWindow::GenerateReplaceVehList().
void EngList_SortPartial | ( | GUIEngineList & | el, |
EngList_SortTypeFunction | compare, | ||
size_t | begin, | ||
size_t | num_items | ||
) |
Sort selected range of items (on indices @ <begin, begin+num_items-1>)
el | list to be sorted |
compare | function for evaluation of the quicksort |
begin | start of sorting |
num_items | count of items to be sorted |
Definition at line 346 of file engine_gui.cpp.
Return the category of an engine.
engine | Engine to examine. |
Definition at line 40 of file engine_gui.cpp.
References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::Get(), and Engine::type.
Referenced by NewVehicleAvailable().
Get a multi-line string with some technical data, describing the engine.
engine | Engine to describe. |
DParam
array is set up for printing the string. Definition at line 273 of file engine_gui.cpp.
References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_engine_pool >::Get(), Engine::type, and VEH_TRAIN.
uint GetTotalCapacityOfArticulatedParts | ( | EngineID | engine | ) |
Get the capacity of an engine with articulated parts.
engine | The engine to get the capacity of. |
Definition at line 165 of file engine_gui.cpp.
References GetCapacityOfArticulatedParts(), and CargoArray::GetSum().
Referenced by RoadVehEngineCapacitySorter().
|
staticconstexpr |
Definition at line 54 of file engine_gui.cpp.