diff options
author | peter1138 <peter1138@openttd.org> | 2019-03-23 21:06:46 +0000 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2019-03-24 15:28:48 +0000 |
commit | e6bb90543e885d20814b4829c94c04909a311b71 (patch) | |
tree | ef9f3b8d7c0873ae47dcd96f3039748a836efe71 /src/autoreplace_gui.cpp | |
parent | f8e6cd10ef8161fbaa95a847a794e475d6aeb60e (diff) | |
download | openttd-e6bb90543e885d20814b4829c94c04909a311b71.tar.xz |
Change: Show additional cost and refitted capacity in build vehicle window.
Diffstat (limited to 'src/autoreplace_gui.cpp')
-rw-r--r-- | src/autoreplace_gui.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 196d076da..3a8a7543d 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -423,9 +423,16 @@ public: /* Draw details panels. */ for (int side = 0; side < 2; side++) { if (this->sel_engine[side] != INVALID_ENGINE) { + /* Use default engine details without refitting */ + const Engine *e = Engine::Get(this->sel_engine[side]); + TestedEngineDetails ted; + ted.cost = 0; + ted.cargo = e->GetDefaultCargoType(); + ted.capacity = e->GetDisplayDefaultCapacity(&ted.mail_capacity); + NWidgetBase *nwi = this->GetWidget<NWidgetBase>(side == 0 ? WID_RV_LEFT_DETAILS : WID_RV_RIGHT_DETAILS); int text_end = DrawVehiclePurchaseInfo(nwi->pos_x + WD_FRAMETEXT_LEFT, nwi->pos_x + nwi->current_x - WD_FRAMETEXT_RIGHT, - nwi->pos_y + WD_FRAMERECT_TOP, this->sel_engine[side]); + nwi->pos_y + WD_FRAMERECT_TOP, this->sel_engine[side], ted); needed_height = max(needed_height, text_end - (int)nwi->pos_y + WD_FRAMERECT_BOTTOM); } } |