1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-24 04:34:16 +01:00

Codechange: Use only raw strings in drop down lists. (#13667)

Strings with parameters are now pre-formatted, avoiding global parameters.

Helper functions still allow StringID.
This commit is contained in:
Peter Nelson
2025-02-27 21:11:16 +00:00
committed by GitHub
parent fd8c33d051
commit e2c1b9f03e
18 changed files with 55 additions and 67 deletions

View File

@@ -588,7 +588,7 @@ public:
if (count == 0 && !expanded) {
any_hidden = true;
} else {
list.push_back(std::make_unique<DropDownString<DropDownListCheckedItem, FS_SMALL, true>>(fmt::format("{}", count), 0, this->filter.include_no_rating, STR_STATION_LIST_CARGO_FILTER_NO_RATING, CargoFilterCriteria::CF_NO_RATING, false, count == 0));
list.push_back(std::make_unique<DropDownString<DropDownListCheckedItem, FS_SMALL, true>>(fmt::format("{}", count), 0, this->filter.include_no_rating, GetString(STR_STATION_LIST_CARGO_FILTER_NO_RATING), CargoFilterCriteria::CF_NO_RATING, false, count == 0));
}
Dimension d = GetLargestCargoIconSize();
@@ -597,7 +597,7 @@ public:
if (count == 0 && !expanded) {
any_hidden = true;
} else {
list.push_back(std::make_unique<DropDownListCargoItem>(HasBit(this->filter.cargoes, cs->Index()), fmt::format("{}", count), d, cs->GetCargoIcon(), PAL_NONE, cs->name, cs->Index(), false, count == 0));
list.push_back(std::make_unique<DropDownListCargoItem>(HasBit(this->filter.cargoes, cs->Index()), fmt::format("{}", count), d, cs->GetCargoIcon(), PAL_NONE, GetString(cs->name), cs->Index(), false, count == 0));
}
}