Change: Display cargo lists in sorted cargo order. (#11383)

This commit is contained in:
2023-10-20 17:32:17 +01:00
committed by GitHub
parent 088db62dba
commit bb6fa9bf3b
5 changed files with 30 additions and 27 deletions

View File

@@ -574,11 +574,12 @@ static uint GetCargoWeight(const CargoArray &cap, VehicleType vtype)
static int DrawCargoCapacityInfo(int left, int right, int y, TestedEngineDetails &te, bool refittable)
{
for (CargoID c = 0; c < NUM_CARGO; c++) {
if (te.all_capacities[c] == 0) continue;
for (const CargoSpec *cs : _sorted_cargo_specs) {
CargoID cid = cs->Index();
if (te.all_capacities[cid] == 0) continue;
SetDParam(0, c);
SetDParam(1, te.all_capacities[c]);
SetDParam(0, cid);
SetDParam(1, te.all_capacities[cid]);
SetDParam(2, refittable ? STR_PURCHASE_INFO_REFITTABLE : STR_EMPTY);
DrawString(left, right, y, STR_PURCHASE_INFO_CAPACITY);
y += FONT_HEIGHT_NORMAL;