diff options
author | peter1138 <peter1138@openttd.org> | 2006-06-09 06:34:28 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2006-06-09 06:34:28 +0000 |
commit | a7fbd158a03671831a9199f0ac13d37217526e86 (patch) | |
tree | cec2376156d3bbcf58f1342e2749ec52302d80f7 /aircraft_gui.c | |
parent | ffeb87763fa891435330e36cfa02f2cdbeba7ba3 (diff) | |
download | openttd-a7fbd158a03671831a9199f0ac13d37217526e86.tar.xz |
(svn r5186) - NewGRF: show default aircraft cargo type and the purchase list (mart3p)
Diffstat (limited to 'aircraft_gui.c')
-rw-r--r-- | aircraft_gui.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/aircraft_gui.c b/aircraft_gui.c index 51695618f..a76acd34f 100644 --- a/aircraft_gui.c +++ b/aircraft_gui.c @@ -32,6 +32,7 @@ void DrawAircraftPurchaseInfo(int x, int y, EngineID engine_number) { const AircraftVehicleInfo *avi = AircraftVehInfo(engine_number); const Engine* e = GetEngine(engine_number); + CargoID cargo; YearMonthDay ymd; ConvertDayToYMD(&ymd, e->intro_date); @@ -42,9 +43,19 @@ void DrawAircraftPurchaseInfo(int x, int y, EngineID engine_number) y += 10; /* Cargo capacity */ - SetDParam(0, avi->passenger_capacity); - SetDParam(1, avi->mail_capacity); - DrawString(x, y, STR_PURCHASE_INFO_AIRCRAFT_CAPACITY, 0); + cargo = FindFirstRefittableCargo(engine_number); + if (cargo == CT_INVALID || cargo == CT_PASSENGERS) { + SetDParam(0, avi->passenger_capacity); + SetDParam(1, avi->mail_capacity); + DrawString(x, y, STR_PURCHASE_INFO_AIRCRAFT_CAPACITY, 0); + } else { + /* Note, if the default capacity is selected by the refit capacity + * callback, then the capacity shown is likely to be incorrect. */ + SetDParam(0, _cargoc.names_long[cargo]); + SetDParam(1, AircraftDefaultCargoCapacity(cargo, engine_number)); + SetDParam(2, STR_9842_REFITTABLE); + DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, 0); + } y += 10; /* Running cost */ |