Change: Show additional cost and refitted capacity in build vehicle window.

This commit is contained in:
peter1138
2019-03-23 21:06:46 +00:00
committed by PeterN
parent f8e6cd10ef
commit e6bb90543e
7 changed files with 165 additions and 64 deletions

View File

@@ -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);
}
}