1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-20 19:02:41 +01:00

Fix f34c45c36d: Incorrect colour in cargo list in fund industry window.

This commit is contained in:
Peter Nelson
2025-12-25 22:30:25 +00:00
committed by Peter Nelson
parent fb15730fc7
commit dc115cc785
2 changed files with 8 additions and 17 deletions

View File

@@ -368,27 +368,18 @@ class BuildIndustryWindow : public Window {
assert(cargolist.size() == cargo_suffix.size());
std::string cargostring;
size_t numcargo = 0;
size_t firstcargo = 0;
std::string_view list_separator = GetListSeparator();
for (size_t j = 0; j < cargolist.size(); j++) {
if (!IsValidCargoType(cargolist[j])) continue;
numcargo++;
if (numcargo == 1) {
firstcargo = j;
continue;
}
if (!cargostring.empty()) cargostring += list_separator;
auto params = MakeParameters(CargoSpec::Get(cargolist[j])->name, cargo_suffix[j].text);
AppendStringWithArgsInPlace(cargostring, STR_INDUSTRY_VIEW_CARGO_LIST_EXTENSION, params);
}
if (numcargo > 0) {
cargostring = GetString(prefixstr, CargoSpec::Get(cargolist[firstcargo])->name, cargo_suffix[firstcargo].text) + cargostring;
} else {
cargostring = GetString(prefixstr, STR_JUST_NOTHING, ""sv);
}
return cargostring;
if (cargostring.empty()) AppendStringInPlace(cargostring, STR_JUST_NOTHING);
return GetString(prefixstr, cargostring);
}
public:

View File

@@ -4066,9 +4066,9 @@ STR_INDUSTRY_VIEW_CARGO_GRAPH_TOOLTIP :{BLACK}Shows th
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Production level: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}The industry has announced imminent closure!
STR_INDUSTRY_VIEW_REQUIRES_N_CARGO :{BLACK}Requires: {YELLOW}{STRING}{RAW_STRING}
STR_INDUSTRY_VIEW_PRODUCES_N_CARGO :{BLACK}Produces: {YELLOW}{STRING}{RAW_STRING}
STR_INDUSTRY_VIEW_CARGO_LIST_EXTENSION :, {STRING}{RAW_STRING}
STR_INDUSTRY_VIEW_REQUIRES_N_CARGO :{BLACK}Requires: {YELLOW}{RAW_STRING}
STR_INDUSTRY_VIEW_PRODUCES_N_CARGO :{BLACK}Produces: {YELLOW}{RAW_STRING}
STR_INDUSTRY_VIEW_CARGO_LIST_EXTENSION :{STRING}{RAW_STRING}
STR_INDUSTRY_VIEW_REQUIRES :{BLACK}Requires:
STR_INDUSTRY_VIEW_ACCEPT_CARGO_SUFFIX :{YELLOW}{0:STRING}{BLACK}{3:RAW_STRING}