summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2017-03-18 20:46:15 +0000
committeralberth <alberth@openttd.org>2017-03-18 20:46:15 +0000
commit319de74d99aef1cc3212ef8be8c1bbc9fbd7dc28 (patch)
tree3ed1f328c88a886dcca969fafa93f444966e95e7
parent85ed4975bfd1c6ff3d429d3b1fe3e209b7d53404 (diff)
downloadopenttd-319de74d99aef1cc3212ef8be8c1bbc9fbd7dc28.tar.xz
(svn r27799) -Add: Display aircraft type in buy window (patch by Samu)
-rw-r--r--src/build_vehicle_gui.cpp16
-rw-r--r--src/lang/english.txt1
2 files changed, 16 insertions, 1 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp
index bd4bf3b59..655a18d7f 100644
--- a/src/build_vehicle_gui.cpp
+++ b/src/build_vehicle_gui.cpp
@@ -719,7 +719,15 @@ static int DrawShipPurchaseInfo(int left, int right, int y, EngineID engine_numb
return y;
}
-/* Draw aircraft specific details */
+/**
+ * Draw aircraft specific details in the buy window.
+ * @param left Left edge of the window to draw in.
+ * @param right Right edge of the window to draw in.
+ * @param y Top of the area to draw in.
+ * @param engine_number Engine to display.
+ * @param refittable If set, the aircraft can be refitted.
+ * @return Bottom of the used area.
+ */
static int DrawAircraftPurchaseInfo(int left, int right, int y, EngineID engine_number, bool refittable)
{
const Engine *e = Engine::Get(engine_number);
@@ -755,6 +763,12 @@ static int DrawAircraftPurchaseInfo(int left, int right, int y, EngineID engine_
DrawString(left, right, y, STR_PURCHASE_INFO_RUNNINGCOST);
y += FONT_HEIGHT_NORMAL;
+ /* Aircraft type */
+ SetDParam(0, e->GetAircraftTypeText());
+ DrawString(left, right, y, STR_PURCHASE_INFO_AIRCRAFT_TYPE);
+ y += FONT_HEIGHT_NORMAL;
+
+ /* Aircraft range, if available. */
uint16 range = e->GetRange();
if (range != 0) {
SetDParam(0, range);
diff --git a/src/lang/english.txt b/src/lang/english.txt
index 978e90ffa..683f352e2 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -3398,6 +3398,7 @@ STR_PURCHASE_INFO_ALL_TYPES :All cargo types
STR_PURCHASE_INFO_ALL_BUT :All but {CARGO_LIST}
STR_PURCHASE_INFO_MAX_TE :{BLACK}Max. Tractive Effort: {GOLD}{FORCE}
STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}Range: {GOLD}{COMMA} tiles
+STR_PURCHASE_INFO_AIRCRAFT_TYPE :{BLACK}Aircraft type: {GOLD}{STRING}
STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP :{BLACK}Train vehicle selection list. Click on vehicle for information. Ctrl+Click for toggling hiding of the vehicle type
STR_BUY_VEHICLE_ROAD_VEHICLE_LIST_TOOLTIP :{BLACK}Road vehicle selection list. Click on vehicle for information. Ctrl+Click for toggling hiding of the vehicle type