1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 01:12:39 +01:00

Fix #14973: Incorrect colour for some composed strings.

This commit is contained in:
Peter Nelson
2025-12-25 04:29:58 +00:00
committed by Peter Nelson
parent c7f6971729
commit 8a4d60b812
3 changed files with 6 additions and 8 deletions

View File

@@ -268,9 +268,7 @@ std::optional<std::string> BuildCargoAcceptanceString(const CargoArray &acceptan
{
std::string_view list_separator = GetListSeparator();
/* Cargo acceptance is displayed in a extra multiline */
std::stringstream line;
line << GetString(label);
bool found = false;
for (const CargoSpec *cs : _sorted_cargo_specs) {
@@ -289,7 +287,7 @@ std::optional<std::string> BuildCargoAcceptanceString(const CargoArray &acceptan
}
}
if (found) return line.str();
if (found) return GetString(label, line.str());
return std::nullopt;
}

View File

@@ -2871,7 +2871,7 @@ STR_HOUSE_PICKER_YEARS_ANY :{BLACK}Years: {
STR_HOUSE_PICKER_YEARS_FROM :{BLACK}Years: {GOLD}From {NUM}
STR_HOUSE_PICKER_YEARS_UNTIL :{BLACK}Years: {GOLD}Until {NUM}
STR_HOUSE_PICKER_SIZE :{BLACK}Size: {GOLD}{NUM}x{NUM} tiles
STR_HOUSE_PICKER_CARGO_ACCEPTED :{BLACK}Cargo accepted: {GOLD}
STR_HOUSE_PICKER_CARGO_ACCEPTED :{BLACK}Cargo accepted: {GOLD}{RAW_STRING}
STR_HOUSE_PICKER_CARGO_PRODUCED :{BLACK}Cargo produced: {GOLD}{CARGO_LIST}
STR_HOUSE_PICKER_CLASS_ZONE1 :Edge
@@ -3159,7 +3159,7 @@ STR_LAND_AREA_INFORMATION_AIRPORT_CLASS :{BLACK}Airport
STR_LAND_AREA_INFORMATION_AIRPORT_NAME :{BLACK}Airport name: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_AIRPORTTILE_NAME :{BLACK}Airport tile name: {LTBLUE}{STRING}
STR_LAND_AREA_INFORMATION_NEWGRF_NAME :{BLACK}NewGRF: {LTBLUE}{RAW_STRING}
STR_LAND_AREA_INFORMATION_CARGO_ACCEPTED :{BLACK}Cargo accepted: {LTBLUE}
STR_LAND_AREA_INFORMATION_CARGO_ACCEPTED :{BLACK}Cargo accepted: {LTBLUE}{RAW_STRING}
STR_LAND_AREA_INFORMATION_CARGO_EIGHTS :({COMMA}/8 {STRING})
STR_LANG_AREA_INFORMATION_RAIL_TYPE :{BLACK}Rail type: {LTBLUE}{STRING}
STR_LANG_AREA_INFORMATION_ROAD_TYPE :{BLACK}Road type: {LTBLUE}{STRING}
@@ -4594,7 +4594,7 @@ STR_VEHICLE_DETAILS_TRAIN_CAPACITIES_TOOLTIP :{BLACK}Show cap
STR_VEHICLE_DETAIL_TAB_TOTAL_CARGO :{BLACK}Total Cargo
STR_VEHICLE_DETAILS_TRAIN_TOTAL_CARGO_TOOLTIP :{BLACK}Show total capacity of train, split by cargo type
STR_VEHICLE_DETAILS_TRAIN_ARTICULATED_RV_CAPACITY :{BLACK}Capacity: {LTBLUE}
STR_VEHICLE_DETAILS_TRAIN_ARTICULATED_RV_CAPACITY :{BLACK}Capacity: {LTBLUE}{RAW_STRING}
# Vehicle refit
STR_REFIT_CAPTION :{WHITE}{VEHICLE} (Refit)

View File

@@ -46,7 +46,7 @@ void DrawRoadVehDetails(const Vehicle *v, const Rect &r)
}
}
std::string capacity = GetString(STR_VEHICLE_DETAILS_TRAIN_ARTICULATED_RV_CAPACITY);
std::string capacity;
std::string_view list_separator = GetListSeparator();
bool first = true;
@@ -66,7 +66,7 @@ void DrawRoadVehDetails(const Vehicle *v, const Rect &r)
}
}
DrawString(r.left, r.right, y, capacity, TC_BLUE);
DrawString(r.left, r.right, y, GetString(STR_VEHICLE_DETAILS_TRAIN_ARTICULATED_RV_CAPACITY, capacity), TC_BLUE);
y += GetCharacterHeight(FS_NORMAL) + WidgetDimensions::scaled.vsep_normal;
for (const Vehicle *u = v; u != nullptr; u = u->Next()) {