mirror of https://github.com/OpenTTD/OpenTTD
(svn r19642) -Add: Sort cargos alphabetically at the "Reffitable to" label in the
build vehicle window.release/1.1
parent
949a6dd580
commit
d1c3234918
|
@ -572,15 +572,16 @@ uint ShowRefitOptionsList(int left, int right, int y, EngineID engine)
|
||||||
bool first = true;
|
bool first = true;
|
||||||
|
|
||||||
/* Add each cargo type to the list */
|
/* Add each cargo type to the list */
|
||||||
for (CargoID cid = 0; cid < NUM_CARGO; cid++) {
|
const CargoSpec *cs;
|
||||||
if (!HasBit(cmask, cid)) continue;
|
FOR_ALL_SORTED_CARGOSPECS(cs) {
|
||||||
|
if (!HasBit(cmask, cs->Index())) continue;
|
||||||
|
|
||||||
if (b >= lastof(string) - (2 + 2 * 4)) break; // ", " and two calls to Utf8Encode()
|
if (b >= lastof(string) - (2 + 2 * 4)) break; // ", " and two calls to Utf8Encode()
|
||||||
|
|
||||||
if (!first) b = strecpy(b, ", ", lastof(string));
|
if (!first) b = strecpy(b, ", ", lastof(string));
|
||||||
first = false;
|
first = false;
|
||||||
|
|
||||||
b = InlineString(b, CargoSpec::Get(cid)->name);
|
b = InlineString(b, cs->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue